Fixed company unit test

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2021-12-02 16:43:03 -08:00
parent b0d2fc787a
commit 390e8a6cc3
2 changed files with 9 additions and 10 deletions

View file

@ -16,18 +16,17 @@ class UserFactory extends Factory
{ {
return [ return [
'activated' => 1, 'activated' => 1,
'address' => $this->faker->address, 'address' => $this->faker->address(),
'city' => $this->faker->city, 'city' => $this->faker->city(),
'company_id' => rand(1, 4), 'company_id' => rand(1, 4),
'country' => $this->faker->country, 'country' => $this->faker->country(),
'department_id' => rand(1, 6), 'department_id' => rand(1, 6),
'email' => $this->faker->safeEmail, 'email' => $this->faker->safeEmail,
'employee_num' => $this->faker->numberBetween(3500, 35050), 'employee_num' => $this->faker->numberBetween(3500, 35050),
'first_name' => $this->faker->firstName, 'first_name' => $this->faker->firstName(),
'jobtitle' => $this->faker->jobTitle, 'jobtitle' => $this->faker->jobTitle(),
'last_name' => $this->faker->lastName, 'last_name' => $this->faker->lastName(),
'locale' => $this->faker->locale, 'locale' => $this->faker->locale(),
'location_id' => rand(1, 5),
'notes' => 'Created by DB seeder', 'notes' => 'Created by DB seeder',
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'permissions' => '{"user":"0"}', 'permissions' => '{"user":"0"}',

View file

@ -22,7 +22,7 @@ class CompanyTest extends BaseTest
public function testACompanyCanHaveUsers() public function testACompanyCanHaveUsers()
{ {
$company = Company::factory()->create(); $company = Company::factory()->create();
User::factory() $user = User::factory()
->create( ->create(
[ [
'company_id'=> $company->id 'company_id'=> $company->id