Skip to content

Commit 8856397

Browse files
committed
fix: corrected CI build
1 parent 652502f commit 8856397

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

tests/phpMyFAQ/Controller/Administration/AuthenticationControllerWebTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testLoginShowsKeycloakAffordanceWhenEnabled(): void
2323
$response = $this->requestAdminGuest('GET', '/login');
2424

2525
self::assertResponseIsSuccessful($response);
26-
self::assertResponseContains('../auth/keycloak/authorize', $response);
26+
self::assertResponseContains('auth/keycloak/authorize', $response);
2727
self::assertResponseContains('Sign in with Keycloak', $response);
2828
}
2929

@@ -36,7 +36,7 @@ public function testLoginHidesKeycloakAffordanceWhenDisabled(): void
3636
$response = $this->requestAdminGuest('GET', '/login');
3737

3838
self::assertResponseIsSuccessful($response);
39-
self::assertStringNotContainsString('../auth/keycloak/authorize', (string) $response->getContent());
39+
self::assertStringNotContainsString('auth/keycloak/authorize', (string) $response->getContent());
4040
self::assertStringNotContainsString('Sign in with Keycloak', (string) $response->getContent());
4141
}
4242
}

tests/phpMyFAQ/Controller/Frontend/KeycloakAuthenticationControllerWebTest.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
namespace phpMyFAQ\Controller\Frontend;
66

77
use OpenSSLAsymmetricKey;
8-
use phpMyFAQ\Auth\Oidc\OidcSession;
98
use phpMyFAQ\Functional\ControllerWebTestCase;
109
use PHPUnit\Framework\Attributes\CoversClass;
1110
use PHPUnit\Framework\Attributes\UsesClass;
1211
use PHPUnit\Framework\Attributes\UsesNamespace;
1312
use Symfony\Component\DependencyInjection\ContainerInterface;
1413
use Symfony\Component\HttpClient\MockHttpClient;
1514
use Symfony\Component\HttpClient\Response\MockResponse;
16-
use Symfony\Component\HttpFoundation\Session\SessionInterface;
1715

1816
#[CoversClass(KeycloakAuthenticationController::class)]
1917
#[UsesNamespace('phpMyFAQ')]
@@ -72,10 +70,8 @@ public function testCallbackCompletesSuccessfulLoginFlowWithMockedProviderRespon
7270
$container = self::$kernel?->getContainer();
7371
self::assertInstanceOf(ContainerInterface::class, $container);
7472

75-
$session = $container->get('session');
76-
self::assertInstanceOf(SessionInterface::class, $session);
77-
78-
$oidcSession = new OidcSession($session);
73+
$oidcSession = $container->get('phpmyfaq.auth.oidc.session');
74+
self::assertInstanceOf(\phpMyFAQ\Auth\Oidc\OidcSession::class, $oidcSession);
7975
$oidcSession->setAuthorizationState('state-123', 'nonce-456', 'verifier-789');
8076

8177
$idToken = $this->signToken([
@@ -128,10 +124,8 @@ public function testLogoutBuildsProviderRedirectWithSessionIdToken(): void
128124
$container = self::$kernel?->getContainer();
129125
self::assertInstanceOf(ContainerInterface::class, $container);
130126

131-
$session = $container->get('session');
132-
self::assertInstanceOf(SessionInterface::class, $session);
133-
134-
$oidcSession = new OidcSession($session);
127+
$oidcSession = $container->get('phpmyfaq.auth.oidc.session');
128+
self::assertInstanceOf(\phpMyFAQ\Auth\Oidc\OidcSession::class, $oidcSession);
135129
$oidcSession->setIdToken('session-id-token');
136130

137131
$httpClient = new MockHttpClient([

0 commit comments

Comments
 (0)