From f1ae970a4e3c861819a1a0621b3cc299f2ea2dc6 Mon Sep 17 00:00:00 2001 From: Alex Bakhturin Date: Fri, 26 Sep 2014 10:04:52 -0700 Subject: [PATCH] Make Doctrine's dependency injection test less fragile. [Doctrine][DependencyInjection] The test checks that a few items are ordered according to the value of their 'priority' attribute. However, a few of the items have the same value of this attribute. RegisterEventListenersAndSubscribersPass doesn't use a stable sorting, yet the test asserts that items that are 'equal' shall go in the original order. Modified so that the order of the original items is not checked. --- .../RegisterEventListenersAndSubscribersPassTest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php index 24fbcdc9a6..ae8a76750f 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php @@ -139,7 +139,11 @@ class RegisterEventListenersAndSubscribersPassTest extends \PHPUnit_Framework_Te ; $this->process($container); - $this->assertEquals(array('c', 'd', 'e', 'b', 'a'), $this->getServiceOrder($container, 'addEventSubscriber')); + $serviceOrder = $this->getServiceOrder($container, 'addEventSubscriber'); + $unordered = array_splice($serviceOrder, 0, 3); + sort($unordered); + $this->assertEquals(array('c', 'd', 'e'), $unordered); + $this->assertEquals(array('b', 'a'), $serviceOrder); } private function process(ContainerBuilder $container)