Added Google test user

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-05-10 09:13:34 -07:00
parent 7c77f4a697
commit d648e9a01c
2 changed files with 21 additions and 0 deletions

View file

@ -65,6 +65,20 @@ class UserFactory extends Factory
});
}
public function testAdmin()
{
return $this->state(function () {
return [
'first_name' => 'Alison',
'last_name' => 'Gianotto',
'username' => 'agianotto@grokability.com',
'avatar' => '2.jpg',
'email' => 'agianotto@grokability.com',
'permissions' => '{"superuser":"1"}',
];
});
}
public function superuser()
{
return $this->state(function () {

View file

@ -47,6 +47,13 @@ class UserSeeder extends Seeder
]))
->create();
User::factory()->count(1)->testAdmin()
->state(new Sequence(fn($sequence) => [
'company_id' => $companyIds->random(),
'department_id' => $departmentIds->random(),
]))
->create();
User::factory()->count(3)->superuser()
->state(new Sequence(fn($sequence) => [
'company_id' => $companyIds->random(),