Skip to content

A free open source IT asset/license management system

Fixed company unit test

snipe390e8a6cc3b3
diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php
index 6dd98b5b7d..5e4622109c 100644
--- a/database/factories/UserFactory.php
+++ b/database/factories/UserFactory.php
@@ -16,18 +16,17 @@ class UserFactory extends Factory
{
return [
'activated' => 1,
- 'address' => $this->faker->address,
- 'city' => $this->faker->city,
+ 'address' => $this->faker->address(),
+ 'city' => $this->faker->city(),
'company_id' => rand(1, 4),
- 'country' => $this->faker->country,
+ 'country' => $this->faker->country(),
'department_id' => rand(1, 6),
'email' => $this->faker->safeEmail,
'employee_num' => $this->faker->numberBetween(3500, 35050),
- 'first_name' => $this->faker->firstName,
- 'jobtitle' => $this->faker->jobTitle,
- 'last_name' => $this->faker->lastName,
- 'locale' => $this->faker->locale,
- 'location_id' => rand(1, 5),
+ 'first_name' => $this->faker->firstName(),
+ 'jobtitle' => $this->faker->jobTitle(),
+ 'last_name' => $this->faker->lastName(),
+ 'locale' => $this->faker->locale(),
'notes' => 'Created by DB seeder',
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'permissions' => '{"user":"0"}',
diff --git a/tests/Unit/CompanyTest.php b/tests/Unit/CompanyTest.php
index 1ff92e5d8f..c5c7600290 100644
--- a/tests/Unit/CompanyTest.php
+++ b/tests/Unit/CompanyTest.php
@@ -22,10 +22,10 @@ class CompanyTest extends BaseTest
public function testACompanyCanHaveUsers()
{
$company = Company::factory()->create();
- User::factory()
+ $user = User::factory()
->create(
[
- 'company_id'=>$company->id
+ 'company_id'=> $company->id
]
);