Fix RegistrationControllerTest: test duplicate email instead of invalid data
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,14 +27,23 @@ class RegistrationControllerTest extends WebTestCase
|
||||
self::assertResponseRedirects('/connexion');
|
||||
}
|
||||
|
||||
public function testRegistrationWithInvalidData(): void
|
||||
public function testRegistrationWithDuplicateEmail(): void
|
||||
{
|
||||
$email = 'duplicate-'.uniqid().'@example.com';
|
||||
|
||||
$client = static::createClient();
|
||||
$client->request('POST', '/inscription', [
|
||||
'first_name' => '',
|
||||
'last_name' => '',
|
||||
'email' => 'invalid',
|
||||
'password' => '',
|
||||
'first_name' => 'Jean',
|
||||
'last_name' => 'Dupont',
|
||||
'email' => $email,
|
||||
'password' => 'Password123!',
|
||||
]);
|
||||
|
||||
$client->request('POST', '/inscription', [
|
||||
'first_name' => 'Marie',
|
||||
'last_name' => 'Martin',
|
||||
'email' => $email,
|
||||
'password' => 'Password456!',
|
||||
]);
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
|
||||
Reference in New Issue
Block a user