mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 23:53:50 +00:00
Replaced the deprecated 'self::$container->get' with 'self::getContainer()->get' using rector
This change is made to comply with the new Symfony standards and to avoid deprecation warnings for future versions. The update touches various functionalities, including retrieving EntityManagerInterface instance and various service classes within the test files.
This commit is contained in:
@@ -46,11 +46,11 @@ final class UserControllerTest extends WebTestCase
|
||||
public function dataGenerateUserId()
|
||||
{
|
||||
self::bootKernel();
|
||||
$em = self::$container->get(EntityManagerInterface::class);
|
||||
$em = self::getContainer()->get(EntityManagerInterface::class);
|
||||
|
||||
$user = new User();
|
||||
$user->setUsername('Test_user '.uniqid());
|
||||
$user->setPassword(self::$container->get(UserPasswordEncoderInterface::class)->encodePassword(
|
||||
$user->setPassword(self::getContainer()->get(UserPasswordEncoderInterface::class)->encodePassword(
|
||||
$user,
|
||||
'password'
|
||||
));
|
||||
@@ -157,10 +157,10 @@ final class UserControllerTest extends WebTestCase
|
||||
protected function isPasswordValid($username, $password)
|
||||
{
|
||||
/** @var \Symfony\Component\Security\Core\Encoder\UserPasswordEncoder $passwordEncoder */
|
||||
$passwordEncoder = self::$container
|
||||
$passwordEncoder = self::getContainer()
|
||||
->get(UserPasswordEncoderInterface::class);
|
||||
|
||||
$user = self::$container->get(UserRepositoryInterface::class)
|
||||
$user = self::getContainer()->get(UserRepositoryInterface::class)
|
||||
->findOneBy(['username' => $username]);
|
||||
|
||||
$this->assertTrue($passwordEncoder->isPasswordValid($user, $password));
|
||||
|
Reference in New Issue
Block a user