Skip to content

Commit 8c5267e

Browse files
committed
Sort services in service locator according to priority
1 parent 0ae4c94 commit 8c5267e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public function testNoExceptionOnNonExistentTypeHintOptionalArg()
249249
$pass->process($container);
250250

251251
$locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0);
252-
$this->assertSame(['foo::barAction', 'foo::fooAction'], array_keys($locator));
252+
$this->assertEqualsCanonicalizing(['foo::barAction', 'foo::fooAction'], array_keys($locator));
253253
}
254254

255255
public function testArgumentWithNoTypeHintIsOk()
@@ -396,7 +396,10 @@ public function testAlias()
396396
$pass->process($container);
397397

398398
$locator = $container->getDefinition((string) $resolver->getArgument(0))->getArgument(0);
399-
$this->assertSame([RegisterTestController::class.'::fooAction', 'foo::fooAction'], array_keys($locator));
399+
400+
$services = array_keys($locator);
401+
sort($services);
402+
$this->assertSame([RegisterTestController::class.'::fooAction', 'foo::fooAction'], $services);
400403
}
401404

402405
/**

Tests/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testProcess()
5757
'Symfony\Component\HttpKernel\DependencyInjection\RemoveEmptyControllerArgumentLocatorsPass: Removing method "setTestCase" of service "c2" from controller candidates: the method is called at instantiation, thus cannot be an action.',
5858
];
5959

60-
$this->assertSame($expectedLog, $container->getCompiler()->getLog());
60+
$this->assertEqualsCanonicalizing($expectedLog, $container->getCompiler()->getLog());
6161
}
6262

6363
public function testInvoke()

0 commit comments

Comments
 (0)