Skip to content

Commit

Permalink
Ensure kernel is shutdown before createClient is called
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoiriert committed May 21, 2024
1 parent 9b89b71 commit 4261261
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ private function initializeClients(TestCase $testCase): void
);
}

// This is to ensure the kernel is not booted before calling createClient
// Can happen if we use the container in a setUpBeforeClass method or a beforeClass hook
ReflectionAccessor::callMethod(
$testCase,
'ensureKernelShutdown'
);

foreach ($clientAttributes as [$property, $attribute]) {
\assert($property instanceof \ReflectionProperty);
\assert($attribute instanceof \ReflectionAttribute);
Expand Down
5 changes: 0 additions & 5 deletions tests/Controller/Security/TwoFactorAuthorizationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ public static function cleanUp(): void
->execute();
}

protected function setUp(): void
{
static::ensureKernelShutdown();
}

public function testLoginRedirectEnable2fa(): void
{
static::assertTrue(self::$user->needToEnableTotpAuthenticationEnabled());
Expand Down

0 comments on commit 4261261

Please sign in to comment.