From e9b96e5f446b24a642700e88c8d4cce82d79cf78 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Wed, 12 Apr 2017 10:34:49 -0400 Subject: [PATCH] Enhancing integration test to show that "override" tags always show up first --- .../Tests/Compiler/IntegrationTest.php | 6 +++--- .../yaml/services_defaults_instanceof_parent.yml | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php index 5598900680..962020700b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php @@ -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() ); } } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services_defaults_instanceof_parent.yml b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services_defaults_instanceof_parent.yml index 7ff543d30d..838e0626e7 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services_defaults_instanceof_parent.yml +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services_defaults_instanceof_parent.yml @@ -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 }