mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-07 23:34:58 +00:00
fix cs
This commit is contained in:
@@ -27,25 +27,6 @@ final class UserControllerTest extends WebTestCase
|
||||
{
|
||||
use PrepareClientTrait;
|
||||
|
||||
public static function dataGenerateUserId()
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
/** @var UserPasswordHasherInterface::class $passwordHasher */
|
||||
$passwordHasher = self::getContainer()->get(UserPasswordHasherInterface::class);
|
||||
|
||||
$user = new User();
|
||||
$user->setUsername('Test_user '.uniqid());
|
||||
$user->setPassword($passwordHasher->hashPassword($user, 'password'));
|
||||
|
||||
$em->persist($user);
|
||||
$em->flush();
|
||||
|
||||
self::ensureKernelShutdown();
|
||||
|
||||
yield [$user->getId(), $user->getUsername()];
|
||||
}
|
||||
|
||||
public function testList()
|
||||
{
|
||||
$client = $this->getClientAuthenticatedAsAdmin();
|
||||
@@ -135,6 +116,25 @@ final class UserControllerTest extends WebTestCase
|
||||
$this->isPasswordValid($username, $newPassword);
|
||||
}
|
||||
|
||||
public static function dataGenerateUserId()
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
/** @var UserPasswordHasherInterface::class $passwordHasher */
|
||||
$passwordHasher = self::getContainer()->get(UserPasswordHasherInterface::class);
|
||||
|
||||
$user = new User();
|
||||
$user->setUsername('Test_user '.uniqid());
|
||||
$user->setPassword($passwordHasher->hashPassword($user, 'password'));
|
||||
|
||||
$em->persist($user);
|
||||
$em->flush();
|
||||
|
||||
self::ensureKernelShutdown();
|
||||
|
||||
yield [$user->getId(), $user->getUsername()];
|
||||
}
|
||||
|
||||
protected function isPasswordValid($username, $password)
|
||||
{
|
||||
/** @var \Symfony\Component\PasswordHasher\Hasher\UserPasswordHasher $passwordEncoder */
|
||||
|
Reference in New Issue
Block a user