diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php index e7fdb3593a..3dbec91eb8 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php @@ -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, + ); } } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/integration/instanceof_and_calls/expected.yml b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/integration/instanceof_and_calls/expected.yml new file mode 100644 index 0000000000..2d485a7a24 --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/integration/instanceof_and_calls/expected.yml @@ -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]] + diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/integration/instanceof_and_calls/main.yml b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/integration/instanceof_and_calls/main.yml new file mode 100644 index 0000000000..aa0924e107 --- /dev/null +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/integration/instanceof_and_calls/main.yml @@ -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