Add test for both _intanceof and manual method setting.
This commit is contained in:
parent
71bf3ced74
commit
1d811cb3f7
@ -207,6 +207,16 @@ class IntegrationTest extends TestCase
|
||||
'child_service',
|
||||
'child_service_expected',
|
||||
);
|
||||
|
||||
$container = new ContainerBuilder();
|
||||
$container->registerForAutoconfiguration(IntegrationTestStub::class)
|
||||
->addMethodCall('setSunshine', array('supernova'));
|
||||
yield array(
|
||||
'instanceof_and_calls',
|
||||
'main_service',
|
||||
'main_service_expected',
|
||||
$container,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
services:
|
||||
# main_service should look like this in the end
|
||||
main_service_expected:
|
||||
class: Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStub
|
||||
public: true
|
||||
autoconfigure: true
|
||||
calls:
|
||||
- [setSunshine, [supernova]]
|
||||
- [setSunshine, [warm]]
|
||||
|
@ -0,0 +1,9 @@
|
||||
services:
|
||||
_instanceof:
|
||||
Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStubParent:
|
||||
calls:
|
||||
- [setSunshine, [warm]]
|
||||
main_service:
|
||||
class: Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStub
|
||||
autoconfigure: true
|
||||
public: true
|
Reference in New Issue
Block a user