8000 minor #12058 [Doctrine][DependencyInjection] Make a test less fragile… · src-run/symfony@2ecbf87 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ecbf87

Browse files
committed
minor symfony#12058 [Doctrine][DependencyInjection] Make a test less fragile. (AlphaStream)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes symfony#12058). Discussion ---------- [Doctrine][DependencyInjection] Make a test less fragile. 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. | Q | A | ------------- | --- | Bug fix? | [no] | New feature? | [no] | BC breaks? | [no] | Deprecations? | [no] | Tests pass? | [yes] | Fixed tickets | [none] | License | MIT | Doc PR | [none] Commits ------- f1ae970 Make Doctrine's dependency injection test less fragile.
2 parents 55b35a2 + f1ae970 commit 2ecbf87

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php

Lines changed: 5 additions & 1 deletion
95BA
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ public function testProcessEventSubscribersWithPriorities()
139139
;
140140

141141
$this->process($container);
142-
$this->assertEquals(array('c', 'd', 'e', 'b', 'a'), $this->getServiceOrder($container, 'addEventSubscriber'));
142+
$serviceOrder = $this->getServiceOrder($container, 'addEventSubscriber');
143+
$unordered = array_splice($serviceOrder, 0, 3);
144+
sort($unordered);
145+
$this->assertEquals(array('c', 'd', 'e'), $unordered);
146+
$this->assertEquals(array('b', 'a'), $serviceOrder);
143147
}
144148

145149
private function process(ContainerBuilder $container)

0 commit comments

Comments
 (0)
0