Enhancing integration test to show that "override" tags always show up first
This commit is contained in:
parent
9950b90bb6
commit
e9b96e5f44
@ -135,7 +135,7 @@ class IntegrationTest extends TestCase
|
||||
// all tags are kept
|
||||
$this->assertEquals(
|
||||
array(
|
||||
'foo_tag' => array(array('priority' => 100), array()),
|
||||
'foo_tag' => array(array('tag_option' => 'from_service'), array('tag_option' => 'from_instanceof')),
|
||||
'bar_tag' => array(array()),
|
||||
),
|
||||
$simpleService->getTags()
|
||||
@ -169,10 +169,10 @@ class IntegrationTest extends TestCase
|
||||
// tags inherit like normal
|
||||
$this->assertEquals(
|
||||
array(
|
||||
'foo_tag' => array(array('priority' => 100), array()),
|
||||
'foo_tag' => array(array('tag_option' => 'from_child_def'), array('tag_option' => 'from_parent_def'), array('tag_option' => 'from_instanceof')),
|
||||
'bar_tag' => array(array()),
|
||||
),
|
||||
$simpleService->getTags()
|
||||
$childDef2->getTags()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ services:
|
||||
autowire: false
|
||||
shared: false
|
||||
tags:
|
||||
- { name: foo_tag }
|
||||
- { name: foo_tag, tag_option: from_instanceof }
|
||||
calls:
|
||||
- [setSunshine, [bright]]
|
||||
|
||||
@ -20,8 +20,8 @@ services:
|
||||
service_simple:
|
||||
class: Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStub
|
||||
tags:
|
||||
- { name: foo_tag, priority: 100 }
|
||||
# calls from instanceof are kept, but this comes later
|
||||
- { name: foo_tag, tag_option: from_service }
|
||||
# calls from instanceof are kept, but this comes later
|
||||
calls:
|
||||
- [enableSummer, [true]]
|
||||
- [setSunshine, [warm]]
|
||||
@ -43,7 +43,12 @@ services:
|
||||
parent_service_with_class:
|
||||
abstract: true
|
||||
class: Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStub
|
||||
tags:
|
||||
- { name: foo_tag, tag_option: from_parent_def }
|
||||
|
||||
child_service_with_parent_instanceof:
|
||||
parent: parent_service_with_class
|
||||
shared: true
|
||||
inherit_tags: true
|
||||
tags:
|
||||
- { name: foo_tag, tag_option: from_child_def }
|
||||
|
Reference in New Issue
Block a user