Add test for both _intanceof and manual method setting.

This commit is contained in:
Gary PEGEOT 2018-04-10 11:14:32 +02:00
parent 71bf3ced74
commit 1d811cb3f7
3 changed files with 29 additions and 0 deletions

View File

@ -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,
);
}
}

View File

@ -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]]

View File

@ -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