Warning: Undefined variable $use_statements in /home/wordpri/www/cci/amar/Projet-v1 2 apache/vendor/symfony/maker-bundle/src/Resources/skeleton/registration/Test.WithoutVerify.tpl.php on line 4
class RegistrationControllerTest extends WebTestCase
{
private KernelBrowser $client;
private
Warning: Undefined variable $repository_class_name in /home/wordpri/www/cci/amar/Projet-v1 2 apache/vendor/symfony/maker-bundle/src/Resources/skeleton/registration/Test.WithoutVerify.tpl.php on line 9
$userRepository;
protected function setUp(): void
{
$this->client = static::createClient();
// Ensure we have a clean database
$container = static::getContainer();
/** @var EntityManager $em */
$em = $container->get('doctrine')->getManager();
$this->userRepository = $container->get(
Warning: Undefined variable $repository_class_name in /home/wordpri/www/cci/amar/Projet-v1 2 apache/vendor/symfony/maker-bundle/src/Resources/skeleton/registration/Test.WithoutVerify.tpl.php on line 20
::class);
foreach ($this->userRepository->findAll() as $user) {
$em->remove($user);
}
$em->flush();
}
public function testRegister(): void
{
// Register a new user
$this->client->request('GET', '/register');
self::assertResponseIsSuccessful();
self::assertPageTitleContains('Register');
$this->client->submitForm('Register', [
'registration_form[email]' => 'me@example.com',
'registration_form[plainPassword]' => 'password',
'registration_form[agreeTerms]' => true,
]);
// Ensure the response redirects after submitting the form, the user exists, and is not verified
// self::assertResponseRedirects('/'); @TODO: set the appropriate path that the user is redirected to.
self::assertCount(1, $this->userRepository->findAll());
}
}