Release 2.25 (#5109)

This commit is contained in:
Kevin Papst
2024-11-21 22:44:49 +01:00
committed by GitHub
parent 49eb7068c9
commit 0c26a2678e
261 changed files with 6431 additions and 7426 deletions

View File

@@ -13,6 +13,7 @@ use App\Command\DemoteUserCommand;
use App\Entity\User;
use App\Repository\UserRepository;
use App\User\UserService;
use Doctrine\Bundle\DoctrineBundle\Registry;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Exception\RuntimeException;
@@ -34,6 +35,7 @@ class DemoteUserCommandTest extends KernelTestCase
$this->application = new Application($kernel);
$container = self::$kernel->getContainer();
/** @var UserService $userService */
$userService = $container->get(UserService::class);
$this->application->add(new DemoteUserCommand($userService));
@@ -80,8 +82,10 @@ class DemoteUserCommandTest extends KernelTestCase
$this->assertStringContainsString('[OK] Role "ROLE_TEAMLEAD" has been removed from user "tony_teamlead".', $output);
$container = self::$kernel->getContainer();
/** @var Registry $doctrine */
$doctrine = $container->get('doctrine');
/** @var UserRepository $userRepository */
$userRepository = $container->get('doctrine')->getRepository(User::class);
$userRepository = $doctrine->getRepository(User::class);
$user = $userRepository->loadUserByIdentifier('tony_teamlead');
self::assertInstanceOf(User::class, $user);
self::assertFalse($user->hasTeamleadRole());
@@ -95,8 +99,10 @@ class DemoteUserCommandTest extends KernelTestCase
$this->assertStringContainsString('[OK] Super administrator role has been removed from the user "susan_super".', $output);
$container = self::$kernel->getContainer();
/** @var Registry $doctrine */
$doctrine = $container->get('doctrine');
/** @var UserRepository $userRepository */
$userRepository = $container->get('doctrine')->getRepository(User::class);
$userRepository = $doctrine->getRepository(User::class);
$user = $userRepository->loadUserByIdentifier('susan_super');
self::assertInstanceOf(User::class, $user);
self::assertFalse($user->isSuperAdmin());