Skip to content

Enhancing integration test to show that "override" tags show up first #22398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function testInstanceofDefaultsAndParentDefinitionResolution()
// 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()
Expand Down Expand Up @@ -169,10 +169,10 @@ public function testInstanceofDefaultsAndParentDefinitionResolution()
// 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()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was actually a typo/bug that I made originally. Fixed now

);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
autowire: false
shared: false
tags:
- { name: foo_tag }
- { name: foo_tag, tag_option: from_instanceof }
calls:
- [setSunshine, [bright]]

Expand All @@ -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]]
Expand All @@ -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 }