diff --git a/tests/Feature/Importing/Api/ImportAccessoriesTest.php b/tests/Feature/Importing/Api/ImportAccessoriesTest.php index cf7597c314..27a80c0dd0 100644 --- a/tests/Feature/Importing/Api/ImportAccessoriesTest.php +++ b/tests/Feature/Importing/Api/ImportAccessoriesTest.php @@ -81,23 +81,23 @@ class ImportAccessoriesTest extends ImportDataTestCase ->where('item_id', $newAccessory->id) ->sole(); - $this->assertEquals($activityLog->action_type, 'create'); - $this->assertEquals($activityLog->action_source, 'importer'); - $this->assertEquals($activityLog->company_id, $newAccessory->company->id); + $this->assertEquals('create', $activityLog->action_type); + $this->assertEquals('importer', $activityLog->action_source); + $this->assertEquals($newAccessory->company->id, $activityLog->company_id); - $this->assertEquals($newAccessory->name, $row['itemName']); - $this->assertEquals($newAccessory->qty, $row['quantity']); - $this->assertEquals($newAccessory->purchase_date->toDateString(), $row['purchaseDate']); - $this->assertEquals($newAccessory->purchase_cost, $row['purchaseCost']); - $this->assertEquals($newAccessory->order_number, $row['orderNumber']); - $this->assertEquals($newAccessory->notes, $row['notes']); - $this->assertEquals($newAccessory->category->name, $row['category']); - $this->assertEquals($newAccessory->category->category_type, 'accessory'); - $this->assertEquals($newAccessory->manufacturer->name, $row['manufacturerName']); - $this->assertEquals($newAccessory->supplier->name, $row['supplierName']); - $this->assertEquals($newAccessory->location->name, $row['location']); - $this->assertEquals($newAccessory->company->name, $row['companyName']); - $this->assertEquals($newAccessory->model_number, $row['modelNumber']); + $this->assertEquals($row['itemName'], $newAccessory->name); + $this->assertEquals($row['quantity'], $newAccessory->qty); + $this->assertEquals($row['purchaseDate'], $newAccessory->purchase_date->toDateString()); + $this->assertEquals($row['purchaseCost'], $newAccessory->purchase_cost); + $this->assertEquals($row['orderNumber'], $newAccessory->order_number); + $this->assertEquals($row['notes'], $newAccessory->notes); + $this->assertEquals($row['category'], $newAccessory->category->name); + $this->assertEquals('accessory', $newAccessory->category->category_type); + $this->assertEquals($row['manufacturerName'], $newAccessory->manufacturer->name); + $this->assertEquals($row['supplierName'], $newAccessory->supplier->name); + $this->assertEquals($row['location'], $newAccessory->location->name); + $this->assertEquals($row['companyName'], $newAccessory->company->name); + $this->assertEquals($row['modelNumber'], $newAccessory->model_number); $this->assertFalse($newAccessory->requestable); $this->assertNull($newAccessory->min_amt); $this->assertNull($newAccessory->user_id); @@ -131,7 +131,7 @@ class ImportAccessoriesTest extends ImportDataTestCase ->where('name', $importFileBuilder->firstRow()['itemName']) ->sole(['purchase_date']); - $this->assertEquals($accessory->purchase_date->toDateString(), '2022-10-10'); + $this->assertEquals('2022-10-10', $accessory->purchase_date->toDateString()); } #[Test] @@ -165,7 +165,7 @@ class ImportAccessoriesTest extends ImportDataTestCase ->get(['name']); $this->assertCount(1, $probablyNewAccessories); - $this->assertEquals($probablyNewAccessories->first()->name, $accessory->name); + $this->assertEquals($accessory->name, $probablyNewAccessories->first()->name); } #[Test] @@ -292,23 +292,23 @@ class ImportAccessoriesTest extends ImportDataTestCase 'location_id', 'model_number', 'updated_at' ]; - $this->assertEquals($updatedAccessory->name, $row['itemName']); + $this->assertEquals($row['itemName'], $updatedAccessory->name); $this->assertEquals($row['companyName'], $updatedAccessory->company->name); - $this->assertEquals($updatedAccessory->qty, $row['quantity']); - $this->assertEquals($updatedAccessory->purchase_date->toDateString(), $row['purchaseDate']); - $this->assertEquals($updatedAccessory->purchase_cost, $row['purchaseCost']); - $this->assertEquals($updatedAccessory->order_number, $row['orderNumber']); - $this->assertEquals($updatedAccessory->notes, $row['notes']); - $this->assertEquals($updatedAccessory->category->name, $row['category']); - $this->assertEquals($updatedAccessory->category->category_type, 'accessory'); - $this->assertEquals($updatedAccessory->manufacturer->name, $row['manufacturerName']); - $this->assertEquals($updatedAccessory->supplier->name, $row['supplierName']); - $this->assertEquals($updatedAccessory->location->name, $row['location']); - $this->assertEquals($updatedAccessory->model_number, $row['modelNumber']); + $this->assertEquals($row['quantity'], $updatedAccessory->qty); + $this->assertEquals($row['purchaseDate'], $updatedAccessory->purchase_date->toDateString()); + $this->assertEquals($row['purchaseCost'], $updatedAccessory->purchase_cost); + $this->assertEquals($row['orderNumber'], $updatedAccessory->order_number); + $this->assertEquals($row['notes'], $updatedAccessory->notes); + $this->assertEquals($row['category'], $updatedAccessory->category->name); + $this->assertEquals('accessory', $updatedAccessory->category->category_type); + $this->assertEquals($row['manufacturerName'], $updatedAccessory->manufacturer->name); + $this->assertEquals($row['supplierName'], $updatedAccessory->supplier->name); + $this->assertEquals($row['location'], $updatedAccessory->location->name); + $this->assertEquals($row['modelNumber'], $updatedAccessory->model_number); $this->assertEquals( - Arr::except($updatedAccessory->attributesToArray(), $updatedAttributes), Arr::except($accessory->attributesToArray(), $updatedAttributes), + Arr::except($updatedAccessory->attributesToArray(), $updatedAttributes), ); } @@ -362,7 +362,7 @@ class ImportAccessoriesTest extends ImportDataTestCase $updatedAccessory = clone $accessory; $updatedAccessory->refresh(); - $this->assertEquals($updatedAccessory->toArray(), $accessory->toArray()); + $this->assertEquals($accessory->toArray(), $updatedAccessory->toArray()); } #[Test] @@ -412,15 +412,15 @@ class ImportAccessoriesTest extends ImportDataTestCase ->where('name', $row['modelNumber']) ->sole(); - $this->assertEquals($newAccessory->name, $row['modelNumber']); - $this->assertEquals($newAccessory->model_number, $row['itemName']); - $this->assertEquals($newAccessory->qty, $row['quantity']); - $this->assertEquals($newAccessory->purchase_date->toDateString(), $row['notes']); - $this->assertEquals($newAccessory->purchase_cost, $row['location']); - $this->assertEquals($newAccessory->order_number, $row['companyName']); - $this->assertEquals($newAccessory->notes, $row['purchaseDate']); - $this->assertEquals($newAccessory->category->name, $row['manufacturerName']); - $this->assertEquals($newAccessory->manufacturer->name, $row['category']); - $this->assertEquals($newAccessory->location->name, $row['purchaseCost']); + $this->assertEquals($row['modelNumber'], $newAccessory->name); + $this->assertEquals($row['itemName'], $newAccessory->model_number); + $this->assertEquals($row['quantity'], $newAccessory->qty); + $this->assertEquals($row['notes'], $newAccessory->purchase_date->toDateString()); + $this->assertEquals($row['location'], $newAccessory->purchase_cost); + $this->assertEquals($row['companyName'], $newAccessory->order_number); + $this->assertEquals($row['purchaseDate'], $newAccessory->notes); + $this->assertEquals($row['manufacturerName'], $newAccessory->category->name); + $this->assertEquals($row['category'], $newAccessory->manufacturer->name); + $this->assertEquals($row['purchaseCost'], $newAccessory->location->name); } } diff --git a/tests/Feature/Importing/Api/ImportAssetsTest.php b/tests/Feature/Importing/Api/ImportAssetsTest.php index b7c6298d32..d4b6ac52e7 100644 --- a/tests/Feature/Importing/Api/ImportAssetsTest.php +++ b/tests/Feature/Importing/Api/ImportAssetsTest.php @@ -89,60 +89,60 @@ class ImportAssetsTest extends ImportDataTestCase $this->assertCount(2, $activityLogs); - $this->assertEquals($activityLogs[0]->action_type, 'checkout'); - $this->assertEquals($activityLogs[0]->item_type, Asset::class); - $this->assertEquals($activityLogs[0]->target_id, $assignee->id); - $this->assertEquals($activityLogs[0]->target_type, User::class); - $this->assertEquals($activityLogs[0]->note, 'Checkout from CSV Importer'); + $this->assertEquals('checkout', $activityLogs[0]->action_type); + $this->assertEquals(Asset::class, $activityLogs[0]->item_type); + $this->assertEquals($assignee->id, $activityLogs[0]->target_id); + $this->assertEquals(User::class, $activityLogs[0]->target_type); + $this->assertEquals('Checkout from CSV Importer', $activityLogs[0]->note); - $this->assertEquals($activityLogs[1]->action_type, 'create'); + $this->assertEquals('create', $activityLogs[1]->action_type); $this->assertNull($activityLogs[1]->target_id); - $this->assertEquals($activityLogs[1]->item_type, Asset::class); + $this->assertEquals(Asset::class, $activityLogs[1]->item_type); $this->assertNull($activityLogs[1]->note); $this->assertNull($activityLogs[1]->target_type); - $this->assertEquals("{$assignee->first_name} {$assignee->last_name}", $row['assigneeFullName']); - $this->assertEquals($assignee->email, $row['assigneeEmail']); - $this->assertEquals($assignee->username, $row['assigneeUsername']); + $this->assertEquals($row['assigneeFullName'], "{$assignee->first_name} {$assignee->last_name}"); + $this->assertEquals($row['assigneeEmail'], $assignee->email); + $this->assertEquals($row['assigneeUsername'], $assignee->username); - $this->assertEquals($newAsset->model->category->name, $row['category']); - $this->assertEquals($newAsset->model->manufacturer->name, $row['manufacturerName']); - $this->assertEquals($newAsset->name, $row['itemName']); - $this->assertEquals($newAsset->asset_tag, $row['tag']); - $this->assertEquals($newAsset->model->name, $row['model']); - $this->assertEquals($newAsset->model->model_number, $row['modelNumber']); - $this->assertEquals($newAsset->purchase_date->toDateString(), $row['purchaseDate']); + $this->assertEquals($row['category'], $newAsset->model->category->name); + $this->assertEquals($row['manufacturerName'], $newAsset->model->manufacturer->name); + $this->assertEquals($row['itemName'], $newAsset->name); + $this->assertEquals($row['tag'], $newAsset->asset_tag); + $this->assertEquals($row['model'], $newAsset->model->name); + $this->assertEquals($row['modelNumber'], $newAsset->model->model_number); + $this->assertEquals($row['purchaseDate'], $newAsset->purchase_date->toDateString()); $this->assertNull($newAsset->asset_eol_date); $this->assertEquals(0, $newAsset->eol_explicit); $this->assertEquals($newAsset->location_id, $newAsset->rtd_location_id); - $this->assertEquals($newAsset->purchase_cost, $row['purchaseCost']); + $this->assertEquals($row['purchaseCost'], $newAsset->purchase_cost); $this->assertNull($newAsset->order_number); - $this->assertEquals($newAsset->image, ''); + $this->assertEquals('', $newAsset->image); $this->assertNull($newAsset->user_id); - $this->assertEquals($newAsset->physical, 1); - $this->assertEquals($newAsset->assetStatus->name, $row['status']); - $this->assertEquals($newAsset->archived, 0); - $this->assertEquals($newAsset->warranty_months, $row['warrantyInMonths']); + $this->assertEquals(1, $newAsset->physical); + $this->assertEquals($row['status'], $newAsset->assetStatus->name); + $this->assertEquals(0, $newAsset->archived); + $this->assertEquals($row['warrantyInMonths'], $newAsset->warranty_months); $this->assertNull($newAsset->deprecate); - $this->assertEquals($newAsset->supplier->name, $row['supplierName']); - $this->assertEquals($newAsset->requestable, 0); - $this->assertEquals($newAsset->defaultLoc->name, $row['location']); - $this->assertEquals($newAsset->accepted, null); - $this->assertEquals(Carbon::parse($newAsset->last_checkout)->toDateString(), now()->toDateString()); - $this->assertEquals($newAsset->last_checkin, 0); - $this->assertEquals($newAsset->expected_checkin, 0); - $this->assertEquals($newAsset->company->name, $row['companyName']); - $this->assertEquals($newAsset->assigned_type, User::class); + $this->assertEquals($row['supplierName'], $newAsset->supplier->name); + $this->assertEquals(0, $newAsset->requestable); + $this->assertEquals($row['location'], $newAsset->defaultLoc->name); + $this->assertEquals(null, $newAsset->accepted); + $this->assertEquals(now()->toDateString(), Carbon::parse($newAsset->last_checkout)->toDateString()); + $this->assertEquals(0, $newAsset->last_checkin); + $this->assertEquals(0, $newAsset->expected_checkin); + $this->assertEquals($row['companyName'], $newAsset->company->name); + $this->assertEquals(User::class, $newAsset->assigned_type); $this->assertNull($newAsset->last_audit_date); $this->assertNull($newAsset->next_audit_date); - $this->assertEquals($newAsset->location->name, $row['location']); - $this->assertEquals($newAsset->checkin_counter, 0); - $this->assertEquals($newAsset->checkout_counter, 1); - $this->assertEquals($newAsset->requests_counter, 0); - $this->assertEquals($newAsset->byod, 0); + $this->assertEquals($row['location'], $newAsset->location->name); + $this->assertEquals(0, $newAsset->checkin_counter); + $this->assertEquals(1, $newAsset->checkout_counter); + $this->assertEquals(0, $newAsset->requests_counter); + $this->assertEquals(0, $newAsset->byod); //Notes is never read. - //$this->assertEquals($asset->notes, $row['notes']); + // $this->assertEquals($row['notes'], $newAsset->notes); Notification::assertSentTo($assignee, CheckoutAssetNotification::class); } @@ -309,7 +309,7 @@ class ImportAssetsTest extends ImportDataTestCase ->where('serial', $importFileBuilder->firstRow()['serialNumber']) ->sole(); - $this->assertEquals($newAsset->assetStatus->name, 'Ready to Deploy'); + $this->assertEquals('Ready to Deploy', $newAsset->assetStatus->name); $this->assertNull($newAsset->purchase_date); $this->assertNull($newAsset->purchase_cost); } @@ -331,8 +331,8 @@ class ImportAssetsTest extends ImportDataTestCase ->where('serial', $importFileBuilder->firstRow()['serialNumber']) ->sole(); - $this->assertEquals($newAsset->warranty_months, 3); - $this->assertEquals($newAsset->purchase_date->toDateString(), '2022-10-10'); + $this->assertEquals(3, $newAsset->warranty_months); + $this->assertEquals('2022-10-10', $newAsset->purchase_date->toDateString()); } #[Test] @@ -406,33 +406,33 @@ class ImportAssetsTest extends ImportDataTestCase 'last_checkout', 'requestable', 'updated_at', 'checkout_counter', 'assigned_type' ]; - $this->assertEquals("{$assignee->first_name} {$assignee->last_name}", $row['assigneeFullName']); - $this->assertEquals($assignee->email, $row['assigneeEmail']); - $this->assertEquals($assignee->username, $row['assigneeUsername']); + $this->assertEquals($row['assigneeFullName'], "{$assignee->first_name} {$assignee->last_name}"); + $this->assertEquals($row['assigneeEmail'], $assignee->email); + $this->assertEquals($row['assigneeUsername'], $assignee->username); - $this->assertEquals($updatedAsset->model->category->name, $row['category']); - $this->assertEquals($updatedAsset->model->manufacturer->name, $row['manufacturerName']); - $this->assertEquals($updatedAsset->name, $row['itemName']); - $this->assertEquals($updatedAsset->asset_tag, $row['tag']); - $this->assertEquals($updatedAsset->model->name, $row['model']); - $this->assertEquals($updatedAsset->model->model_number, $row['modelNumber']); - $this->assertEquals($updatedAsset->purchase_date->toDateString(), $row['purchaseDate']); - $this->assertEquals($updatedAsset->purchase_cost, $row['purchaseCost']); - $this->assertEquals($updatedAsset->assetStatus->name, $row['status']); - $this->assertEquals($updatedAsset->warranty_months, $row['warrantyInMonths']); - $this->assertEquals($updatedAsset->supplier->name, $row['supplierName']); - $this->assertEquals($updatedAsset->defaultLoc->name, $row['location']); - $this->assertEquals($updatedAsset->company->name, $row['companyName']); - $this->assertEquals($updatedAsset->location->name, $row['location']); - $this->assertEquals($updatedAsset->checkout_counter, 1); - $this->assertEquals($updatedAsset->assigned_type, user::class); + $this->assertEquals($row['category'], $updatedAsset->model->category->name); + $this->assertEquals($row['manufacturerName'], $updatedAsset->model->manufacturer->name); + $this->assertEquals($row['itemName'], $updatedAsset->name); + $this->assertEquals($row['tag'], $updatedAsset->asset_tag); + $this->assertEquals($row['model'], $updatedAsset->model->name); + $this->assertEquals($row['modelNumber'], $updatedAsset->model->model_number); + $this->assertEquals($row['purchaseDate'], $updatedAsset->purchase_date->toDateString()); + $this->assertEquals($row['purchaseCost'], $updatedAsset->purchase_cost); + $this->assertEquals($row['status'], $updatedAsset->assetStatus->name); + $this->assertEquals($row['warrantyInMonths'], $updatedAsset->warranty_months); + $this->assertEquals($row['supplierName'], $updatedAsset->supplier->name); + $this->assertEquals($row['location'], $updatedAsset->defaultLoc->name); + $this->assertEquals($row['companyName'], $updatedAsset->company->name); + $this->assertEquals($row['location'], $updatedAsset->location->name); + $this->assertEquals(1, $updatedAsset->checkout_counter); + $this->assertEquals(user::class, $updatedAsset->assigned_type); //RequestAble is always updated regardless of initial value. - //$this->assertEquals($updatedAsset->requestable, $asset->requestable); + // $this->assertEquals($asset->requestable, $updatedAsset->requestable); $this->assertEquals( - Arr::except($updatedAsset->attributesToArray(), $updatedAttributes), Arr::except($asset->attributesToArray(), $updatedAttributes), + Arr::except($updatedAsset->attributesToArray(), $updatedAttributes), ); } @@ -497,45 +497,45 @@ class ImportAssetsTest extends ImportDataTestCase $assignee = User::query()->find($asset->assigned_to, ['id', 'first_name', 'last_name', 'email', 'username']); - $this->assertEquals("{$assignee->first_name} {$assignee->last_name}", $row['warrantyInMonths']); - $this->assertEquals($assignee->email, $row['tag']); - $this->assertEquals($assignee->username, $row['location']); + $this->assertEquals($row['warrantyInMonths'], "{$assignee->first_name} {$assignee->last_name}"); + $this->assertEquals($row['tag'], $assignee->email); + $this->assertEquals($row['location'], $assignee->username); - $this->assertEquals($asset->model->category->name, $row['modelNumber']); - $this->assertEquals($asset->model->manufacturer->name, $row['assigneeEmail']); - $this->assertEquals($asset->name, $row['model']); - $this->assertEquals($asset->asset_tag, $row['serialNumber']); - $this->assertEquals($asset->model->name, $row['purchaseCost']); - $this->assertEquals($asset->model->model_number, $row['itemName']); - $this->assertEquals($asset->purchase_date->toDateString(), $row['supplierName']); - $this->assertEquals($asset->purchase_cost, $row['companyName']); - $this->assertEquals($asset->assetStatus->name, $row['manufacturerName']); - $this->assertEquals($asset->warranty_months, $row['status']); - $this->assertEquals($asset->supplier->name, $row['assigneeFullName']); - $this->assertEquals($asset->defaultLoc->name, $row['category']); - $this->assertEquals($asset->company->name, $row['purchaseDate']); - $this->assertEquals($asset->location->name, $row['category']); - $this->assertEquals($asset->notes, $row['notes']); + $this->assertEquals($row['modelNumber'], $asset->model->category->name); + $this->assertEquals($row['assigneeEmail'], $asset->model->manufacturer->name); + $this->assertEquals($row['model'], $asset->name); + $this->assertEquals($row['serialNumber'], $asset->asset_tag); + $this->assertEquals($row['purchaseCost'], $asset->model->name); + $this->assertEquals($row['itemName'], $asset->model->model_number); + $this->assertEquals($row['supplierName'], $asset->purchase_date->toDateString()); + $this->assertEquals($row['companyName'], $asset->purchase_cost); + $this->assertEquals($row['manufacturerName'], $asset->assetStatus->name); + $this->assertEquals($row['status'], $asset->warranty_months); + $this->assertEquals($row['assigneeFullName'], $asset->supplier->name); + $this->assertEquals($row['category'], $asset->defaultLoc->name); + $this->assertEquals($row['purchaseDate'], $asset->company->name); + $this->assertEquals($row['category'], $asset->location->name); + $this->assertEquals($row['notes'], $asset->notes); $this->assertNull($asset->asset_eol_date); $this->assertEquals(0, $asset->eol_explicit); $this->assertNull($asset->order_number); - $this->assertEquals($asset->image, ''); + $this->assertEquals('', $asset->image); $this->assertNull($asset->user_id); - $this->assertEquals($asset->physical, 1); - $this->assertEquals($asset->archived, 0); + $this->assertEquals(1, $asset->physical); + $this->assertEquals(0, $asset->archived); $this->assertNull($asset->deprecate); - $this->assertEquals($asset->requestable, 0); - $this->assertEquals($asset->accepted, null); - $this->assertEquals(Carbon::parse($asset->last_checkout)->toDateString(), now()->toDateString()); - $this->assertEquals($asset->last_checkin, 0); - $this->assertEquals($asset->expected_checkin, 0); - $this->assertEquals($asset->assigned_type, User::class); + $this->assertEquals(0, $asset->requestable); + $this->assertEquals(null, $asset->accepted); + $this->assertEquals(now()->toDateString(), Carbon::parse($asset->last_checkout)->toDateString()); + $this->assertEquals(0, $asset->last_checkin); + $this->assertEquals(0, $asset->expected_checkin); + $this->assertEquals(User::class, $asset->assigned_type); $this->assertNull($asset->last_audit_date); $this->assertNull($asset->next_audit_date); - $this->assertEquals($asset->checkin_counter, 0); - $this->assertEquals($asset->checkout_counter, 1); - $this->assertEquals($asset->requests_counter, 0); - $this->assertEquals($asset->byod, 0); + $this->assertEquals(0, $asset->checkin_counter); + $this->assertEquals(1, $asset->checkout_counter); + $this->assertEquals(0, $asset->requests_counter); + $this->assertEquals(0, $asset->byod); } #[Test] @@ -565,7 +565,7 @@ class ImportAssetsTest extends ImportDataTestCase $newAsset = Asset::query()->where('serial', $importFileBuilder->firstRow()['serialNumber'])->sole(); - $this->assertEquals($newAsset->getAttribute($customField->db_column), $macAddress); + $this->assertEquals($macAddress, $newAsset->getAttribute($customField->db_column)); } #[Test] diff --git a/tests/Feature/Importing/Api/ImportComponentsTest.php b/tests/Feature/Importing/Api/ImportComponentsTest.php index 56c40ba462..1a68fbf1c2 100644 --- a/tests/Feature/Importing/Api/ImportComponentsTest.php +++ b/tests/Feature/Importing/Api/ImportComponentsTest.php @@ -79,21 +79,21 @@ class ImportComponentsTest extends ImportDataTestCase ->where('item_id', $newComponent->id) ->sole(); - $this->assertEquals($activityLog->action_type, 'create'); - $this->assertEquals($activityLog->action_source, 'importer'); - $this->assertEquals($activityLog->company_id, $newComponent->company->id); + $this->assertEquals('create', $activityLog->action_type); + $this->assertEquals('importer', $activityLog->action_source); + $this->assertEquals($newComponent->company->id, $activityLog->company_id); - $this->assertEquals($newComponent->name, $row['itemName']); - $this->assertEquals($newComponent->company->name, $row['companyName']); - $this->assertEquals($newComponent->category->name, $row['category']); - $this->assertEquals($newComponent->location->name, $row['location']); + $this->assertEquals($row['itemName'], $newComponent->name); + $this->assertEquals($row['companyName'], $newComponent->company->name); + $this->assertEquals($row['category'], $newComponent->category->name); + $this->assertEquals($row['location'], $newComponent->location->name); $this->assertNull($newComponent->supplier_id); - $this->assertEquals($newComponent->qty, $row['quantity']); - $this->assertEquals($newComponent->order_number, $row['orderNumber']); - $this->assertEquals($newComponent->purchase_date->toDateString(), $row['purchaseDate']); - $this->assertEquals($newComponent->purchase_cost, $row['purchaseCost']); + $this->assertEquals($row['quantity'], $newComponent->qty); + $this->assertEquals($row['orderNumber'], $newComponent->order_number); + $this->assertEquals($row['purchaseDate'], $newComponent->purchase_date->toDateString()); + $this->assertEquals($row['purchaseCost'], $newComponent->purchase_cost); $this->assertNull($newComponent->min_amt); - $this->assertEquals($newComponent->serial, $row['serialNumber']); + $this->assertEquals($row['serialNumber'], $newComponent->serial); $this->assertNull($newComponent->image); $this->assertNull($newComponent->notes); } @@ -239,18 +239,18 @@ class ImportComponentsTest extends ImportDataTestCase ->where('serial', $row['serialNumber']) ->sole(); - $this->assertEquals($updatedComponent->name, $row['itemName']); - $this->assertEquals($updatedComponent->category->name, $row['category']); - $this->assertEquals($updatedComponent->location->name, $row['location']); - $this->assertEquals($updatedComponent->supplier_id, $component->supplier_id); - $this->assertEquals($updatedComponent->qty, $row['quantity']); - $this->assertEquals($updatedComponent->order_number, $row['orderNumber']); - $this->assertEquals($updatedComponent->purchase_date->toDateString(), $row['purchaseDate']); - $this->assertEquals($updatedComponent->purchase_cost, $row['purchaseCost']); - $this->assertEquals($updatedComponent->min_amt, $component->min_amt); - $this->assertEquals($updatedComponent->serial, $row['serialNumber']); - $this->assertEquals($updatedComponent->image, $component->image); - $this->assertEquals($updatedComponent->notes, $component->notes); + $this->assertEquals($row['itemName'], $updatedComponent->name); + $this->assertEquals($row['category'], $updatedComponent->category->name); + $this->assertEquals($row['location'], $updatedComponent->location->name); + $this->assertEquals($component->supplier_id, $updatedComponent->supplier_id); + $this->assertEquals($row['quantity'], $updatedComponent->qty); + $this->assertEquals($row['orderNumber'], $updatedComponent->order_number); + $this->assertEquals($row['purchaseDate'], $updatedComponent->purchase_date->toDateString()); + $this->assertEquals($row['purchaseCost'], $updatedComponent->purchase_cost); + $this->assertEquals($component->min_amt, $updatedComponent->min_amt); + $this->assertEquals($row['serialNumber'], $updatedComponent->serial); + $this->assertEquals($component->image, $updatedComponent->image); + $this->assertEquals($component->notes, $updatedComponent->notes); } #[Test] @@ -294,14 +294,14 @@ class ImportComponentsTest extends ImportDataTestCase ->where('serial', $importFileBuilder->firstRow()['category']) ->sole(); - $this->assertEquals($newComponent->name, $row['quantity']); - $this->assertEquals($newComponent->category->name, $row['purchaseCost']); - $this->assertEquals($newComponent->location->name, $row['serialNumber']); + $this->assertEquals($row['quantity'], $newComponent->name); + $this->assertEquals($row['purchaseCost'], $newComponent->category->name); + $this->assertEquals($row['serialNumber'], $newComponent->location->name); $this->assertNull($newComponent->supplier_id); - $this->assertEquals($newComponent->qty, $row['companyName']); - $this->assertEquals($newComponent->order_number, $row['orderNumber']); - $this->assertEquals($newComponent->purchase_date->toDateString(), $row['itemName']); - $this->assertEquals($newComponent->purchase_cost, $row['location']); + $this->assertEquals($row['companyName'], $newComponent->qty); + $this->assertEquals($row['orderNumber'], $newComponent->order_number); + $this->assertEquals($row['itemName'], $newComponent->purchase_date->toDateString()); + $this->assertEquals($row['location'], $newComponent->purchase_cost); $this->assertNull($newComponent->min_amt); $this->assertNull($newComponent->image); $this->assertNull($newComponent->notes); diff --git a/tests/Feature/Importing/Api/ImportConsumablesTest.php b/tests/Feature/Importing/Api/ImportConsumablesTest.php index 7591ee9711..3962dea5d4 100644 --- a/tests/Feature/Importing/Api/ImportConsumablesTest.php +++ b/tests/Feature/Importing/Api/ImportConsumablesTest.php @@ -79,22 +79,22 @@ class ImportConsumablesTest extends ImportDataTestCase ->where('item_id', $newConsumable->id) ->sole(); - $this->assertEquals($activityLog->action_type, 'create'); - $this->assertEquals($activityLog->action_source, 'importer'); - $this->assertEquals($activityLog->company_id, $newConsumable->company->id); + $this->assertEquals('create', $activityLog->action_type); + $this->assertEquals('importer', $activityLog->action_source); + $this->assertEquals($newConsumable->company->id, $activityLog->company_id); - $this->assertEquals($newConsumable->name, $row['itemName']); - $this->assertEquals($newConsumable->category->name, $row['category']); - $this->assertEquals($newConsumable->location->name, $row['location']); - $this->assertEquals($newConsumable->company->name, $row['companyName']); + $this->assertEquals($row['itemName'], $newConsumable->name); + $this->assertEquals($row['category'], $newConsumable->category->name); + $this->assertEquals($row['location'], $newConsumable->location->name); + $this->assertEquals($row['companyName'], $newConsumable->company->name); $this->assertNull($newConsumable->supplier_id); $this->assertFalse($newConsumable->requestable); $this->assertNull($newConsumable->image); - $this->assertEquals($newConsumable->order_number, $row['orderNumber']); - $this->assertEquals($newConsumable->purchase_date->toDateString(), $row['purchaseDate']); - $this->assertEquals($newConsumable->purchase_cost, $row['purchaseCost']); + $this->assertEquals($row['orderNumber'], $newConsumable->order_number); + $this->assertEquals($row['purchaseDate'], $newConsumable->purchase_date->toDateString()); + $this->assertEquals($row['purchaseCost'], $newConsumable->purchase_cost); $this->assertNull($newConsumable->min_amt); - $this->assertEquals($newConsumable->model_number, ''); + $this->assertEquals('', $newConsumable->model_number); $this->assertNull($newConsumable->item_number); $this->assertNull($newConsumable->manufacturer_id); $this->assertNull($newConsumable->notes); @@ -229,13 +229,13 @@ class ImportConsumablesTest extends ImportDataTestCase ->where('name', $importFileBuilder->firstRow()['itemName']) ->sole(); - $this->assertEquals($updatedConsumable->name, $row['itemName']); - $this->assertEquals($updatedConsumable->category->name, $row['category']); - $this->assertEquals($updatedConsumable->location->name, $row['location']); - $this->assertEquals($updatedConsumable->company->name, $row['companyName']); - $this->assertEquals($updatedConsumable->order_number, $row['orderNumber']); - $this->assertEquals($updatedConsumable->purchase_date->toDateString(), $row['purchaseDate']); - $this->assertEquals($updatedConsumable->purchase_cost, $row['purchaseCost']); + $this->assertEquals($row['itemName'], $updatedConsumable->name); + $this->assertEquals($row['category'], $updatedConsumable->category->name); + $this->assertEquals($row['location'], $updatedConsumable->location->name); + $this->assertEquals($row['companyName'], $updatedConsumable->company->name); + $this->assertEquals($row['orderNumber'], $updatedConsumable->order_number); + $this->assertEquals($row['purchaseDate'], $updatedConsumable->purchase_date->toDateString()); + $this->assertEquals($row['purchaseCost'], $updatedConsumable->purchase_cost); $this->assertEquals($consumable->supplier_id, $updatedConsumable->supplier_id); $this->assertEquals($consumable->requestable, $updatedConsumable->requestable); @@ -289,19 +289,19 @@ class ImportConsumablesTest extends ImportDataTestCase ->where('name', $importFileBuilder->firstRow()['quantity']) ->sole(); - $this->assertEquals($newConsumable->category->name, $row['supplier']); - $this->assertEquals($newConsumable->location->name, $row['purchaseCost']); - $this->assertEquals($newConsumable->company->name, $row['purchaseDate']); - $this->assertEquals($newConsumable->qty, $row['companyName']); - $this->assertEquals($newConsumable->name, $row['quantity']); + $this->assertEquals($row['supplier'], $newConsumable->category->name); + $this->assertEquals($row['purchaseCost'], $newConsumable->location->name); + $this->assertEquals($row['purchaseDate'], $newConsumable->company->name); + $this->assertEquals($row['companyName'], $newConsumable->qty); + $this->assertEquals($row['quantity'], $newConsumable->name); $this->assertNull($newConsumable->supplier_id); $this->assertFalse($newConsumable->requestable); $this->assertNull($newConsumable->image); - $this->assertEquals($newConsumable->order_number, $row['orderNumber']); - $this->assertEquals($newConsumable->purchase_date->toDateString(), $row['itemName']); - $this->assertEquals($newConsumable->purchase_cost, $row['location']); + $this->assertEquals($row['orderNumber'], $newConsumable->order_number); + $this->assertEquals($row['itemName'], $newConsumable->purchase_date->toDateString()); + $this->assertEquals($row['location'], $newConsumable->purchase_cost); $this->assertNull($newConsumable->min_amt); - $this->assertEquals($newConsumable->model_number, ''); + $this->assertEquals('', $newConsumable->model_number); $this->assertNull($newConsumable->item_number); $this->assertNull($newConsumable->manufacturer_id); $this->assertNull($newConsumable->notes); diff --git a/tests/Feature/Importing/Api/ImportLicenseTest.php b/tests/Feature/Importing/Api/ImportLicenseTest.php index a5147d55ae..11865236f3 100644 --- a/tests/Feature/Importing/Api/ImportLicenseTest.php +++ b/tests/Feature/Importing/Api/ImportLicenseTest.php @@ -79,22 +79,22 @@ class ImportLicenseTest extends ImportDataTestCase $this->assertCount(2, $activityLogs); - $this->assertEquals($newLicense->name, $row['licenseName']); - $this->assertEquals($newLicense->serial, $row['serialNumber']); - $this->assertEquals($newLicense->purchase_date->toDateString(), $row['purchaseDate']); - $this->assertEquals($newLicense->purchase_cost, $row['purchaseCost']); - $this->assertEquals($newLicense->order_number, $row['orderNumber']); - $this->assertEquals($newLicense->seats, $row['seats']); - $this->assertEquals($newLicense->notes, $row['notes']); - $this->assertEquals($newLicense->license_name, $row['licensedToName']); - $this->assertEquals($newLicense->license_email, $row['licensedToEmail']); - $this->assertEquals($newLicense->supplier->name, $row['supplierName']); - $this->assertEquals($newLicense->company->name, $row['companyName']); - $this->assertEquals($newLicense->category->name, $row['category']); - $this->assertEquals($newLicense->expiration_date->toDateString(), $row['expirationDate']); - $this->assertEquals($newLicense->maintained, $row['isMaintained'] === 'TRUE'); - $this->assertEquals($newLicense->reassignable, $row['isReassignAble'] === 'TRUE'); - $this->assertEquals($newLicense->purchase_order, ''); + $this->assertEquals($row['licenseName'], $newLicense->name); + $this->assertEquals($row['serialNumber'], $newLicense->serial); + $this->assertEquals($row['purchaseDate'], $newLicense->purchase_date->toDateString()); + $this->assertEquals($row['purchaseCost'], $newLicense->purchase_cost); + $this->assertEquals($row['orderNumber'], $newLicense->order_number); + $this->assertEquals($row['seats'], $newLicense->seats); + $this->assertEquals($row['notes'], $newLicense->notes); + $this->assertEquals($row['licensedToName'], $newLicense->license_name); + $this->assertEquals($row['licensedToEmail'], $newLicense->license_email); + $this->assertEquals($row['supplierName'], $newLicense->supplier->name); + $this->assertEquals($row['companyName'], $newLicense->company->name); + $this->assertEquals($row['category'], $newLicense->category->name); + $this->assertEquals($row['expirationDate'], $newLicense->expiration_date->toDateString()); + $this->assertEquals($row['isMaintained'] === 'TRUE', $newLicense->maintained); + $this->assertEquals($row['isReassignAble'] === 'TRUE', $newLicense->reassignable); + $this->assertEquals('', $newLicense->purchase_order); $this->assertNull($newLicense->depreciation_id); $this->assertNull($newLicense->termination_date); $this->assertNull($newLicense->deprecate); @@ -155,7 +155,7 @@ class ImportLicenseTest extends ImportDataTestCase ->where('serial', $importFileBuilder->firstRow()['serialNumber']) ->sole(); - $this->assertEquals($newLicense->expiration_date->toDateString(), '2022-10-10'); + $this->assertEquals('2022-10-10', $newLicense->expiration_date->toDateString()); } #[Test] @@ -259,26 +259,26 @@ class ImportLicenseTest extends ImportDataTestCase ->where('serial', $row['serialNumber']) ->sole(); - $this->assertEquals($updatedLicense->name, $row['licenseName']); - $this->assertEquals($updatedLicense->serial, $row['serialNumber']); - $this->assertEquals($updatedLicense->purchase_date->toDateString(), $row['purchaseDate']); - $this->assertEquals($updatedLicense->purchase_cost, $row['purchaseCost']); - $this->assertEquals($updatedLicense->order_number, $row['orderNumber']); - $this->assertEquals($updatedLicense->seats, $row['seats']); - $this->assertEquals($updatedLicense->notes, $row['notes']); - $this->assertEquals($updatedLicense->license_name, $row['licensedToName']); - $this->assertEquals($updatedLicense->license_email, $row['licensedToEmail']); - $this->assertEquals($updatedLicense->supplier->name, $row['supplierName']); - $this->assertEquals($updatedLicense->company->name, $row['companyName']); - $this->assertEquals($updatedLicense->category->name, $row['category']); - $this->assertEquals($updatedLicense->expiration_date->toDateString(), $row['expirationDate']); - $this->assertEquals($updatedLicense->maintained, $row['isMaintained'] === 'TRUE'); - $this->assertEquals($updatedLicense->reassignable, $row['isReassignAble'] === 'TRUE'); - $this->assertEquals($updatedLicense->purchase_order, $license->purchase_order); - $this->assertEquals($updatedLicense->depreciation_id, $license->depreciation_id); - $this->assertEquals($updatedLicense->termination_date, $license->termination_date); - $this->assertEquals($updatedLicense->deprecate, $license->deprecate); - $this->assertEquals($updatedLicense->min_amt, $license->min_amt); + $this->assertEquals($row['licenseName'], $updatedLicense->name); + $this->assertEquals($row['serialNumber'], $updatedLicense->serial); + $this->assertEquals($row['purchaseDate'], $updatedLicense->purchase_date->toDateString()); + $this->assertEquals($row['purchaseCost'], $updatedLicense->purchase_cost); + $this->assertEquals($row['orderNumber'], $updatedLicense->order_number); + $this->assertEquals($row['seats'], $updatedLicense->seats); + $this->assertEquals($row['notes'], $updatedLicense->notes); + $this->assertEquals($row['licensedToName'], $updatedLicense->license_name); + $this->assertEquals($row['licensedToEmail'], $updatedLicense->license_email); + $this->assertEquals($row['supplierName'], $updatedLicense->supplier->name); + $this->assertEquals($row['companyName'], $updatedLicense->company->name); + $this->assertEquals($row['category'], $updatedLicense->category->name); + $this->assertEquals($row['expirationDate'], $updatedLicense->expiration_date->toDateString()); + $this->assertEquals($row['isMaintained'] === 'TRUE', $updatedLicense->maintained); + $this->assertEquals($row['isReassignAble'] === 'TRUE', $updatedLicense->reassignable); + $this->assertEquals($license->purchase_order, $updatedLicense->purchase_order); + $this->assertEquals($license->depreciation_id, $updatedLicense->depreciation_id); + $this->assertEquals($license->termination_date, $updatedLicense->termination_date); + $this->assertEquals($license->deprecate, $updatedLicense->deprecate); + $this->assertEquals($license->min_amt, $updatedLicense->min_amt); } #[Test] @@ -336,22 +336,22 @@ class ImportLicenseTest extends ImportDataTestCase ->where('serial', $row['companyName']) ->sole(); - $this->assertEquals($newLicense->name, $row['licenseName']); - $this->assertEquals($newLicense->serial, $row['companyName']); - $this->assertEquals($newLicense->purchase_date->toDateString(), $row['isMaintained']); - $this->assertEquals($newLicense->purchase_cost, $row['isReassignAble']); - $this->assertEquals($newLicense->order_number, $row['licensedToName']); - $this->assertEquals($newLicense->seats, $row['expirationDate']); - $this->assertEquals($newLicense->notes, $row['licensedToEmail']); - $this->assertEquals($newLicense->license_name, $row['seats']); - $this->assertEquals($newLicense->license_email, $row['serialNumber']); - $this->assertEquals($newLicense->supplier->name, $row['category']); - $this->assertEquals($newLicense->company->name, $row['notes']); - $this->assertEquals($newLicense->category->name, $row['manufacturerName']); - $this->assertEquals($newLicense->expiration_date->toDateString(), $row['orderNumber']); - $this->assertEquals($newLicense->maintained, $row['purchaseCost'] === 'TRUE'); - $this->assertEquals($newLicense->reassignable, $row['purchaseDate'] === 'TRUE'); - $this->assertEquals($newLicense->purchase_order, ''); + $this->assertEquals($row['licenseName'], $newLicense->name); + $this->assertEquals($row['companyName'], $newLicense->serial); + $this->assertEquals($row['isMaintained'], $newLicense->purchase_date->toDateString()); + $this->assertEquals($row['isReassignAble'], $newLicense->purchase_cost); + $this->assertEquals($row['licensedToName'], $newLicense->order_number); + $this->assertEquals($row['expirationDate'], $newLicense->seats); + $this->assertEquals($row['licensedToEmail'], $newLicense->notes); + $this->assertEquals($row['seats'], $newLicense->license_name); + $this->assertEquals($row['serialNumber'], $newLicense->license_email); + $this->assertEquals($row['category'], $newLicense->supplier->name); + $this->assertEquals($row['notes'], $newLicense->company->name); + $this->assertEquals($row['manufacturerName'], $newLicense->category->name); + $this->assertEquals($row['orderNumber'], $newLicense->expiration_date->toDateString()); + $this->assertEquals($row['purchaseCost'] === 'TRUE', $newLicense->maintained); + $this->assertEquals($row['purchaseDate'] === 'TRUE', $newLicense->reassignable); + $this->assertEquals('', $newLicense->purchase_order); $this->assertNull($newLicense->depreciation_id); $this->assertNull($newLicense->termination_date); $this->assertNull($newLicense->deprecate); diff --git a/tests/Feature/Importing/Api/ImportUsersTest.php b/tests/Feature/Importing/Api/ImportUsersTest.php index 4415da3f12..6ac0070a19 100644 --- a/tests/Feature/Importing/Api/ImportUsersTest.php +++ b/tests/Feature/Importing/Api/ImportUsersTest.php @@ -78,21 +78,21 @@ class ImportUsersTest extends ImportDataTestCase Notification::assertNothingSent(); - $this->assertEquals($newUser->email, $row['email']); - $this->assertEquals($newUser->first_name, $row['firstName']); - $this->assertEquals($newUser->last_name, $row['lastName']); - $this->assertEquals($newUser->employee_num, $row['employeeNumber']); - $this->assertEquals($newUser->company->name, $row['companyName']); - $this->assertEquals($newUser->location->name, $row['location']); - $this->assertEquals($newUser->phone, $row['phoneNumber']); - $this->assertEquals($newUser->jobtitle, $row['position']); + $this->assertEquals($row['email'], $newUser->email); + $this->assertEquals($row['firstName'], $newUser->first_name); + $this->assertEquals($row['lastName'], $newUser->last_name); + $this->assertEquals($row['employeeNumber'], $newUser->employee_num); + $this->assertEquals($row['companyName'], $newUser->company->name); + $this->assertEquals($row['location'], $newUser->location->name); + $this->assertEquals($row['phoneNumber'], $newUser->phone); + $this->assertEquals($row['position'], $newUser->jobtitle); $this->assertTrue(Hash::isHashed($newUser->password)); - $this->assertEquals($newUser->website, ''); - $this->assertEquals($newUser->country, ''); - $this->assertEquals($newUser->address, ''); - $this->assertEquals($newUser->city, ''); - $this->assertEquals($newUser->state, ''); - $this->assertEquals($newUser->zip, ''); + $this->assertEquals('', $newUser->website); + $this->assertEquals('', $newUser->country); + $this->assertEquals('', $newUser->address); + $this->assertEquals('', $newUser->city); + $this->assertEquals('', $newUser->state); + $this->assertEquals('', $newUser->zip); $this->assertNull($newUser->permissions); $this->assertNull($newUser->avatar); $this->assertNull($newUser->notes); @@ -100,15 +100,15 @@ class ImportUsersTest extends ImportDataTestCase $this->assertNull($newUser->department_id); $this->assertNull($newUser->two_factor_secret); $this->assertNull($newUser->idap_import); - $this->assertEquals($newUser->locale, 'en-US'); - $this->assertEquals($newUser->show_in_list, 1); - $this->assertEquals($newUser->two_factor_enrolled, 0); - $this->assertEquals($newUser->two_factor_optin, 0); - $this->assertEquals($newUser->remote, 0); - $this->assertEquals($newUser->autoassign_licenses, 0); - $this->assertEquals($newUser->vip, 0); - $this->assertEquals($newUser->enable_sounds, 0); - $this->assertEquals($newUser->enable_confetti, 0); + $this->assertEquals('en-US', $newUser->locale); + $this->assertEquals(1, $newUser->show_in_list); + $this->assertEquals(0, $newUser->two_factor_enrolled); + $this->assertEquals(0, $newUser->two_factor_optin); + $this->assertEquals(0, $newUser->remote); + $this->assertEquals(0, $newUser->autoassign_licenses); + $this->assertEquals(0, $newUser->vip); + $this->assertEquals(0, $newUser->enable_sounds); + $this->assertEquals(0, $newUser->enable_confetti); $this->assertNull($newUser->created_by); $this->assertNull($newUser->start_date); $this->assertNull($newUser->end_date); @@ -118,7 +118,7 @@ class ImportUsersTest extends ImportDataTestCase $this->assertNull($newUser->last_login); $this->assertNull($newUser->persist_code); $this->assertNull($newUser->reset_password_code); - $this->assertEquals($newUser->activated, 0); + $this->assertEquals(0, $newUser->activated); } #[Test] @@ -169,7 +169,7 @@ class ImportUsersTest extends ImportDataTestCase $generatedUsername = User::generateFormattedNameFromFullName("{$row['firstName']} {$row['lastName']}")['username']; - $this->assertEquals($newUser->username, $generatedUsername); + $this->assertEquals($generatedUsername, $newUser->username); } #[Test] @@ -186,8 +186,8 @@ class ImportUsersTest extends ImportDataTestCase $userLocation = Location::query()->where('name', $importFileBuilder->firstRow()['location'])->sole(['id']); $this->assertEquals( - $assetsAssignedToUser->refresh()->location_id, - $userLocation->id + $userLocation->id, + $assetsAssignedToUser->refresh()->location_id ); } @@ -238,19 +238,19 @@ class ImportUsersTest extends ImportDataTestCase 'location_id', 'company_id', 'updated_at', 'phone', 'jobtitle' ]; - $this->assertEquals($updatedUser->email, $row['email']); - $this->assertEquals($updatedUser->first_name, $row['firstName']); - $this->assertEquals($updatedUser->last_name, $row['lastName']); - $this->assertEquals($updatedUser->employee_num, $row['employeeNumber']); - $this->assertEquals($updatedUser->company->name, $row['companyName']); - $this->assertEquals($updatedUser->location->name, $row['location']); - $this->assertEquals($updatedUser->phone, $row['phoneNumber']); - $this->assertEquals($updatedUser->jobtitle, $row['position']); + $this->assertEquals($row['email'], $updatedUser->email); + $this->assertEquals($row['firstName'], $updatedUser->first_name); + $this->assertEquals($row['lastName'], $updatedUser->last_name); + $this->assertEquals($row['employeeNumber'], $updatedUser->employee_num); + $this->assertEquals($row['companyName'], $updatedUser->company->name); + $this->assertEquals($row['location'], $updatedUser->location->name); + $this->assertEquals($row['phoneNumber'], $updatedUser->phone); + $this->assertEquals($row['position'], $updatedUser->jobtitle); $this->assertTrue(Hash::isHashed($updatedUser->password)); $this->assertEquals( - Arr::except($updatedUser->attributesToArray(), $updatedAttributes), Arr::except($user->attributesToArray(), $updatedAttributes), + Arr::except($updatedUser->attributesToArray(), $updatedAttributes), ); } @@ -295,21 +295,21 @@ class ImportUsersTest extends ImportDataTestCase ->where('username', $row['companyName']) ->sole(); - $this->assertEquals($newUser->email, $row['position']); - $this->assertEquals($newUser->first_name, $row['location']); - $this->assertEquals($newUser->last_name, $row['lastName']); - $this->assertEquals($newUser->jobtitle, $row['email']); - $this->assertEquals($newUser->employee_num, $row['phoneNumber']); - $this->assertEquals($newUser->company->name, $row['username']); - $this->assertEquals($newUser->location->name, $row['firstName']); - $this->assertEquals($newUser->phone, $row['employeeNumber']); + $this->assertEquals($row['position'], $newUser->email); + $this->assertEquals($row['location'], $newUser->first_name); + $this->assertEquals($row['lastName'], $newUser->last_name); + $this->assertEquals($row['email'], $newUser->jobtitle); + $this->assertEquals($row['phoneNumber'], $newUser->employee_num); + $this->assertEquals($row['username'], $newUser->company->name); + $this->assertEquals($row['firstName'], $newUser->location->name); + $this->assertEquals($row['employeeNumber'], $newUser->phone); $this->assertTrue(Hash::isHashed($newUser->password)); - $this->assertEquals($newUser->website, ''); - $this->assertEquals($newUser->country, ''); - $this->assertEquals($newUser->address, ''); - $this->assertEquals($newUser->city, ''); - $this->assertEquals($newUser->state, ''); - $this->assertEquals($newUser->zip, ''); + $this->assertEquals('', $newUser->website); + $this->assertEquals('', $newUser->country); + $this->assertEquals('', $newUser->address); + $this->assertEquals('', $newUser->city); + $this->assertEquals('', $newUser->state); + $this->assertEquals('', $newUser->zip); $this->assertNull($newUser->permissions); $this->assertNull($newUser->avatar); $this->assertNull($newUser->notes); @@ -317,15 +317,15 @@ class ImportUsersTest extends ImportDataTestCase $this->assertNull($newUser->department_id); $this->assertNull($newUser->two_factor_secret); $this->assertNull($newUser->idap_import); - $this->assertEquals($newUser->locale, 'en-US'); - $this->assertEquals($newUser->show_in_list, 1); - $this->assertEquals($newUser->two_factor_enrolled, 0); - $this->assertEquals($newUser->two_factor_optin, 0); - $this->assertEquals($newUser->remote, 0); - $this->assertEquals($newUser->autoassign_licenses, 0); - $this->assertEquals($newUser->vip, 0); - $this->assertEquals($newUser->enable_sounds, 0); - $this->assertEquals($newUser->enable_confetti, 0); + $this->assertEquals('en-US', $newUser->locale); + $this->assertEquals(1, $newUser->show_in_list); + $this->assertEquals(0, $newUser->two_factor_enrolled); + $this->assertEquals(0, $newUser->two_factor_optin); + $this->assertEquals(0, $newUser->remote); + $this->assertEquals(0, $newUser->autoassign_licenses); + $this->assertEquals(0, $newUser->vip); + $this->assertEquals(0, $newUser->enable_sounds); + $this->assertEquals(0, $newUser->enable_confetti); $this->assertNull($newUser->created_by); $this->assertNull($newUser->start_date); $this->assertNull($newUser->end_date); @@ -335,6 +335,6 @@ class ImportUsersTest extends ImportDataTestCase $this->assertNull($newUser->last_login); $this->assertNull($newUser->persist_code); $this->assertNull($newUser->reset_password_code); - $this->assertEquals($newUser->activated, 0); + $this->assertEquals(0, $newUser->activated); } }