Skip to content

Commit

Permalink
Make Doctrine's dependency injection test less fragile.
Browse files Browse the repository at this point in the history
[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.
  • Loading branch information
AlphaStream authored and fabpot committed Sep 27, 2014
1 parent 55b35a2 commit f1ae970
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -139,7 +139,11 @@ public function testProcessEventSubscribersWithPriorities()
;

$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)
Expand Down

0 comments on commit f1ae970

Please sign in to comment.