mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-31 08:14:41 +02:00
Added tests for token API authentication
This commit is contained in:
parent
42356cc2a3
commit
c7a02ae870
4 changed files with 204 additions and 0 deletions
|
@ -31,6 +31,8 @@ use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
|||
|
||||
class UserFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
public const ADMIN = 'user-admin';
|
||||
|
||||
public function __construct(protected UserPasswordHasherInterface $encoder, protected EntityManagerInterface $em)
|
||||
{
|
||||
}
|
||||
|
@ -50,6 +52,7 @@ class UserFixtures extends Fixture implements DependentFixtureInterface
|
|||
$admin->setNeedPwChange(false);
|
||||
$admin->setGroup($this->getReference(GroupFixtures::ADMINS));
|
||||
$manager->persist($admin);
|
||||
$this->addReference(self::ADMIN, $admin);
|
||||
|
||||
$user = new User();
|
||||
$user->setName('user');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue