Files
e-ticket/tests/Controller/RegistrationControllerTest.php
Serreau Jovann 1e41a9746c Fix test coverage and PHPUnit notices
- RegistrationController: add POST tests (valid + invalid data)
- ViteAssetExtension: add tests for manifest file loading, faviconsProd, isMobile, getNonce
- CacheService: fix mock return values to suppress PHPUnit notices
- User: add comment to empty eraseCredentials method
- Email base template: add title tag

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 23:14:04 +01:00

43 lines
1.1 KiB
PHP

<?php
namespace App\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class RegistrationControllerTest extends WebTestCase
{
public function testRegistrationPageReturnsSuccess(): void
{
$client = static::createClient();
$client->request('GET', '/inscription');
self::assertResponseIsSuccessful();
}
public function testRegistrationWithValidData(): void
{
$client = static::createClient();
$client->request('POST', '/inscription', [
'first_name' => 'Jean',
'last_name' => 'Dupont',
'email' => 'test-register-'.uniqid().'@example.com',
'password' => 'Password123!',
]);
self::assertResponseRedirects('/connexion');
}
public function testRegistrationWithInvalidData(): void
{
$client = static::createClient();
$client->request('POST', '/inscription', [
'first_name' => '',
'last_name' => '',
'email' => 'invalid',
'password' => '',
]);
self::assertResponseIsSuccessful();
}
}