Skip to content

Commit 273caac

Browse files
author
Gary PEGEOT
committed
Add test for both _intanceof and manual method setting.
1 parent 02bd2a6 commit 273caac

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

Tests/Compiler/IntegrationTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,16 @@ public function getYamlCompileTests()
207207
'child_service',
208208
'child_service_expected',
209209
);
210+
211+
$container = new ContainerBuilder();
212+
$container->registerForAutoconfiguration(IntegrationTestStub::class)
213+
->addMethodCall('setSunshine', array('supernova'));
214+
yield array(
215+
'instanceof_and_calls',
216+
'main_service',
217+
'main_service_expected',
218+
$container,
219+
);
210220
}
211221
}
212222

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
services:
2+
# main_service should look like this in the end
3+
main_service_expected:
4+
class: Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStub
5+
public: true
6+
autoconfigure: true
7+
calls:
8+
- [setSunshine, [supernova]]
9+
- [setSunshine, [warm]]
10+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
_instanceof:
3+
Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStubParent:
4+
calls:
5+
- [setSunshine, [warm]]
6+
main_service:
7+
class: Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStub
8+
autoconfigure: true
9+
public: true

0 commit comments

Comments
 (0)