mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Fix selector button
This commit is contained in:
parent
0e0b0b8874
commit
43ac6726aa
@ -12,6 +12,7 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Tests\Controller;
|
namespace Chill\MainBundle\Tests\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
|
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||||
@ -87,8 +88,9 @@ final class UserControllerTest extends WebTestCase
|
|||||||
|
|
||||||
$username = 'Test_user' . uniqid();
|
$username = 'Test_user' . uniqid();
|
||||||
$password = 'Password1234!';
|
$password = 'Password1234!';
|
||||||
|
|
||||||
// Fill in the form and submit it
|
// Fill in the form and submit it
|
||||||
$form = $crawler->selectButton('Créer')->form([
|
$form = $crawler->selectButton('Créer & fermer')->form([
|
||||||
'chill_mainbundle_user[username]' => $username,
|
'chill_mainbundle_user[username]' => $username,
|
||||||
'chill_mainbundle_user[plainPassword][first]' => $password,
|
'chill_mainbundle_user[plainPassword][first]' => $password,
|
||||||
'chill_mainbundle_user[plainPassword][second]' => $password,
|
'chill_mainbundle_user[plainPassword][second]' => $password,
|
||||||
@ -157,9 +159,7 @@ final class UserControllerTest extends WebTestCase
|
|||||||
$passwordEncoder = self::$container
|
$passwordEncoder = self::$container
|
||||||
->get(UserPasswordEncoderInterface::class);
|
->get(UserPasswordEncoderInterface::class);
|
||||||
|
|
||||||
$user = self::$kernel->getContainer()
|
$user = self::$container->get(UserRepositoryInterface::class)
|
||||||
->get('doctrine.orm.entity_manager')
|
|
||||||
->getRepository(\Chill\MainBundle\Entity\User::class)
|
|
||||||
->findOneBy(['username' => $username]);
|
->findOneBy(['username' => $username]);
|
||||||
|
|
||||||
$this->assertTrue($passwordEncoder->isPasswordValid($user, $password));
|
$this->assertTrue($passwordEncoder->isPasswordValid($user, $password));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user