Is there a way to use Foundry Model for Authentification inside Functional Tests?
PHP Snippet 1:
AdminFactory::new()
->create([
'email' => '[email protected]',
'active' => true,
'roles' => ['ROLE_SUPER_ADMIN'],
])
;
/** @var AdminRepository $adminRepository */
$adminRepository = static::getContainer()->get(AdminRepository::class);
$admin = $adminRepository->findOneBy(['email' => '[email protected]']);