mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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;
|
||||
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Repository\UserRepositoryInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;
|
||||
@ -87,8 +88,9 @@ final class UserControllerTest extends WebTestCase
|
||||
|
||||
$username = 'Test_user' . uniqid();
|
||||
$password = 'Password1234!';
|
||||
|
||||
// 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[plainPassword][first]' => $password,
|
||||
'chill_mainbundle_user[plainPassword][second]' => $password,
|
||||
@ -157,9 +159,7 @@ final class UserControllerTest extends WebTestCase
|
||||
$passwordEncoder = self::$container
|
||||
->get(UserPasswordEncoderInterface::class);
|
||||
|
||||
$user = self::$kernel->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository(\Chill\MainBundle\Entity\User::class)
|
||||
$user = self::$container->get(UserRepositoryInterface::class)
|
||||
->findOneBy(['username' => $username]);
|
||||
|
||||
$this->assertTrue($passwordEncoder->isPasswordValid($user, $password));
|
||||
|
Loading…
x
Reference in New Issue
Block a user