Files
e-ticket/tests/Controller/OAuthControllerTest.php
Serreau Jovann 53d8b30942 Add tests for KeycloakAuthenticator, OAuthController, and SSO login button
- Add KeycloakAuthenticatorTest: supports, success/failure redirects, user creation,
  email linking, user update, /superadmin group to ROLE_ROOT mapping, unknown groups
- Add OAuthControllerTest: SSO login redirects to Keycloak, SSO logout redirects to home
- Add SSO button presence test to SecurityControllerTest

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 10:47:39 +01:00

26 lines
686 B
PHP

<?php
namespace App\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class OAuthControllerTest extends WebTestCase
{
public function testSsoLoginRedirectsToKeycloak(): void
{
$client = static::createClient();
$client->request('GET', '/connection/sso/login');
self::assertResponseRedirects();
self::assertStringContainsString('auth.esy-web.dev', $client->getResponse()->headers->get('Location'));
}
public function testSsoLogoutRedirectsToHome(): void
{
$client = static::createClient();
$client->request('GET', '/connection/sso/logout');
self::assertResponseRedirects('/');
}
}