Skip to content

Commit e9b96e5

Browse files
committed
Enhancing integration test to show that "override" tags always show up first
1 parent 9950b90 commit e9b96e5

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function testInstanceofDefaultsAndParentDefinitionResolution()
135135
// all tags are kept
136136
$this->assertEquals(
137137
array(
138-
'foo_tag' => array(array('priority' => 100), array()),
138+
'foo_tag' => array(array('tag_option' => 'from_service'), array('tag_option' => 'from_instanceof')),
139139
'bar_tag' => array(array()),
140140
),
141141
$simpleService->getTags()
@@ -169,10 +169,10 @@ public function testInstanceofDefaultsAndParentDefinitionResolution()
169169
// tags inherit like normal
170170
$this->assertEquals(
171171
array(
172-
'foo_tag' => array(array('priority' => 100), array()),
172+
'foo_tag' => array(array('tag_option' => 'from_child_def'), array('tag_option' => 'from_parent_def'), array('tag_option' => 'from_instanceof')),
173173
'bar_tag' => array(array()),
174174
),
175-
$simpleService->getTags()
175+
$childDef2->getTags()
176176
);
177177
}
178178
}

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services_defaults_instanceof_parent.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
autowire: false
99
shared: false
1010
tags:
11-
- { name: foo_tag }
11+
- { name: foo_tag, tag_option: from_instanceof }
1212
calls:
1313
- [setSunshine, [bright]]
1414

@@ -20,8 +20,8 @@ services:
2020
service_simple:
2121
class: Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStub
2222
tags:
23-
- { name: foo_tag, priority: 100 }
24-
# calls from instanceof are kept, but this comes later
23+
- { name: foo_tag, tag_option: from_service }
24+
# calls from instanceof are kept, but this comes later
2525
calls:
2626
- [enableSummer, [true]]
2727
- [setSunshine, [warm]]
@@ -43,7 +43,12 @@ services:
4343
parent_service_with_class:
4444
abstract: true
4545
class: Symfony\Component\DependencyInjection\Tests\Compiler\IntegrationTestStub
46+
tags:
47+
- { name: foo_tag, tag_option: from_parent_def }
4648

4749
child_service_with_parent_instanceof:
4850
parent: parent_service_with_class
4951
shared: true
52+
inherit_tags: true
53+
tags:
54+
- { name: foo_tag, tag_option: from_child_def }

0 commit comments

Comments
 (0)