Skip to content

Commit

Permalink
Fix unittests failing from having missing service-ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Zombaya committed Dec 16, 2024
1 parent 858bcb2 commit 241815d
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ public function testConfigLoadsCorrectServicesAndParameters(
$expectedServices[$id] = $definition->getClass();
}

$originalExpectedServiceIds = $container->getServiceIds();

$versionTester = $this->createMock(VersionTester::class);
foreach ($mockedVersions as $method => $response) {
$versionTester->method($method)->willReturn($response);
Expand All @@ -282,14 +284,11 @@ public function testConfigLoadsCorrectServicesAndParameters(

$this->assertEqualsCanonicalizing($expectedParameters, $container->getParameterBag()->all());

$expectedServiceIds = array_merge(
$expectedServiceIds = array_unique(array_merge(
$originalExpectedServiceIds,
array_keys($expectedServices),
array_keys($expectedAliases),
[
\Psr\Container\ContainerInterface::class,
\Symfony\Component\DependencyInjection\ContainerInterface::class,
]
);
array_keys($expectedAliases)
));

$this->assertEqualsCanonicalizing($expectedServiceIds, $container->getServiceIds());

Expand Down

0 comments on commit 241815d

Please sign in to comment.