rater/tests/Integration/Auth/LoginTest.php
2026-06-05 11:15:30 +00:00

34 lines
861 B
PHP

<?php
namespace App\Tests\Integration\Auth;
use App\Repository\UserRepository;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class LoginTest extends WebTestCase
{
public function testAddingNewSubject(): void
{
$client = static::createClient();
$faker = \Zenstruck\Foundry\faker();
$email = $faker->email();
$plainPwd = $faker->password(8, 12);
$client->request('GET', '/account/register');
$client->submitForm('form_register', [
'form[email]' => $email,
'form[password]' => $plainPwd,
'form[password_again]' => $plainPwd,
]);
$this->assertResponseRedirects();
$subject = static::getContainer()
->get(UserRepository::class)
->findOneBy(['email' => $email]);
$this->assertNotNull($subject);
}
}