mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-20 10:57:40 +02:00
Fixed static analysis issue and added test for UserRepository
This commit is contained in:
parent
c981476706
commit
b3153dac68
5 changed files with 117 additions and 3 deletions
|
@ -54,6 +54,7 @@ class UserFixtures extends Fixture implements DependentFixtureInterface
|
|||
$user = new User();
|
||||
$user->setName('user');
|
||||
$user->setNeedPwChange(false);
|
||||
$user->setEmail('user@invalid.invalid');
|
||||
$user->setFirstName('Test')->setLastName('User');
|
||||
$user->setPassword($this->encoder->hashPassword($user, 'test'));
|
||||
$user->setGroup($this->getReference(GroupFixtures::USERS));
|
||||
|
@ -66,6 +67,9 @@ class UserFixtures extends Fixture implements DependentFixtureInterface
|
|||
$manager->persist($noread);
|
||||
|
||||
$manager->flush();
|
||||
|
||||
//Ensure that the anonymous user has the ID 0
|
||||
$manager->getRepository(User::class)->changeID($anonymous, User::ID_ANONYMOUS);
|
||||
}
|
||||
|
||||
public function getDependencies(): array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue