From 82e795b6423cb56deace899c4e9e86cd6ac8cd13 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 6 Aug 2024 13:30:34 -0700 Subject: [PATCH] Revert "Add return types to test methods" This reverts commit 83fb6826eedf7e7adc066b394a616b472b178414. --- .../AssetModels/Api/CreateAssetModelsTest.php | 6 +-- .../AssetModels/Api/IndexAssetModelsTest.php | 8 ++-- .../AssetModels/Api/UpdateAssetModelsTest.php | 12 ++--- .../AssetModels/Ui/CreateAssetModelsTest.php | 6 +-- .../AssetModels/Ui/IndexAssetModelsTest.php | 4 +- .../AssetModels/Ui/UpdateAssetModelsTest.php | 6 +-- tests/Feature/Assets/Api/AssetFilesTest.php | 8 ++-- tests/Feature/Assets/Api/AssetIndexTest.php | 16 +++---- .../Assets/Api/AssetsForSelectListTest.php | 4 +- .../Assets/Api/RequestableAssetTest.php | 6 +-- tests/Feature/Assets/Api/StoreAssetTest.php | 48 +++++++++---------- tests/Feature/Assets/Api/UpdateAssetTest.php | 48 +++++++++---------- .../Assets/Ui/BulkDeleteAssetsTest.php | 16 +++---- .../Feature/Assets/Ui/BulkEditAssetsTest.php | 12 ++--- tests/Feature/Assets/Ui/CloneAssetTest.php | 4 +- tests/Feature/Assets/Ui/EditAssetTest.php | 6 +-- .../Categories/Api/CreateCategoriesTest.php | 8 ++-- .../Categories/Api/IndexCategoriesTest.php | 6 +-- .../Categories/Api/UpdateCategoriesTest.php | 4 +- .../Categories/Ui/CreateCategoriesTest.php | 6 +-- .../Categories/Ui/IndexCategoriesTest.php | 4 +- .../Categories/Ui/UpdateCategoriesTest.php | 10 ++-- .../Feature/Checkins/Api/AssetCheckinTest.php | 20 ++++---- .../Checkins/Ui/AccessoryCheckinTest.php | 8 ++-- .../Feature/Checkins/Ui/AssetCheckinTest.php | 28 +++++------ .../Checkins/Ui/ComponentCheckinTest.php | 6 +-- .../Checkins/Ui/LicenseCheckinTest.php | 2 +- .../Ui/AccessoryAcceptanceTest.php | 6 +-- .../Checkouts/Api/AccessoryCheckoutTest.php | 16 +++---- .../Checkouts/Api/AssetCheckoutTest.php | 18 +++---- .../Checkouts/Api/ConsumableCheckoutTest.php | 12 ++--- .../Checkouts/Ui/AccessoryCheckoutTest.php | 24 +++++----- .../Checkouts/Ui/AssetCheckoutTest.php | 30 ++++++------ .../Checkouts/Ui/ComponentsCheckoutTest.php | 8 ++-- .../Checkouts/Ui/ConsumableCheckoutTest.php | 18 +++---- .../Checkouts/Ui/LicenseCheckoutTest.php | 12 ++--- .../Components/Api/ComponentIndexTest.php | 2 +- .../Components/Ui/ComponentIndexTest.php | 4 +- tests/Feature/Console/MergeUsersTest.php | 2 +- tests/Feature/Console/OptimizeTest.php | 2 +- .../Consumables/Api/ConsumableIndexTest.php | 4 +- .../Consumables/Api/ConsumableUpdateTest.php | 4 +- .../Consumables/Api/ConsumableViewTest.php | 2 +- .../Consumables/Ui/ConsumableIndexTest.php | 4 +- .../Consumables/Ui/ConsumableViewTest.php | 4 +- tests/Feature/DashboardTest.php | 2 +- .../Departments/Api/CreateDepartmentsTest.php | 2 +- .../Departments/Api/DepartmentsIndexTest.php | 8 ++-- .../Departments/Api/UpdateDepartmentsTest.php | 4 +- .../Departments/Ui/CreateDepartmentsTest.php | 4 +- .../Departments/Ui/IndexDepartmentsTest.php | 4 +- .../Departments/Ui/UpdateDepartmentsTest.php | 4 +- tests/Feature/Groups/Api/StoreGroupTest.php | 8 ++-- tests/Feature/Groups/Ui/IndexGroupTest.php | 4 +- .../Feature/Licenses/Api/LicenseIndexTest.php | 2 +- .../Feature/Licenses/Ui/CreateLicenseTest.php | 4 +- .../Feature/Licenses/Ui/LicenseIndexTest.php | 4 +- tests/Feature/Licenses/Ui/LicenseViewTest.php | 4 +- .../Feature/Livewire/CategoryEditFormTest.php | 18 +++---- .../Locations/Api/CreateLocationsTest.php | 6 +-- .../Locations/Api/DeleteLocationsTest.php | 12 ++--- .../Locations/Api/IndexLocationsTest.php | 6 +-- .../Api/LocationsForSelectListTest.php | 6 +-- .../Locations/Api/LocationsViewTest.php | 6 +-- .../Locations/Api/UpdateLocationsTest.php | 4 +- .../Locations/Ui/CreateLocationsTest.php | 4 +- .../Locations/Ui/IndexLocationsTest.php | 4 +- .../Locations/Ui/UpdateLocationsTest.php | 6 +-- .../EmailNotificationsUponCheckinTest.php | 4 +- .../SlackNotificationsUponCheckinTest.php | 14 +++--- .../SlackNotificationsUponCheckoutTest.php | 18 +++---- tests/Feature/Reporting/CustomReportTest.php | 6 +-- .../Reporting/UnacceptedAssetReportTest.php | 4 +- .../Feature/Settings/BrandingSettingsTest.php | 26 +++++----- tests/Feature/Settings/ShowSetUpPageTest.php | 2 +- tests/Feature/Users/Api/DeleteUserTest.php | 18 +++---- tests/Feature/Users/Api/RestoreUserTest.php | 10 ++-- tests/Feature/Users/Api/UpdateUserTest.php | 24 +++++----- tests/Feature/Users/Api/UserSearchTest.php | 12 ++--- .../Users/Api/UsersForSelectListTest.php | 8 ++-- tests/Feature/Users/Api/ViewUserTest.php | 2 +- tests/Feature/Users/Ui/DeleteUserTest.php | 24 +++++----- tests/Feature/Users/Ui/MergeUsersTest.php | 14 +++--- tests/Feature/Users/Ui/UpdateUserTest.php | 10 ++-- tests/Feature/Users/Ui/ViewUserTest.php | 6 +-- tests/Unit/AccessoryTest.php | 8 ++-- tests/Unit/AssetMaintenanceTest.php | 8 ++-- tests/Unit/AssetModelTest.php | 2 +- tests/Unit/AssetTest.php | 18 +++---- tests/Unit/CategoryTest.php | 4 +- tests/Unit/CompanyScopingTest.php | 6 +-- tests/Unit/ComponentTest.php | 6 +-- tests/Unit/CustomFieldTest.php | 18 +++---- tests/Unit/DepreciationTest.php | 4 +- tests/Unit/Helpers/HelperTest.php | 8 ++-- tests/Unit/LdapTest.php | 22 ++++----- tests/Unit/Listeners/LogListenerTest.php | 2 +- tests/Unit/LocationTest.php | 4 +- tests/Unit/Models/Company/CompanyTest.php | 2 +- .../Company/GetIdForCurrentUserTest.php | 8 ++-- tests/Unit/Models/Labels/FieldOptionTest.php | 2 +- tests/Unit/NotificationTest.php | 2 +- tests/Unit/SnipeModelTest.php | 14 +++--- tests/Unit/SnipeTranslatorTest.php | 20 ++++---- tests/Unit/StatuslabelTest.php | 12 ++--- tests/Unit/UserTest.php | 14 +++--- 106 files changed, 498 insertions(+), 498 deletions(-) diff --git a/tests/Feature/AssetModels/Api/CreateAssetModelsTest.php b/tests/Feature/AssetModels/Api/CreateAssetModelsTest.php index 7325c240b9..cc072505a9 100644 --- a/tests/Feature/AssetModels/Api/CreateAssetModelsTest.php +++ b/tests/Feature/AssetModels/Api/CreateAssetModelsTest.php @@ -12,14 +12,14 @@ final class CreateAssetModelsTest extends TestCase { - public function testRequiresPermissionToCreateAssetModel(): void + public function testRequiresPermissionToCreateAssetModel() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.models.store')) ->assertForbidden(); } - public function testCanCreateAssetModelWithAssetModelType(): void + public function testCanCreateAssetModelWithAssetModelType() { $response = $this->actingAsForApi(User::factory()->superuser()->create()) ->postJson(route('api.models.store'), [ @@ -37,7 +37,7 @@ final class CreateAssetModelsTest extends TestCase $this->assertEquals('Test AssetModel', $model->name); } - public function testCannotCreateAssetModelWithoutCategory(): void + public function testCannotCreateAssetModelWithoutCategory() { $response = $this->actingAsForApi(User::factory()->superuser()->create()) ->postJson(route('api.models.store'), [ diff --git a/tests/Feature/AssetModels/Api/IndexAssetModelsTest.php b/tests/Feature/AssetModels/Api/IndexAssetModelsTest.php index 7f83c97c2a..6afa23c939 100644 --- a/tests/Feature/AssetModels/Api/IndexAssetModelsTest.php +++ b/tests/Feature/AssetModels/Api/IndexAssetModelsTest.php @@ -10,19 +10,19 @@ use Tests\TestCase; final class IndexAssetModelsTest extends TestCase { - public function testViewingAssetModelIndexRequiresAuthentication(): void + public function testViewingAssetModelIndexRequiresAuthentication() { $this->getJson(route('api.models.index'))->assertRedirect(); } - public function testViewingAssetModelIndexRequiresPermission(): void + public function testViewingAssetModelIndexRequiresPermission() { $this->actingAsForApi(User::factory()->create()) ->getJson(route('api.models.index')) ->assertForbidden(); } - public function testAssetModelIndexReturnsExpectedAssetModels(): void + public function testAssetModelIndexReturnsExpectedAssetModels() { AssetModel::factory()->count(3)->create(); @@ -42,7 +42,7 @@ final class IndexAssetModelsTest extends TestCase ->assertJson(fn(AssertableJson $json) => $json->has('rows', 3)->etc()); } - public function testAssetModelIndexSearchReturnsExpectedAssetModels(): void + public function testAssetModelIndexSearchReturnsExpectedAssetModels() { AssetModel::factory()->count(3)->create(); AssetModel::factory()->count(1)->create(['name' => 'Test Model']); diff --git a/tests/Feature/AssetModels/Api/UpdateAssetModelsTest.php b/tests/Feature/AssetModels/Api/UpdateAssetModelsTest.php index c9cc7b6542..16401c3851 100644 --- a/tests/Feature/AssetModels/Api/UpdateAssetModelsTest.php +++ b/tests/Feature/AssetModels/Api/UpdateAssetModelsTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; final class UpdateAssetModelsTest extends TestCase { - public function testRequiresPermissionToEditAssetModel(): void + public function testRequiresPermissionToEditAssetModel() { $model = AssetModel::factory()->create(); $this->actingAsForApi(User::factory()->create()) @@ -18,7 +18,7 @@ final class UpdateAssetModelsTest extends TestCase ->assertForbidden(); } - public function testCanUpdateAssetModelViaPatch(): void + public function testCanUpdateAssetModelViaPatch() { $model = AssetModel::factory()->create(); @@ -37,7 +37,7 @@ final class UpdateAssetModelsTest extends TestCase } - public function testCannotUpdateAssetModelViaPatchWithAccessoryCategory(): void + public function testCannotUpdateAssetModelViaPatchWithAccessoryCategory() { $category = Category::factory()->forAccessories()->create(); $model = AssetModel::factory()->create(); @@ -57,7 +57,7 @@ final class UpdateAssetModelsTest extends TestCase $this->assertNotEquals('category_id', $category->id, 'Category ID was not updated'); } - public function testCannotUpdateAssetModelViaPatchWithLicenseCategory(): void + public function testCannotUpdateAssetModelViaPatchWithLicenseCategory() { $category = Category::factory()->forLicenses()->create(); $model = AssetModel::factory()->create(); @@ -77,7 +77,7 @@ final class UpdateAssetModelsTest extends TestCase $this->assertNotEquals('category_id', $category->id, 'Category ID was not updated'); } - public function testCannotUpdateAssetModelViaPatchWithConsumableCategory(): void + public function testCannotUpdateAssetModelViaPatchWithConsumableCategory() { $category = Category::factory()->forConsumables()->create(); $model = AssetModel::factory()->create(); @@ -97,7 +97,7 @@ final class UpdateAssetModelsTest extends TestCase $this->assertNotEquals('category_id', $category->id, 'Category ID was not updated'); } - public function testCannotUpdateAssetModelViaPatchWithComponentCategory(): void + public function testCannotUpdateAssetModelViaPatchWithComponentCategory() { $category = Category::factory()->forComponents()->create(); $model = AssetModel::factory()->create(); diff --git a/tests/Feature/AssetModels/Ui/CreateAssetModelsTest.php b/tests/Feature/AssetModels/Ui/CreateAssetModelsTest.php index c2d51b3979..37c5fce398 100644 --- a/tests/Feature/AssetModels/Ui/CreateAssetModelsTest.php +++ b/tests/Feature/AssetModels/Ui/CreateAssetModelsTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class CreateAssetModelsTest extends TestCase { - public function testPermissionRequiredToCreateAssetModel(): void + public function testPermissionRequiredToCreateAssetModel() { $this->actingAs(User::factory()->create()) ->post(route('models.store'), [ @@ -19,7 +19,7 @@ final class CreateAssetModelsTest extends TestCase ->assertForbidden(); } - public function testUserCanCreateAssetModels(): void + public function testUserCanCreateAssetModels() { $this->assertFalse(AssetModel::where('name', 'Test Model')->exists()); @@ -33,7 +33,7 @@ final class CreateAssetModelsTest extends TestCase $this->assertTrue(AssetModel::where('name', 'Test Model')->exists()); } - public function testUserCannotUseAccessoryCategoryTypeAsAssetModelCategoryType(): void + public function testUserCannotUseAccessoryCategoryTypeAsAssetModelCategoryType() { $response = $this->actingAs(User::factory()->superuser()->create()) diff --git a/tests/Feature/AssetModels/Ui/IndexAssetModelsTest.php b/tests/Feature/AssetModels/Ui/IndexAssetModelsTest.php index 69724a4a69..e2a65ae131 100644 --- a/tests/Feature/AssetModels/Ui/IndexAssetModelsTest.php +++ b/tests/Feature/AssetModels/Ui/IndexAssetModelsTest.php @@ -7,14 +7,14 @@ use Tests\TestCase; final class IndexAssetModelsTest extends TestCase { - public function testPermissionRequiredToViewAssetModelList(): void + public function testPermissionRequiredToViewAssetModelList() { $this->actingAs(User::factory()->create()) ->get(route('models.index')) ->assertForbidden(); } - public function testUserCanListAssetModels(): void + public function testUserCanListAssetModels() { $this->actingAs(User::factory()->superuser()->create()) ->get(route('models.index')) diff --git a/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php b/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php index 33336fa38b..3d459413bb 100644 --- a/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php +++ b/tests/Feature/AssetModels/Ui/UpdateAssetModelsTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class UpdateAssetModelsTest extends TestCase { - public function testPermissionRequiredToStoreAssetModel(): void + public function testPermissionRequiredToStoreAssetModel() { $this->actingAs(User::factory()->create()) ->post(route('models.store'), [ @@ -20,7 +20,7 @@ final class UpdateAssetModelsTest extends TestCase ->assertForbidden(); } - public function testUserCanEditAssetModels(): void + public function testUserCanEditAssetModels() { $category = Category::factory()->forAssets()->create(); $model = AssetModel::factory()->create(['name' => 'Test Model', 'category_id' => $category->id]); @@ -40,7 +40,7 @@ final class UpdateAssetModelsTest extends TestCase } - public function testUserCannotChangeAssetModelCategoryType(): void + public function testUserCannotChangeAssetModelCategoryType() { $category = Category::factory()->forAssets()->create(); $model = AssetModel::factory()->create(['name' => 'Test Model', 'category_id' => $category->id]); diff --git a/tests/Feature/Assets/Api/AssetFilesTest.php b/tests/Feature/Assets/Api/AssetFilesTest.php index ad30f96295..136e90aa28 100644 --- a/tests/Feature/Assets/Api/AssetFilesTest.php +++ b/tests/Feature/Assets/Api/AssetFilesTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class AssetFilesTest extends TestCase { - public function testAssetApiAcceptsFileUpload(): void + public function testAssetApiAcceptsFileUpload() { // Upload a file to an asset @@ -28,7 +28,7 @@ final class AssetFilesTest extends TestCase ->assertOk(); } - public function testAssetApiListsFiles(): void + public function testAssetApiListsFiles() { // List all files on an asset @@ -50,7 +50,7 @@ final class AssetFilesTest extends TestCase ]); } - public function testAssetApiDownloadsFile(): void + public function testAssetApiDownloadsFile() { // Download a file from an asset @@ -84,7 +84,7 @@ final class AssetFilesTest extends TestCase ->assertOk(); } - public function testAssetApiDeletesFile(): void + public function testAssetApiDeletesFile() { // Delete a file from an asset diff --git a/tests/Feature/Assets/Api/AssetIndexTest.php b/tests/Feature/Assets/Api/AssetIndexTest.php index 0fd81862ac..797499137d 100644 --- a/tests/Feature/Assets/Api/AssetIndexTest.php +++ b/tests/Feature/Assets/Api/AssetIndexTest.php @@ -11,7 +11,7 @@ use Tests\TestCase; final class AssetIndexTest extends TestCase { - public function testAssetApiIndexReturnsExpectedAssets(): void + public function testAssetApiIndexReturnsExpectedAssets() { Asset::factory()->count(3)->create(); @@ -31,7 +31,7 @@ final class AssetIndexTest extends TestCase ->assertJson(fn(AssertableJson $json) => $json->has('rows', 3)->etc()); } - public function testAssetApiIndexReturnsDisplayUpcomingAuditsDue(): void + public function testAssetApiIndexReturnsDisplayUpcomingAuditsDue() { Asset::factory()->count(3)->create(['next_audit_date' => Carbon::now()->format('Y-m-d')]); @@ -47,7 +47,7 @@ final class AssetIndexTest extends TestCase ->assertJson(fn(AssertableJson $json) => $json->has('rows', 3)->etc()); } - public function testAssetApiIndexReturnsOverdueForAudit(): void + public function testAssetApiIndexReturnsOverdueForAudit() { Asset::factory()->count(3)->create(['next_audit_date' => Carbon::now()->subDays(1)->format('Y-m-d')]); @@ -63,7 +63,7 @@ final class AssetIndexTest extends TestCase } - public function testAssetApiIndexReturnsDueOrOverdueForAudit(): void + public function testAssetApiIndexReturnsDueOrOverdueForAudit() { Asset::factory()->count(3)->create(['next_audit_date' => Carbon::now()->format('Y-m-d')]); Asset::factory()->count(2)->create(['next_audit_date' => Carbon::now()->subDays(1)->format('Y-m-d')]); @@ -81,7 +81,7 @@ final class AssetIndexTest extends TestCase - public function testAssetApiIndexReturnsDueForExpectedCheckin(): void + public function testAssetApiIndexReturnsDueForExpectedCheckin() { Asset::factory()->count(3)->create(['assigned_to' => '1', 'expected_checkin' => Carbon::now()->format('Y-m-d')]); @@ -97,7 +97,7 @@ final class AssetIndexTest extends TestCase ->assertJson(fn(AssertableJson $json) => $json->has('rows', 3)->etc()); } - public function testAssetApiIndexReturnsOverdueForExpectedCheckin(): void + public function testAssetApiIndexReturnsOverdueForExpectedCheckin() { Asset::factory()->count(3)->create(['assigned_to' => '1', 'expected_checkin' => Carbon::now()->subDays(1)->format('Y-m-d')]); @@ -111,7 +111,7 @@ final class AssetIndexTest extends TestCase ->assertJson(fn(AssertableJson $json) => $json->has('rows', 3)->etc()); } - public function testAssetApiIndexReturnsDueOrOverdueForExpectedCheckin(): void + public function testAssetApiIndexReturnsDueOrOverdueForExpectedCheckin() { Asset::factory()->count(3)->create(['assigned_to' => '1', 'expected_checkin' => Carbon::now()->subDays(1)->format('Y-m-d')]); Asset::factory()->count(2)->create(['assigned_to' => '1', 'expected_checkin' => Carbon::now()->format('Y-m-d')]); @@ -126,7 +126,7 @@ final class AssetIndexTest extends TestCase ->assertJson(fn(AssertableJson $json) => $json->has('rows', 5)->etc()); } - public function testAssetApiIndexAdheresToCompanyScoping(): void + public function testAssetApiIndexAdheresToCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Feature/Assets/Api/AssetsForSelectListTest.php b/tests/Feature/Assets/Api/AssetsForSelectListTest.php index b7837f7588..a44996f63b 100644 --- a/tests/Feature/Assets/Api/AssetsForSelectListTest.php +++ b/tests/Feature/Assets/Api/AssetsForSelectListTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class AssetsForSelectListTest extends TestCase { - public function testAssetsCanBeSearchedForByAssetTag(): void + public function testAssetsCanBeSearchedForByAssetTag() { Asset::factory()->create(['asset_tag' => '0001']); Asset::factory()->create(['asset_tag' => '0002']); @@ -25,7 +25,7 @@ final class AssetsForSelectListTest extends TestCase $this->assertTrue($results->pluck('text')->contains(fn($text) => str_contains($text, '0002'))); } - public function testAssetsAreScopedToCompanyWhenMultipleCompanySupportEnabled(): void + public function testAssetsAreScopedToCompanyWhenMultipleCompanySupportEnabled() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Feature/Assets/Api/RequestableAssetTest.php b/tests/Feature/Assets/Api/RequestableAssetTest.php index 10188e84e7..9fc81a5ff3 100644 --- a/tests/Feature/Assets/Api/RequestableAssetTest.php +++ b/tests/Feature/Assets/Api/RequestableAssetTest.php @@ -9,14 +9,14 @@ use Tests\TestCase; final class RequestableAssetTest extends TestCase { - public function testViewingRequestableAssetsRequiresCorrectPermission(): void + public function testViewingRequestableAssetsRequiresCorrectPermission() { $this->actingAsForApi(User::factory()->create()) ->getJson(route('api.assets.requestable')) ->assertForbidden(); } - public function testReturnsRequestableAssets(): void + public function testReturnsRequestableAssets() { $requestableAsset = Asset::factory()->requestable()->create(['asset_tag' => 'requestable']); $nonRequestableAsset = Asset::factory()->nonrequestable()->create(['asset_tag' => 'non-requestable']); @@ -28,7 +28,7 @@ final class RequestableAssetTest extends TestCase ->assertResponseDoesNotContainInRows($nonRequestableAsset, 'asset_tag'); } - public function testRequestableAssetsAreScopedToCompanyWhenMultipleCompanySupportEnabled(): void + public function testRequestableAssetsAreScopedToCompanyWhenMultipleCompanySupportEnabled() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Feature/Assets/Api/StoreAssetTest.php b/tests/Feature/Assets/Api/StoreAssetTest.php index 320455aa42..437c456a67 100644 --- a/tests/Feature/Assets/Api/StoreAssetTest.php +++ b/tests/Feature/Assets/Api/StoreAssetTest.php @@ -16,14 +16,14 @@ use Tests\TestCase; final class StoreAssetTest extends TestCase { - public function testRequiresPermissionToCreateAsset(): void + public function testRequiresPermissionToCreateAsset() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.assets.store')) ->assertForbidden(); } - public function testAllAssetAttributesAreStored(): void + public function testAllAssetAttributesAreStored() { $company = Company::factory()->create(); $location = Location::factory()->create(); @@ -83,7 +83,7 @@ final class StoreAssetTest extends TestCase $this->assertEquals(10, $asset->warranty_months); } - public function testSetsLastAuditDateToMidnightOfProvidedDate(): void + public function testSetsLastAuditDateToMidnightOfProvidedDate() { $response = $this->actingAsForApi(User::factory()->superuser()->create()) ->postJson(route('api.assets.store'), [ @@ -99,7 +99,7 @@ final class StoreAssetTest extends TestCase $this->assertEquals('2023-09-03 00:00:00', $asset->last_audit_date); } - public function testLastAuditDateCanBeNull(): void + public function testLastAuditDateCanBeNull() { $response = $this->actingAsForApi(User::factory()->superuser()->create()) ->postJson(route('api.assets.store'), [ @@ -115,7 +115,7 @@ final class StoreAssetTest extends TestCase $this->assertNull($asset->last_audit_date); } - public function testNonDateUsedForLastAuditDateReturnsValidationError(): void + public function testNonDateUsedForLastAuditDateReturnsValidationError() { $response = $this->actingAsForApi(User::factory()->superuser()->create()) ->postJson(route('api.assets.store'), [ @@ -129,7 +129,7 @@ final class StoreAssetTest extends TestCase $this->assertNotNull($response->json('messages.last_audit_date')); } - public function testArchivedDepreciateAndPhysicalCanBeNull(): void + public function testArchivedDepreciateAndPhysicalCanBeNull() { $model = AssetModel::factory()->ipadModel()->create(); $status = Statuslabel::factory()->create(); @@ -154,7 +154,7 @@ final class StoreAssetTest extends TestCase $this->assertEquals(0, $asset->depreciate); } - public function testArchivedDepreciateAndPhysicalCanBeEmpty(): void + public function testArchivedDepreciateAndPhysicalCanBeEmpty() { $model = AssetModel::factory()->ipadModel()->create(); $status = Statuslabel::factory()->create(); @@ -179,7 +179,7 @@ final class StoreAssetTest extends TestCase $this->assertEquals(0, $asset->depreciate); } - public function testAssetEolDateIsCalculatedIfPurchaseDateSet(): void + public function testAssetEolDateIsCalculatedIfPurchaseDateSet() { $model = AssetModel::factory()->mbp13Model()->create(); $status = Statuslabel::factory()->create(); @@ -200,7 +200,7 @@ final class StoreAssetTest extends TestCase $this->assertEquals('2024-01-01', $asset->asset_eol_date); } - public function testAssetEolDateIsNotCalculatedIfPurchaseDateNotSet(): void + public function testAssetEolDateIsNotCalculatedIfPurchaseDateNotSet() { $model = AssetModel::factory()->mbp13Model()->create(); $status = Statuslabel::factory()->create(); @@ -220,7 +220,7 @@ final class StoreAssetTest extends TestCase $this->assertNull($asset->asset_eol_date); } - public function testAssetEolExplicitIsSetIfAssetEolDateIsExplicitlySet(): void + public function testAssetEolExplicitIsSetIfAssetEolDateIsExplicitlySet() { $model = AssetModel::factory()->mbp13Model()->create(); $status = Statuslabel::factory()->create(); @@ -242,7 +242,7 @@ final class StoreAssetTest extends TestCase $this->assertTrue($asset->eol_explicit); } - public function testAssetGetsAssetTagWithAutoIncrement(): void + public function testAssetGetsAssetTagWithAutoIncrement() { $model = AssetModel::factory()->create(); $status = Statuslabel::factory()->create(); @@ -262,7 +262,7 @@ final class StoreAssetTest extends TestCase $this->assertNotNull($asset->asset_tag); } - public function testAssetCreationFailsWithNoAssetTagOrAutoIncrement(): void + public function testAssetCreationFailsWithNoAssetTagOrAutoIncrement() { $model = AssetModel::factory()->create(); $status = Statuslabel::factory()->create(); @@ -278,7 +278,7 @@ final class StoreAssetTest extends TestCase ->assertStatusMessageIs('error'); } - public function testStoresPeriodAsDecimalSeparatorForPurchaseCost(): void + public function testStoresPeriodAsDecimalSeparatorForPurchaseCost() { $this->settings->set([ 'default_currency' => 'USD', @@ -300,7 +300,7 @@ final class StoreAssetTest extends TestCase $this->assertEquals(12.34, $asset->purchase_cost); } - public function testStoresPeriodAsCommaSeparatorForPurchaseCost(): void + public function testStoresPeriodAsCommaSeparatorForPurchaseCost() { $this->settings->set([ 'default_currency' => 'EUR', @@ -322,7 +322,7 @@ final class StoreAssetTest extends TestCase $this->assertEquals(12.34, $asset->purchase_cost); } - public function testUniqueSerialNumbersIsEnforcedWhenEnabled(): void + public function testUniqueSerialNumbersIsEnforcedWhenEnabled() { $model = AssetModel::factory()->create(); $status = Statuslabel::factory()->create(); @@ -350,7 +350,7 @@ final class StoreAssetTest extends TestCase ->assertStatusMessageIs('error'); } - public function testUniqueSerialNumbersIsNotEnforcedWhenDisabled(): void + public function testUniqueSerialNumbersIsNotEnforcedWhenDisabled() { $model = AssetModel::factory()->create(); $status = Statuslabel::factory()->create(); @@ -378,7 +378,7 @@ final class StoreAssetTest extends TestCase ->assertStatusMessageIs('success'); } - public function testAssetTagsMustBeUniqueWhenUndeleted(): void + public function testAssetTagsMustBeUniqueWhenUndeleted() { $model = AssetModel::factory()->create(); $status = Statuslabel::factory()->create(); @@ -405,7 +405,7 @@ final class StoreAssetTest extends TestCase ->assertStatusMessageIs('error'); } - public function testAssetTagsCanBeDuplicatedIfDeleted(): void + public function testAssetTagsCanBeDuplicatedIfDeleted() { $model = AssetModel::factory()->create(); $status = Statuslabel::factory()->create(); @@ -435,7 +435,7 @@ final class StoreAssetTest extends TestCase ->assertStatusMessageIs('success'); } - public function testAnAssetCanBeCheckedOutToUserOnStore(): void + public function testAnAssetCanBeCheckedOutToUserOnStore() { $model = AssetModel::factory()->create(); $status = Statuslabel::factory()->create(); @@ -461,7 +461,7 @@ final class StoreAssetTest extends TestCase $this->assertTrue($asset->assignedTo->is($userAssigned)); } - public function testAnAssetCanBeCheckedOutToLocationOnStore(): void + public function testAnAssetCanBeCheckedOutToLocationOnStore() { $model = AssetModel::factory()->create(); $status = Statuslabel::factory()->create(); @@ -487,7 +487,7 @@ final class StoreAssetTest extends TestCase $this->assertTrue($asset->location->is($location)); } - public function testAnAssetCanBeCheckedOutToAssetOnStore(): void + public function testAnAssetCanBeCheckedOutToAssetOnStore() { $model = AssetModel::factory()->create(); $status = Statuslabel::factory()->create(); @@ -514,7 +514,7 @@ final class StoreAssetTest extends TestCase $this->assertTrue($asset->assignedAssets()->find($response['payload']['id'])->is($apiAsset)); } - public function testCompanyIdNeedsToBeInteger(): void + public function testCompanyIdNeedsToBeInteger() { $this->actingAsForApi(User::factory()->createAssets()->create()) ->postJson(route('api.assets.store'), [ @@ -526,7 +526,7 @@ final class StoreAssetTest extends TestCase }); } - public function testEncryptedCustomFieldCanBeStored(): void + public function testEncryptedCustomFieldCanBeStored() { $this->markIncompleteIfMySQL('Custom Fields tests do not work on MySQL'); @@ -550,7 +550,7 @@ final class StoreAssetTest extends TestCase $this->assertEquals('This is encrypted field', Crypt::decrypt($asset->{$field->db_column_name()})); } - public function testPermissionNeededToStoreEncryptedField(): void + public function testPermissionNeededToStoreEncryptedField() { // @todo: $this->markTestIncomplete(); diff --git a/tests/Feature/Assets/Api/UpdateAssetTest.php b/tests/Feature/Assets/Api/UpdateAssetTest.php index f964ea1aec..f58c26b051 100644 --- a/tests/Feature/Assets/Api/UpdateAssetTest.php +++ b/tests/Feature/Assets/Api/UpdateAssetTest.php @@ -15,14 +15,14 @@ use Tests\TestCase; final class UpdateAssetTest extends TestCase { - public function testThatANonExistentAssetIdReturnsError(): void + public function testThatANonExistentAssetIdReturnsError() { $this->actingAsForApi(User::factory()->editAssets()->createAssets()->create()) ->patchJson(route('api.assets.update', 123456789)) ->assertStatusMessageIs('error'); } - public function testRequiresPermissionToUpdateAsset(): void + public function testRequiresPermissionToUpdateAsset() { $asset = Asset::factory()->create(); @@ -31,7 +31,7 @@ final class UpdateAssetTest extends TestCase ->assertForbidden(); } - public function testGivenPermissionUpdateAssetIsAllowed(): void + public function testGivenPermissionUpdateAssetIsAllowed() { $asset = Asset::factory()->create(); @@ -43,7 +43,7 @@ final class UpdateAssetTest extends TestCase ->assertOk(); } - public function testAllAssetAttributesAreStored(): void + public function testAllAssetAttributesAreStored() { $asset = Asset::factory()->create(); $user = User::factory()->editAssets()->create(); @@ -103,7 +103,7 @@ final class UpdateAssetTest extends TestCase $this->assertEquals('2023-09-03 00:00:00', $updatedAsset->last_audit_date); } - public function testAssetEolDateIsCalculatedIfPurchaseDateUpdated(): void + public function testAssetEolDateIsCalculatedIfPurchaseDateUpdated() { $asset = Asset::factory()->laptopMbp()->noPurchaseOrEolDate()->create(); @@ -120,7 +120,7 @@ final class UpdateAssetTest extends TestCase $this->assertEquals('2024-01-01', $asset->asset_eol_date); } - public function testAssetEolDateIsNotCalculatedIfPurchaseDateNotSet(): void + public function testAssetEolDateIsNotCalculatedIfPurchaseDateNotSet() { $asset = Asset::factory()->laptopMbp()->noPurchaseOrEolDate()->create(); @@ -138,7 +138,7 @@ final class UpdateAssetTest extends TestCase $this->assertEquals('2022-01-01', $asset->asset_eol_date); } - public function testAssetEolExplicitIsSetIfAssetEolDateIsExplicitlySet(): void + public function testAssetEolExplicitIsSetIfAssetEolDateIsExplicitlySet() { $asset = Asset::factory()->laptopMbp()->create(); @@ -156,7 +156,7 @@ final class UpdateAssetTest extends TestCase $this->assertTrue($asset->eol_explicit); } - public function testAssetTagCannotUpdateToNullValue(): void + public function testAssetTagCannotUpdateToNullValue() { $asset = Asset::factory()->laptopMbp()->create(); @@ -168,7 +168,7 @@ final class UpdateAssetTest extends TestCase ->assertStatusMessageIs('error'); } - public function testAssetTagCannotUpdateToEmptyStringValue(): void + public function testAssetTagCannotUpdateToEmptyStringValue() { $asset = Asset::factory()->laptopMbp()->create(); @@ -180,7 +180,7 @@ final class UpdateAssetTest extends TestCase ->assertStatusMessageIs('error'); } - public function testModelIdCannotUpdateToNullValue(): void + public function testModelIdCannotUpdateToNullValue() { $asset = Asset::factory()->laptopMbp()->create(); @@ -192,7 +192,7 @@ final class UpdateAssetTest extends TestCase ->assertStatusMessageIs('error'); } - public function testModelIdCannotUpdateToEmptyStringValue(): void + public function testModelIdCannotUpdateToEmptyStringValue() { $asset = Asset::factory()->laptopMbp()->create(); @@ -204,7 +204,7 @@ final class UpdateAssetTest extends TestCase ->assertStatusMessageIs('error'); } - public function testStatusIdCannotUpdateToNullValue(): void + public function testStatusIdCannotUpdateToNullValue() { $asset = Asset::factory()->laptopMbp()->create(); @@ -216,7 +216,7 @@ final class UpdateAssetTest extends TestCase ->assertStatusMessageIs('error'); } - public function testStatusIdCannotUpdateToEmptyStringValue(): void + public function testStatusIdCannotUpdateToEmptyStringValue() { $asset = Asset::factory()->laptopMbp()->create(); @@ -228,7 +228,7 @@ final class UpdateAssetTest extends TestCase ->assertStatusMessageIs('error'); } - public function testIfRtdLocationIdIsSetWithoutLocationIdAssetReturnsToDefault(): void + public function testIfRtdLocationIdIsSetWithoutLocationIdAssetReturnsToDefault() { $location = Location::factory()->create(); $asset = Asset::factory()->laptopMbp()->create([ @@ -247,7 +247,7 @@ final class UpdateAssetTest extends TestCase $this->assertTrue($asset->location->is($rtdLocation)); } - public function testIfLocationAndRtdLocationAreSetLocationIdIsLocation(): void + public function testIfLocationAndRtdLocationAreSetLocationIdIsLocation() { $location = Location::factory()->create(); $asset = Asset::factory()->laptopMbp()->create(); @@ -265,7 +265,7 @@ final class UpdateAssetTest extends TestCase $this->assertTrue($asset->location->is($location)); } - public function testEncryptedCustomFieldCanBeUpdated(): void + public function testEncryptedCustomFieldCanBeUpdated() { $this->markIncompleteIfMySQL('Custom Fields tests do not work on MySQL'); @@ -284,7 +284,7 @@ final class UpdateAssetTest extends TestCase $this->assertEquals('This is encrypted field', Crypt::decrypt($asset->{$field->db_column_name()})); } - public function testPermissionNeededToUpdateEncryptedField(): void + public function testPermissionNeededToUpdateEncryptedField() { $this->markIncompleteIfMySQL('Custom Fields tests do not work on MySQL'); @@ -308,7 +308,7 @@ final class UpdateAssetTest extends TestCase $this->assertEquals("encrypted value should not change", Crypt::decrypt($asset->{$field->db_column_name()})); } - public function testCheckoutToUserOnAssetUpdate(): void + public function testCheckoutToUserOnAssetUpdate() { $asset = Asset::factory()->create(); $user = User::factory()->editAssets()->create(); @@ -327,7 +327,7 @@ final class UpdateAssetTest extends TestCase $this->assertEquals($asset->assigned_type, 'App\Models\User'); } - public function testCheckoutToDeletedUserFailsOnAssetUpdate(): void + public function testCheckoutToDeletedUserFailsOnAssetUpdate() { $asset = Asset::factory()->create(); $user = User::factory()->editAssets()->create(); @@ -346,7 +346,7 @@ final class UpdateAssetTest extends TestCase $this->assertNull($asset->assigned_type); } - public function testCheckoutToLocationOnAssetUpdate(): void + public function testCheckoutToLocationOnAssetUpdate() { $asset = Asset::factory()->create(); $user = User::factory()->editAssets()->create(); @@ -366,7 +366,7 @@ final class UpdateAssetTest extends TestCase } - public function testCheckoutToDeletedLocationFailsOnAssetUpdate(): void + public function testCheckoutToDeletedLocationFailsOnAssetUpdate() { $asset = Asset::factory()->create(); $user = User::factory()->editAssets()->create(); @@ -385,7 +385,7 @@ final class UpdateAssetTest extends TestCase $this->assertNull($asset->assigned_type); } - public function testCheckoutAssetOnAssetUpdate(): void + public function testCheckoutAssetOnAssetUpdate() { $asset = Asset::factory()->create(); $user = User::factory()->editAssets()->create(); @@ -406,7 +406,7 @@ final class UpdateAssetTest extends TestCase } - public function testCheckoutToDeletedAssetFailsOnAssetUpdate(): void + public function testCheckoutToDeletedAssetFailsOnAssetUpdate() { $asset = Asset::factory()->create(); $user = User::factory()->editAssets()->create(); @@ -425,7 +425,7 @@ final class UpdateAssetTest extends TestCase $this->assertNull($asset->assigned_type); } - public function testAssetCannotBeUpdatedByUserInSeparateCompany(): void + public function testAssetCannotBeUpdatedByUserInSeparateCompany() { $this->settings->enableMultipleFullCompanySupport(); diff --git a/tests/Feature/Assets/Ui/BulkDeleteAssetsTest.php b/tests/Feature/Assets/Ui/BulkDeleteAssetsTest.php index 3be29e2d58..26478d37fd 100644 --- a/tests/Feature/Assets/Ui/BulkDeleteAssetsTest.php +++ b/tests/Feature/Assets/Ui/BulkDeleteAssetsTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; final class BulkDeleteAssetsTest extends TestCase { - public function testUserWithPermissionsCanAccessPage(): void + public function testUserWithPermissionsCanAccessPage() { $user = User::factory()->viewAssets()->deleteAssets()->editAssets()->create(); $assets = Asset::factory()->count(2)->create(); @@ -25,7 +25,7 @@ final class BulkDeleteAssetsTest extends TestCase ])->assertStatus(200); } - public function testStandardUserCannotAccessPage(): void + public function testStandardUserCannotAccessPage() { $user = User::factory()->create(); $assets = Asset::factory()->count(2)->create(); @@ -38,7 +38,7 @@ final class BulkDeleteAssetsTest extends TestCase ])->assertStatus(403); } - public function testPageRedirectFromInterstitialIfNoAssetsSelectedToDelete(): void + public function testPageRedirectFromInterstitialIfNoAssetsSelectedToDelete() { $user = User::factory()->viewAssets()->deleteAssets()->editAssets()->create(); $response = $this->actingAs($user) @@ -52,7 +52,7 @@ final class BulkDeleteAssetsTest extends TestCase $this->followRedirects($response)->assertSee('alert-danger'); } - public function testPageRedirectFromInterstitialIfNoAssetsSelectedToRestore(): void + public function testPageRedirectFromInterstitialIfNoAssetsSelectedToRestore() { $user = User::factory()->viewAssets()->deleteAssets()->editAssets()->create(); $response = $this->actingAs($user) @@ -68,7 +68,7 @@ final class BulkDeleteAssetsTest extends TestCase } - public function testBulkDeleteSelectedAssetsFromInterstitial(): void + public function testBulkDeleteSelectedAssetsFromInterstitial() { $user = User::factory()->viewAssets()->deleteAssets()->editAssets()->create(); $assets = Asset::factory()->count(2)->create(); @@ -89,7 +89,7 @@ final class BulkDeleteAssetsTest extends TestCase $this->followRedirects($response)->assertSee('alert-success'); } - public function testBulkRestoreSelectedAssetsFromInterstitial(): void + public function testBulkRestoreSelectedAssetsFromInterstitial() { $user = User::factory()->viewAssets()->deleteAssets()->editAssets()->create(); $asset = Asset::factory()->deleted()->create(); @@ -116,7 +116,7 @@ final class BulkDeleteAssetsTest extends TestCase } - public function testActionLogCreatedUponBulkDelete(): void + public function testActionLogCreatedUponBulkDelete() { $user = User::factory()->viewAssets()->deleteAssets()->editAssets()->create(); $asset = Asset::factory()->create(); @@ -139,7 +139,7 @@ final class BulkDeleteAssetsTest extends TestCase ); } - public function testActionLogCreatedUponBulkRestore(): void + public function testActionLogCreatedUponBulkRestore() { $user = User::factory()->viewAssets()->deleteAssets()->editAssets()->create(); $asset = Asset::factory()->deleted()->create(); diff --git a/tests/Feature/Assets/Ui/BulkEditAssetsTest.php b/tests/Feature/Assets/Ui/BulkEditAssetsTest.php index 3596852978..d4253d4c77 100644 --- a/tests/Feature/Assets/Ui/BulkEditAssetsTest.php +++ b/tests/Feature/Assets/Ui/BulkEditAssetsTest.php @@ -14,7 +14,7 @@ use Tests\TestCase; final class BulkEditAssetsTest extends TestCase { - public function testUserWithPermissionsCanAccessPage(): void + public function testUserWithPermissionsCanAccessPage() { $user = User::factory()->viewAssets()->editAssets()->create(); $assets = Asset::factory()->count(2)->create(); @@ -29,7 +29,7 @@ final class BulkEditAssetsTest extends TestCase ])->assertStatus(200); } - public function testStandardUserCannotAccessPage(): void + public function testStandardUserCannotAccessPage() { $user = User::factory()->create(); $assets = Asset::factory()->count(2)->create(); @@ -44,7 +44,7 @@ final class BulkEditAssetsTest extends TestCase ])->assertStatus(403); } - public function testBulkEditAssetsAcceptsAllPossibleAttributes(): void + public function testBulkEditAssetsAcceptsAllPossibleAttributes() { // sets up all needed models and attributes on the assets // this test does not deal with custom fields - will be dealt with in separate cases @@ -109,7 +109,7 @@ final class BulkEditAssetsTest extends TestCase }); } - public function testBulkEditAssetsAcceptsAndUpdatesUnencryptedCustomFields(): void + public function testBulkEditAssetsAcceptsAndUpdatesUnencryptedCustomFields() { $this->markIncompleteIfMySQL('Custom Fields tests do not work on MySQL'); @@ -141,7 +141,7 @@ final class BulkEditAssetsTest extends TestCase }); } - public function testBulkEditAssetsAcceptsAndUpdatesEncryptedCustomFields(): void + public function testBulkEditAssetsAcceptsAndUpdatesEncryptedCustomFields() { $this->markIncompleteIfMySQL('Custom Fields tests do not work on MySQL'); @@ -165,7 +165,7 @@ final class BulkEditAssetsTest extends TestCase }); } - public function testBulkEditAssetsRequiresAdminUserToUpdateEncryptedCustomFields(): void + public function testBulkEditAssetsRequiresAdminUserToUpdateEncryptedCustomFields() { $this->markIncompleteIfMySQL('Custom Fields tests do not work on mysql'); $edit_user = User::factory()->editAssets()->create(); diff --git a/tests/Feature/Assets/Ui/CloneAssetTest.php b/tests/Feature/Assets/Ui/CloneAssetTest.php index ebf7cd6572..7247276005 100644 --- a/tests/Feature/Assets/Ui/CloneAssetTest.php +++ b/tests/Feature/Assets/Ui/CloneAssetTest.php @@ -8,7 +8,7 @@ use Tests\TestCase; final class CloneAssetTest extends TestCase { - public function testPermissionRequiredToCreateAssetModel(): void + public function testPermissionRequiredToCreateAssetModel() { $asset = Asset::factory()->create(); $this->actingAs(User::factory()->create()) @@ -24,7 +24,7 @@ final class CloneAssetTest extends TestCase $response->assertStatus(200); } - public function testAssetCanBeCloned(): void + public function testAssetCanBeCloned() { $asset_to_clone = Asset::factory()->create(['name'=>'Asset to clone']); $this->actingAs(User::factory()->createAssets()->create()) diff --git a/tests/Feature/Assets/Ui/EditAssetTest.php b/tests/Feature/Assets/Ui/EditAssetTest.php index 6561df4722..bb2eb8de4b 100644 --- a/tests/Feature/Assets/Ui/EditAssetTest.php +++ b/tests/Feature/Assets/Ui/EditAssetTest.php @@ -11,7 +11,7 @@ use Tests\TestCase; final class EditAssetTest extends TestCase { - public function testPermissionRequiredToViewLicense(): void + public function testPermissionRequiredToViewLicense() { $asset = Asset::factory()->create(); $this->actingAs(User::factory()->create()) @@ -27,7 +27,7 @@ final class EditAssetTest extends TestCase $response->assertStatus(200); } - public function testAssetEditPostIsRedirectedIfRedirectSelectionIsIndex(): void + public function testAssetEditPostIsRedirectedIfRedirectSelectionIsIndex() { $asset = Asset::factory()->assignedToUser()->create(); @@ -45,7 +45,7 @@ final class EditAssetTest extends TestCase ->assertRedirect(route('hardware.index')); $this->assertDatabaseHas('assets', ['asset_tag' => 'New Asset Tag']); } - public function testAssetEditPostIsRedirectedIfRedirectSelectionIsItem(): void + public function testAssetEditPostIsRedirectedIfRedirectSelectionIsItem() { $asset = Asset::factory()->create(); diff --git a/tests/Feature/Categories/Api/CreateCategoriesTest.php b/tests/Feature/Categories/Api/CreateCategoriesTest.php index f5c0d6ac69..8c9b47992b 100644 --- a/tests/Feature/Categories/Api/CreateCategoriesTest.php +++ b/tests/Feature/Categories/Api/CreateCategoriesTest.php @@ -13,14 +13,14 @@ final class CreateCategoriesTest extends TestCase { - public function testRequiresPermissionToCreateCategory(): void + public function testRequiresPermissionToCreateCategory() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.categories.store')) ->assertForbidden(); } - public function testCanCreateCategoryWithValidCategoryType(): void + public function testCanCreateCategoryWithValidCategoryType() { $response = $this->actingAsForApi(User::factory()->superuser()->create()) ->postJson(route('api.categories.store'), [ @@ -41,7 +41,7 @@ final class CreateCategoriesTest extends TestCase $this->assertEquals('accessory', $category->category_type); } - public function testCannotCreateCategoryWithoutCategoryType(): void + public function testCannotCreateCategoryWithoutCategoryType() { $response = $this->actingAsForApi(User::factory()->superuser()->create()) ->postJson(route('api.categories.store'), [ @@ -59,7 +59,7 @@ final class CreateCategoriesTest extends TestCase } - public function testCannotCreateCategoryWithInvalidCategoryType(): void + public function testCannotCreateCategoryWithInvalidCategoryType() { $this->actingAsForApi(User::factory()->superuser()->create()) ->postJson(route('api.categories.store'), [ diff --git a/tests/Feature/Categories/Api/IndexCategoriesTest.php b/tests/Feature/Categories/Api/IndexCategoriesTest.php index a763dbbec3..139ec12067 100644 --- a/tests/Feature/Categories/Api/IndexCategoriesTest.php +++ b/tests/Feature/Categories/Api/IndexCategoriesTest.php @@ -10,14 +10,14 @@ use Tests\TestCase; final class IndexCategoriesTest extends TestCase { - public function testViewingCategoryIndexRequiresPermission(): void + public function testViewingCategoryIndexRequiresPermission() { $this->actingAsForApi(User::factory()->create()) ->getJson(route('api.departments.index')) ->assertForbidden(); } - public function testCategoryIndexReturnsExpectedSearchResults(): void + public function testCategoryIndexReturnsExpectedSearchResults() { Category::factory()->count(10)->create(); Category::factory()->count(1)->forAssets()->create(['name' => 'My Test Category']); @@ -43,7 +43,7 @@ final class IndexCategoriesTest extends TestCase } - public function testCategoryIndexReturnsExpectedCategories(): void + public function testCategoryIndexReturnsExpectedCategories() { $this->markTestIncomplete('Not sure why the category factory is generating one more than expected here.'); Category::factory()->count(3)->create(); diff --git a/tests/Feature/Categories/Api/UpdateCategoriesTest.php b/tests/Feature/Categories/Api/UpdateCategoriesTest.php index 6b3bd76add..8a8923930b 100644 --- a/tests/Feature/Categories/Api/UpdateCategoriesTest.php +++ b/tests/Feature/Categories/Api/UpdateCategoriesTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class UpdateCategoriesTest extends TestCase { - public function testCanUpdateCategoryViaPatchWithoutCategoryType(): void + public function testCanUpdateCategoryViaPatchWithoutCategoryType() { $category = Category::factory()->create(); @@ -30,7 +30,7 @@ final class UpdateCategoriesTest extends TestCase } - public function testCannotUpdateCategoryViaPatchWithCategoryType(): void + public function testCannotUpdateCategoryViaPatchWithCategoryType() { $category = Category::factory()->create(); diff --git a/tests/Feature/Categories/Ui/CreateCategoriesTest.php b/tests/Feature/Categories/Ui/CreateCategoriesTest.php index 5deffbe206..4471c7647c 100644 --- a/tests/Feature/Categories/Ui/CreateCategoriesTest.php +++ b/tests/Feature/Categories/Ui/CreateCategoriesTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class CreateCategoriesTest extends TestCase { - public function testPermissionRequiredToCreateCategories(): void + public function testPermissionRequiredToCreateCategories() { $this->actingAs(User::factory()->create()) ->post(route('categories.store'), [ @@ -19,7 +19,7 @@ final class CreateCategoriesTest extends TestCase ->assertForbidden(); } - public function testUserCanCreateCategories(): void + public function testUserCanCreateCategories() { $this->assertFalse(Category::where('name', 'Test Category')->exists()); @@ -33,7 +33,7 @@ final class CreateCategoriesTest extends TestCase $this->assertTrue(Category::where('name', 'Test Category')->exists()); } - public function testUserCannotCreateCategoriesWithInvalidType(): void + public function testUserCannotCreateCategoriesWithInvalidType() { $this->assertFalse(Category::where('name', 'Test Category')->exists()); diff --git a/tests/Feature/Categories/Ui/IndexCategoriesTest.php b/tests/Feature/Categories/Ui/IndexCategoriesTest.php index 571e401b81..7f740f3328 100644 --- a/tests/Feature/Categories/Ui/IndexCategoriesTest.php +++ b/tests/Feature/Categories/Ui/IndexCategoriesTest.php @@ -7,14 +7,14 @@ use Tests\TestCase; final class IndexCategoriesTest extends TestCase { - public function testPermissionRequiredToViewCategoryList(): void + public function testPermissionRequiredToViewCategoryList() { $this->actingAs(User::factory()->create()) ->get(route('categories.index')) ->assertForbidden(); } - public function testUserCanListCategories(): void + public function testUserCanListCategories() { $this->actingAs(User::factory()->superuser()->create()) ->get(route('categories.index')) diff --git a/tests/Feature/Categories/Ui/UpdateCategoriesTest.php b/tests/Feature/Categories/Ui/UpdateCategoriesTest.php index 45e02a0a64..fd2e474462 100644 --- a/tests/Feature/Categories/Ui/UpdateCategoriesTest.php +++ b/tests/Feature/Categories/Ui/UpdateCategoriesTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class UpdateCategoriesTest extends TestCase { - public function testPermissionRequiredToStoreCategory(): void + public function testPermissionRequiredToStoreCategory() { $this->actingAs(User::factory()->create()) ->post(route('categories.store'), [ @@ -20,7 +20,7 @@ final class UpdateCategoriesTest extends TestCase ->assertForbidden(); } - public function testUserCanCreateCategories(): void + public function testUserCanCreateCategories() { $this->actingAs(User::factory()->superuser()->create()) ->post(route('categories.store'), [ @@ -34,7 +34,7 @@ final class UpdateCategoriesTest extends TestCase $this->assertTrue(Category::where('name', 'Test Category')->exists()); } - public function testUserCanEditAssetCategory(): void + public function testUserCanEditAssetCategory() { $category = Category::factory()->forAssets()->create(['name' => 'Test Category']); $this->assertTrue(Category::where('name', 'Test Category')->exists()); @@ -52,7 +52,7 @@ final class UpdateCategoriesTest extends TestCase } - public function testUserCanChangeCategoryTypeIfNoAssetsAssociated(): void + public function testUserCanChangeCategoryTypeIfNoAssetsAssociated() { $category = Category::factory()->forAssets()->create(['name' => 'Test Category']); $this->assertTrue(Category::where('name', 'Test Category')->exists()); @@ -72,7 +72,7 @@ final class UpdateCategoriesTest extends TestCase } - public function testUserCannotChangeCategoryTypeIfAssetsAreAssociated(): void + public function testUserCannotChangeCategoryTypeIfAssetsAreAssociated() { Asset::factory()->count(5)->laptopMbp()->create(); $category = Category::where('name', 'Laptops')->first(); diff --git a/tests/Feature/Checkins/Api/AssetCheckinTest.php b/tests/Feature/Checkins/Api/AssetCheckinTest.php index 1891a9d282..42f6834217 100644 --- a/tests/Feature/Checkins/Api/AssetCheckinTest.php +++ b/tests/Feature/Checkins/Api/AssetCheckinTest.php @@ -15,28 +15,28 @@ use Tests\TestCase; final class AssetCheckinTest extends TestCase { - public function testCheckingInAssetRequiresCorrectPermission(): void + public function testCheckingInAssetRequiresCorrectPermission() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.asset.checkin', Asset::factory()->assignedToUser()->create())) ->assertForbidden(); } - public function testCannotCheckInNonExistentAsset(): void + public function testCannotCheckInNonExistentAsset() { $this->actingAsForApi(User::factory()->checkinAssets()->create()) ->postJson(route('api.asset.checkin', ['id' => 'does-not-exist'])) ->assertStatusMessageIs('error'); } - public function testCannotCheckInAssetThatIsNotCheckedOut(): void + public function testCannotCheckInAssetThatIsNotCheckedOut() { $this->actingAsForApi(User::factory()->checkinAssets()->create()) ->postJson(route('api.asset.checkin', Asset::factory()->create()->id)) ->assertStatusMessageIs('error'); } - public function testAssetCanBeCheckedIn(): void + public function testAssetCanBeCheckedIn() { Event::fake([CheckoutableCheckedIn::class]); @@ -76,7 +76,7 @@ final class AssetCheckinTest extends TestCase }, 1); } - public function testLocationIsSetToRTDLocationByDefaultUponCheckin(): void + public function testLocationIsSetToRTDLocationByDefaultUponCheckin() { $rtdLocation = Location::factory()->create(); $asset = Asset::factory()->assignedToUser()->create([ @@ -90,7 +90,7 @@ final class AssetCheckinTest extends TestCase $this->assertTrue($asset->refresh()->location()->is($rtdLocation)); } - public function testDefaultLocationCanBeUpdatedUponCheckin(): void + public function testDefaultLocationCanBeUpdatedUponCheckin() { $location = Location::factory()->create(); $asset = Asset::factory()->assignedToUser()->create(); @@ -104,7 +104,7 @@ final class AssetCheckinTest extends TestCase $this->assertTrue($asset->refresh()->defaultLoc()->is($location)); } - public function testAssetsLicenseSeatsAreClearedUponCheckin(): void + public function testAssetsLicenseSeatsAreClearedUponCheckin() { $asset = Asset::factory()->assignedToUser()->create(); LicenseSeat::factory()->assignedToUser()->for($asset)->create(); @@ -117,7 +117,7 @@ final class AssetCheckinTest extends TestCase $this->assertNull($asset->refresh()->licenseseats->first()->assigned_to); } - public function testLegacyLocationValuesSetToZeroAreUpdated(): void + public function testLegacyLocationValuesSetToZeroAreUpdated() { $asset = Asset::factory()->canBeInvalidUponCreation()->assignedToUser()->create([ 'rtd_location_id' => 0, @@ -131,7 +131,7 @@ final class AssetCheckinTest extends TestCase $this->assertEquals($asset->location_id, $asset->rtd_location_id); } - public function testPendingCheckoutAcceptancesAreClearedUponCheckin(): void + public function testPendingCheckoutAcceptancesAreClearedUponCheckin() { $asset = Asset::factory()->assignedToUser()->create(); @@ -143,7 +143,7 @@ final class AssetCheckinTest extends TestCase $this->assertFalse($acceptance->exists(), 'Acceptance was not deleted'); } - public function testCheckinTimeAndActionLogNoteCanBeSet(): void + public function testCheckinTimeAndActionLogNoteCanBeSet() { Event::fake(); diff --git a/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php b/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php index 0eb63b4781..9084275d98 100644 --- a/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php +++ b/tests/Feature/Checkins/Ui/AccessoryCheckinTest.php @@ -12,7 +12,7 @@ use Tests\TestCase; final class AccessoryCheckinTest extends TestCase { - public function testCheckingInAccessoryRequiresCorrectPermission(): void + public function testCheckingInAccessoryRequiresCorrectPermission() { $accessory = Accessory::factory()->checkedOutToUser()->create(); @@ -21,7 +21,7 @@ final class AccessoryCheckinTest extends TestCase ->assertForbidden(); } - public function testAccessoryCanBeCheckedIn(): void + public function testAccessoryCanBeCheckedIn() { Event::fake([CheckoutableCheckedIn::class]); @@ -38,7 +38,7 @@ final class AccessoryCheckinTest extends TestCase Event::assertDispatched(CheckoutableCheckedIn::class, 1); } - public function testEmailSentToUserIfSettingEnabled(): void + public function testEmailSentToUserIfSettingEnabled() { Notification::fake(); @@ -62,7 +62,7 @@ final class AccessoryCheckinTest extends TestCase ); } - public function testEmailNotSentToUserIfSettingDisabled(): void + public function testEmailNotSentToUserIfSettingDisabled() { Notification::fake(); diff --git a/tests/Feature/Checkins/Ui/AssetCheckinTest.php b/tests/Feature/Checkins/Ui/AssetCheckinTest.php index fde1071296..1f6c20903a 100644 --- a/tests/Feature/Checkins/Ui/AssetCheckinTest.php +++ b/tests/Feature/Checkins/Ui/AssetCheckinTest.php @@ -15,7 +15,7 @@ use Tests\TestCase; final class AssetCheckinTest extends TestCase { - public function testCheckingInAssetRequiresCorrectPermission(): void + public function testCheckingInAssetRequiresCorrectPermission() { $this->actingAs(User::factory()->create()) ->post(route('hardware.checkin.store', [ @@ -24,7 +24,7 @@ final class AssetCheckinTest extends TestCase ->assertForbidden(); } - public function testCannotCheckInAssetThatIsNotCheckedOut(): void + public function testCannotCheckInAssetThatIsNotCheckedOut() { $this->actingAs(User::factory()->checkinAssets()->create()) ->post(route('hardware.checkin.store', ['assetId' => Asset::factory()->create()->id])) @@ -33,7 +33,7 @@ final class AssetCheckinTest extends TestCase ->assertRedirect(route('hardware.index')); } - public function testCannotStoreAssetCheckinThatIsNotCheckedOut(): void + public function testCannotStoreAssetCheckinThatIsNotCheckedOut() { $this->actingAs(User::factory()->checkinAssets()->create()) ->get(route('hardware.checkin.store', ['assetId' => Asset::factory()->create()->id])) @@ -42,7 +42,7 @@ final class AssetCheckinTest extends TestCase ->assertRedirect(route('hardware.index')); } - public function testAssetCanBeCheckedIn(): void + public function testAssetCanBeCheckedIn() { Event::fake([CheckoutableCheckedIn::class]); @@ -85,7 +85,7 @@ final class AssetCheckinTest extends TestCase }, 1); } - public function testLocationIsSetToRTDLocationByDefaultUponCheckin(): void + public function testLocationIsSetToRTDLocationByDefaultUponCheckin() { $rtdLocation = Location::factory()->create(); $asset = Asset::factory()->assignedToUser()->create([ @@ -99,7 +99,7 @@ final class AssetCheckinTest extends TestCase $this->assertTrue($asset->refresh()->location()->is($rtdLocation)); } - public function testDefaultLocationCanBeUpdatedUponCheckin(): void + public function testDefaultLocationCanBeUpdatedUponCheckin() { $location = Location::factory()->create(); $asset = Asset::factory()->assignedToUser()->create(); @@ -113,7 +113,7 @@ final class AssetCheckinTest extends TestCase $this->assertTrue($asset->refresh()->defaultLoc()->is($location)); } - public function testAssetsLicenseSeatsAreClearedUponCheckin(): void + public function testAssetsLicenseSeatsAreClearedUponCheckin() { $asset = Asset::factory()->assignedToUser()->create(); LicenseSeat::factory()->assignedToUser()->for($asset)->create(); @@ -126,7 +126,7 @@ final class AssetCheckinTest extends TestCase $this->assertNull($asset->refresh()->licenseseats->first()->assigned_to); } - public function testLegacyLocationValuesSetToZeroAreUpdated(): void + public function testLegacyLocationValuesSetToZeroAreUpdated() { $asset = Asset::factory()->canBeInvalidUponCreation()->assignedToUser()->create([ 'rtd_location_id' => 0, @@ -140,7 +140,7 @@ final class AssetCheckinTest extends TestCase $this->assertEquals($asset->location_id, $asset->rtd_location_id); } - public function testPendingCheckoutAcceptancesAreClearedUponCheckin(): void + public function testPendingCheckoutAcceptancesAreClearedUponCheckin() { $asset = Asset::factory()->assignedToUser()->create(); @@ -152,7 +152,7 @@ final class AssetCheckinTest extends TestCase $this->assertFalse($acceptance->exists(), 'Acceptance was not deleted'); } - public function testCheckinTimeAndActionLogNoteCanBeSet(): void + public function testCheckinTimeAndActionLogNoteCanBeSet() { Event::fake([CheckoutableCheckedIn::class]); @@ -170,7 +170,7 @@ final class AssetCheckinTest extends TestCase }, 1); } - public function testAssetCheckinPageIsRedirectedIfModelIsInvalid(): void + public function testAssetCheckinPageIsRedirectedIfModelIsInvalid() { $asset = Asset::factory()->assignedToUser()->create(); @@ -184,7 +184,7 @@ final class AssetCheckinTest extends TestCase ->assertRedirect(route('hardware.show',['hardware' => $asset->id])); } - public function testAssetCheckinPagePostIsRedirectedIfModelIsInvalid(): void + public function testAssetCheckinPagePostIsRedirectedIfModelIsInvalid() { $asset = Asset::factory()->assignedToUser()->create(); $asset->model_id = 0; @@ -197,7 +197,7 @@ final class AssetCheckinTest extends TestCase ->assertRedirect(route('hardware.show', ['hardware' => $asset->id])); } - public function testAssetCheckinPagePostIsRedirectedIfRedirectSelectionIsIndex(): void + public function testAssetCheckinPagePostIsRedirectedIfRedirectSelectionIsIndex() { $asset = Asset::factory()->assignedToUser()->create(); @@ -210,7 +210,7 @@ final class AssetCheckinTest extends TestCase ->assertRedirect(route('hardware.index')); } - public function testAssetCheckinPagePostIsRedirectedIfRedirectSelectionIsItem(): void + public function testAssetCheckinPagePostIsRedirectedIfRedirectSelectionIsItem() { $asset = Asset::factory()->assignedToUser()->create(); diff --git a/tests/Feature/Checkins/Ui/ComponentCheckinTest.php b/tests/Feature/Checkins/Ui/ComponentCheckinTest.php index a665d13ff2..721c00bf93 100644 --- a/tests/Feature/Checkins/Ui/ComponentCheckinTest.php +++ b/tests/Feature/Checkins/Ui/ComponentCheckinTest.php @@ -8,7 +8,7 @@ use Tests\TestCase; final class ComponentCheckinTest extends TestCase { - public function testCheckingInComponentRequiresCorrectPermission(): void + public function testCheckingInComponentRequiresCorrectPermission() { $this->actingAs(User::factory()->create()) ->post(route('components.checkin.store', [ @@ -18,7 +18,7 @@ final class ComponentCheckinTest extends TestCase } - public function testComponentCheckinPagePostIsRedirectedIfRedirectSelectionIsIndex(): void + public function testComponentCheckinPagePostIsRedirectedIfRedirectSelectionIsIndex() { $component = Component::factory()->checkedOutToAsset()->create(); @@ -32,7 +32,7 @@ final class ComponentCheckinTest extends TestCase ->assertRedirect(route('components.index')); } - public function testComponentCheckinPagePostIsRedirectedIfRedirectSelectionIsItem(): void + public function testComponentCheckinPagePostIsRedirectedIfRedirectSelectionIsItem() { $component = Component::factory()->checkedOutToAsset()->create(); diff --git a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php b/tests/Feature/Checkins/Ui/LicenseCheckinTest.php index 248663860b..4d93114e0f 100644 --- a/tests/Feature/Checkins/Ui/LicenseCheckinTest.php +++ b/tests/Feature/Checkins/Ui/LicenseCheckinTest.php @@ -8,7 +8,7 @@ use Tests\TestCase; final class LicenseCheckinTest extends TestCase { - public function testCheckingInLicenseRequiresCorrectPermission(): void + public function testCheckingInLicenseRequiresCorrectPermission() { $this->actingAs(User::factory()->create()) ->post(route('licenses.checkin.save', [ diff --git a/tests/Feature/CheckoutAcceptances/Ui/AccessoryAcceptanceTest.php b/tests/Feature/CheckoutAcceptances/Ui/AccessoryAcceptanceTest.php index de7c0af6cb..99686d898d 100644 --- a/tests/Feature/CheckoutAcceptances/Ui/AccessoryAcceptanceTest.php +++ b/tests/Feature/CheckoutAcceptances/Ui/AccessoryAcceptanceTest.php @@ -16,7 +16,7 @@ final class AccessoryAcceptanceTest extends TestCase /** * This can be absorbed into a bigger test */ - public function testUsersNameIsIncludedInAccessoryAcceptedNotification(): void + public function testUsersNameIsIncludedInAccessoryAcceptedNotification() { Notification::fake(); @@ -49,7 +49,7 @@ final class AccessoryAcceptanceTest extends TestCase /** * This can be absorbed into a bigger test */ - public function testUsersNameIsIncludedInAccessoryDeclinedNotification(): void + public function testUsersNameIsIncludedInAccessoryDeclinedNotification() { Notification::fake(); @@ -79,7 +79,7 @@ final class AccessoryAcceptanceTest extends TestCase ); } - public function testUserIsNotAbleToAcceptAnAssetAssignedToADifferentUser(): void + public function testUserIsNotAbleToAcceptAnAssetAssignedToADifferentUser() { Notification::fake(); diff --git a/tests/Feature/Checkouts/Api/AccessoryCheckoutTest.php b/tests/Feature/Checkouts/Api/AccessoryCheckoutTest.php index 45c119de8e..bbebae56b0 100644 --- a/tests/Feature/Checkouts/Api/AccessoryCheckoutTest.php +++ b/tests/Feature/Checkouts/Api/AccessoryCheckoutTest.php @@ -11,14 +11,14 @@ use Tests\TestCase; final class AccessoryCheckoutTest extends TestCase { - public function testCheckingOutAccessoryRequiresCorrectPermission(): void + public function testCheckingOutAccessoryRequiresCorrectPermission() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.accessories.checkout', Accessory::factory()->create())) ->assertForbidden(); } - public function testValidationWhenCheckingOutAccessory(): void + public function testValidationWhenCheckingOutAccessory() { $this->actingAsForApi(User::factory()->checkoutAccessories()->create()) ->postJson(route('api.accessories.checkout', Accessory::factory()->create()), [ @@ -27,7 +27,7 @@ final class AccessoryCheckoutTest extends TestCase ->assertStatusMessageIs('error'); } - public function testAccessoryMustBeAvailableWhenCheckingOut(): void + public function testAccessoryMustBeAvailableWhenCheckingOut() { $this->actingAsForApi(User::factory()->checkoutAccessories()->create()) ->postJson(route('api.accessories.checkout', Accessory::factory()->withoutItemsRemaining()->create()), [ @@ -58,7 +58,7 @@ final class AccessoryCheckoutTest extends TestCase ->json(); } - public function testAccessoryCanBeCheckedOutWithoutQty(): void + public function testAccessoryCanBeCheckedOutWithoutQty() { $accessory = Accessory::factory()->create(); $user = User::factory()->create(); @@ -90,7 +90,7 @@ final class AccessoryCheckoutTest extends TestCase ); } - public function testAccessoryCanBeCheckedOutWithQty(): void + public function testAccessoryCanBeCheckedOutWithQty() { $accessory = Accessory::factory()->create(['qty' => 20]); $user = User::factory()->create(); @@ -124,7 +124,7 @@ final class AccessoryCheckoutTest extends TestCase ); } - public function testAccessoryCannotBeCheckedOutToInvalidUser(): void + public function testAccessoryCannotBeCheckedOutToInvalidUser() { $accessory = Accessory::factory()->create(); $user = User::factory()->create(); @@ -143,7 +143,7 @@ final class AccessoryCheckoutTest extends TestCase $this->assertFalse($accessory->checkouts()->where('assigned_type', User::class)->where('assigned_to', $user->id)->count() > 0); } - public function testUserSentNotificationUponCheckout(): void + public function testUserSentNotificationUponCheckout() { Notification::fake(); @@ -159,7 +159,7 @@ final class AccessoryCheckoutTest extends TestCase Notification::assertSentTo($user, CheckoutAccessoryNotification::class); } - public function testActionLogCreatedUponCheckout(): void + public function testActionLogCreatedUponCheckout() { $accessory = Accessory::factory()->create(); $actor = User::factory()->checkoutAccessories()->create(); diff --git a/tests/Feature/Checkouts/Api/AssetCheckoutTest.php b/tests/Feature/Checkouts/Api/AssetCheckoutTest.php index 3ea610d01d..8f8d1a9c74 100644 --- a/tests/Feature/Checkouts/Api/AssetCheckoutTest.php +++ b/tests/Feature/Checkouts/Api/AssetCheckoutTest.php @@ -21,7 +21,7 @@ final class AssetCheckoutTest extends TestCase Event::fake([CheckoutableCheckedOut::class]); } - public function testCheckingOutAssetRequiresCorrectPermission(): void + public function testCheckingOutAssetRequiresCorrectPermission() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.asset.checkout', Asset::factory()->create()), [ @@ -31,7 +31,7 @@ final class AssetCheckoutTest extends TestCase ->assertForbidden(); } - public function testNonExistentAssetCannotBeCheckedOut(): void + public function testNonExistentAssetCannotBeCheckedOut() { $this->actingAsForApi(User::factory()->checkoutAssets()->create()) ->postJson(route('api.asset.checkout', 1000), [ @@ -41,7 +41,7 @@ final class AssetCheckoutTest extends TestCase ->assertStatusMessageIs('error'); } - public function testAssetNotAvailableForCheckoutCannotBeCheckedOut(): void + public function testAssetNotAvailableForCheckoutCannotBeCheckedOut() { $assetAlreadyCheckedOut = Asset::factory()->assignedToUser()->create(); @@ -53,7 +53,7 @@ final class AssetCheckoutTest extends TestCase ->assertStatusMessageIs('error'); } - public function testAssetCannotBeCheckedOutToItself(): void + public function testAssetCannotBeCheckedOutToItself() { $asset = Asset::factory()->create(); @@ -65,7 +65,7 @@ final class AssetCheckoutTest extends TestCase ->assertStatusMessageIs('error'); } - public function testValidationWhenCheckingOutAsset(): void + public function testValidationWhenCheckingOutAsset() { $this->actingAsForApi(User::factory()->checkoutAssets()->create()) ->postJson(route('api.asset.checkout', Asset::factory()->create()), []) @@ -74,7 +74,7 @@ final class AssetCheckoutTest extends TestCase Event::assertNotDispatched(CheckoutableCheckedOut::class); } - public function testCannotCheckoutAcrossCompaniesWhenFullCompanySupportEnabled(): void + public function testCannotCheckoutAcrossCompaniesWhenFullCompanySupportEnabled() { $this->markTestIncomplete('This is not implemented'); } @@ -150,7 +150,7 @@ final class AssetCheckoutTest extends TestCase } #[DataProvider('checkoutTargets')] - public function testAssetCanBeCheckedOut($data): void + public function testAssetCanBeCheckedOut($data) { ['checkout_type' => $type, 'target' => $target, 'expected_location' => $expectedLocation] = $data(); @@ -192,12 +192,12 @@ final class AssetCheckoutTest extends TestCase }); } - public function testLicenseSeatsAreAssignedToUserUponCheckout(): void + public function testLicenseSeatsAreAssignedToUserUponCheckout() { $this->markTestIncomplete('This is not implemented'); } - public function testLastCheckoutUsesCurrentDateIfNotProvided(): void + public function testLastCheckoutUsesCurrentDateIfNotProvided() { $asset = Asset::factory()->create(['last_checkout' => now()->subMonth()]); diff --git a/tests/Feature/Checkouts/Api/ConsumableCheckoutTest.php b/tests/Feature/Checkouts/Api/ConsumableCheckoutTest.php index 398f618239..915fba056e 100644 --- a/tests/Feature/Checkouts/Api/ConsumableCheckoutTest.php +++ b/tests/Feature/Checkouts/Api/ConsumableCheckoutTest.php @@ -11,14 +11,14 @@ use Tests\TestCase; final class ConsumableCheckoutTest extends TestCase { - public function testCheckingOutConsumableRequiresCorrectPermission(): void + public function testCheckingOutConsumableRequiresCorrectPermission() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.consumables.checkout', Consumable::factory()->create())) ->assertForbidden(); } - public function testValidationWhenCheckingOutConsumable(): void + public function testValidationWhenCheckingOutConsumable() { $this->actingAsForApi(User::factory()->checkoutConsumables()->create()) ->postJson(route('api.consumables.checkout', Consumable::factory()->create()), [ @@ -27,7 +27,7 @@ final class ConsumableCheckoutTest extends TestCase ->assertStatusMessageIs('error'); } - public function testConsumableMustBeAvailableWhenCheckingOut(): void + public function testConsumableMustBeAvailableWhenCheckingOut() { $this->actingAsForApi(User::factory()->checkoutConsumables()->create()) ->postJson(route('api.consumables.checkout', Consumable::factory()->withoutItemsRemaining()->create()), [ @@ -36,7 +36,7 @@ final class ConsumableCheckoutTest extends TestCase ->assertStatusMessageIs('error'); } - public function testConsumableCanBeCheckedOut(): void + public function testConsumableCanBeCheckedOut() { $consumable = Consumable::factory()->create(); $user = User::factory()->create(); @@ -49,7 +49,7 @@ final class ConsumableCheckoutTest extends TestCase $this->assertTrue($user->consumables->contains($consumable)); } - public function testUserSentNotificationUponCheckout(): void + public function testUserSentNotificationUponCheckout() { Notification::fake(); @@ -65,7 +65,7 @@ final class ConsumableCheckoutTest extends TestCase Notification::assertSentTo($user, CheckoutConsumableNotification::class); } - public function testActionLogCreatedUponCheckout(): void + public function testActionLogCreatedUponCheckout() {$consumable = Consumable::factory()->create(); $actor = User::factory()->checkoutConsumables()->create(); $user = User::factory()->create(); diff --git a/tests/Feature/Checkouts/Ui/AccessoryCheckoutTest.php b/tests/Feature/Checkouts/Ui/AccessoryCheckoutTest.php index 47e057fdfd..222802079f 100644 --- a/tests/Feature/Checkouts/Ui/AccessoryCheckoutTest.php +++ b/tests/Feature/Checkouts/Ui/AccessoryCheckoutTest.php @@ -13,14 +13,14 @@ use Tests\TestCase; final class AccessoryCheckoutTest extends TestCase { - public function testCheckingOutAccessoryRequiresCorrectPermission(): void + public function testCheckingOutAccessoryRequiresCorrectPermission() { $this->actingAs(User::factory()->create()) ->post(route('accessories.checkout.store', Accessory::factory()->create())) ->assertForbidden(); } - public function testValidationWhenCheckingOutAccessory(): void + public function testValidationWhenCheckingOutAccessory() { $accessory = Accessory::factory()->create(); $response = $this->actingAs(User::factory()->superuser()->create()) @@ -35,7 +35,7 @@ final class AccessoryCheckoutTest extends TestCase $this->followRedirects($response)->assertSee(trans('general.error')); } - public function testAccessoryMustHaveAvailableItemsForCheckoutWhenCheckingOut(): void + public function testAccessoryMustHaveAvailableItemsForCheckoutWhenCheckingOut() { $accessory = Accessory::factory()->withoutItemsRemaining()->create(); @@ -52,7 +52,7 @@ final class AccessoryCheckoutTest extends TestCase $this->followRedirects($response)->assertSee(trans('general.error')); } - public function testAccessoryCanBeCheckedOutWithoutQuantity(): void + public function testAccessoryCanBeCheckedOutWithoutQuantity() { $accessory = Accessory::factory()->create(); $user = User::factory()->create(); @@ -76,7 +76,7 @@ final class AccessoryCheckoutTest extends TestCase ]); } - public function testAccessoryCanBeCheckedOutWithQuantity(): void + public function testAccessoryCanBeCheckedOutWithQuantity() { $accessory = Accessory::factory()->create(['qty'=>5]); $user = User::factory()->create(); @@ -102,7 +102,7 @@ final class AccessoryCheckoutTest extends TestCase ]); } - public function testAccessoryCanBeCheckedOutToLocationWithQuantity(): void + public function testAccessoryCanBeCheckedOutToLocationWithQuantity() { $accessory = Accessory::factory()->create(['qty'=>5]); $location = Location::factory()->create(); @@ -128,7 +128,7 @@ final class AccessoryCheckoutTest extends TestCase ]); } - public function testAccessoryCanBeCheckedOutToAssetWithQuantity(): void + public function testAccessoryCanBeCheckedOutToAssetWithQuantity() { $accessory = Accessory::factory()->create(['qty'=>5]); $asset = Asset::factory()->create(); @@ -154,7 +154,7 @@ final class AccessoryCheckoutTest extends TestCase ]); } - public function testUserSentNotificationUponCheckout(): void + public function testUserSentNotificationUponCheckout() { Notification::fake(); @@ -171,7 +171,7 @@ final class AccessoryCheckoutTest extends TestCase Notification::assertSentTo($user, CheckoutAccessoryNotification::class); } - public function testActionLogCreatedUponCheckout(): void + public function testActionLogCreatedUponCheckout() { $accessory = Accessory::factory()->create(); $actor = User::factory()->checkoutAccessories()->create(); @@ -200,7 +200,7 @@ final class AccessoryCheckoutTest extends TestCase ); } - public function testAccessoryCheckoutPagePostIsRedirectedIfRedirectSelectionIsIndex(): void + public function testAccessoryCheckoutPagePostIsRedirectedIfRedirectSelectionIsIndex() { $accessory = Accessory::factory()->create(); @@ -216,7 +216,7 @@ final class AccessoryCheckoutTest extends TestCase ->assertRedirect(route('accessories.index')); } - public function testAccessoryCheckoutPagePostIsRedirectedIfRedirectSelectionIsItem(): void + public function testAccessoryCheckoutPagePostIsRedirectedIfRedirectSelectionIsItem() { $accessory = Accessory::factory()->create(); @@ -233,7 +233,7 @@ final class AccessoryCheckoutTest extends TestCase ->assertRedirect(route('accessories.show', ['accessory' => $accessory->id])); } - public function testAccessoryCheckoutPagePostIsRedirectedIfRedirectSelectionIsTarget(): void + public function testAccessoryCheckoutPagePostIsRedirectedIfRedirectSelectionIsTarget() { $user = User::factory()->create(); $accessory = Accessory::factory()->create(); diff --git a/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php b/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php index 64ddd30cf7..21be6e35b8 100644 --- a/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php +++ b/tests/Feature/Checkouts/Ui/AssetCheckoutTest.php @@ -24,7 +24,7 @@ final class AssetCheckoutTest extends TestCase Event::fake([CheckoutableCheckedOut::class]); } - public function testCheckingOutAssetRequiresCorrectPermission(): void + public function testCheckingOutAssetRequiresCorrectPermission() { $this->actingAs(User::factory()->create()) ->post(route('hardware.checkout.store', Asset::factory()->create()), [ @@ -34,7 +34,7 @@ final class AssetCheckoutTest extends TestCase ->assertForbidden(); } - public function testNonExistentAssetCannotBeCheckedOut(): void + public function testNonExistentAssetCannotBeCheckedOut() { $this->actingAs(User::factory()->checkoutAssets()->create()) ->post(route('hardware.checkout.store', 1000), [ @@ -48,7 +48,7 @@ final class AssetCheckoutTest extends TestCase Event::assertNotDispatched(CheckoutableCheckedOut::class); } - public function testAssetNotAvailableForCheckoutCannotBeCheckedOut(): void + public function testAssetNotAvailableForCheckoutCannotBeCheckedOut() { $assetAlreadyCheckedOut = Asset::factory()->assignedToUser()->create(); @@ -63,7 +63,7 @@ final class AssetCheckoutTest extends TestCase Event::assertNotDispatched(CheckoutableCheckedOut::class); } - public function testAssetCannotBeCheckedOutToItself(): void + public function testAssetCannotBeCheckedOutToItself() { $asset = Asset::factory()->create(); @@ -77,7 +77,7 @@ final class AssetCheckoutTest extends TestCase Event::assertNotDispatched(CheckoutableCheckedOut::class); } - public function testValidationWhenCheckingOutAsset(): void + public function testValidationWhenCheckingOutAsset() { $this->actingAs(User::factory()->create()) ->post(route('hardware.checkout.store', Asset::factory()->create()), [ @@ -98,7 +98,7 @@ final class AssetCheckoutTest extends TestCase Event::assertNotDispatched(CheckoutableCheckedOut::class); } - public function testCannotCheckoutAcrossCompaniesWhenFullCompanySupportEnabled(): void + public function testCannotCheckoutAcrossCompaniesWhenFullCompanySupportEnabled() { $this->settings->enableMultipleFullCompanySupport(); @@ -169,7 +169,7 @@ final class AssetCheckoutTest extends TestCase } #[DataProvider('checkoutTargets')] - public function testAssetCanBeCheckedOut($data): void + public function testAssetCanBeCheckedOut($data) { ['checkout_type' => $type, 'target' => $target, 'expected_location' => $expectedLocation] = $data(); @@ -207,7 +207,7 @@ final class AssetCheckoutTest extends TestCase }); } - public function testLicenseSeatsAreAssignedToUserUponCheckout(): void + public function testLicenseSeatsAreAssignedToUserUponCheckout() { $asset = Asset::factory()->create(); $seat = LicenseSeat::factory()->assignedToAsset($asset)->create(); @@ -224,7 +224,7 @@ final class AssetCheckoutTest extends TestCase $this->assertTrue($user->fresh()->licenses->contains($seat->license)); } - public function testLastCheckoutUsesCurrentDateIfNotProvided(): void + public function testLastCheckoutUsesCurrentDateIfNotProvided() { $asset = Asset::factory()->create(['last_checkout' => now()->subMonth()]); @@ -239,7 +239,7 @@ final class AssetCheckoutTest extends TestCase $this->assertTrue(Carbon::parse($asset->last_checkout)->diffInSeconds(now()) < 2); } - public function testAssetCheckoutPageIsRedirectedIfModelIsInvalid(): void + public function testAssetCheckoutPageIsRedirectedIfModelIsInvalid() { $asset = Asset::factory()->create(); @@ -253,7 +253,7 @@ final class AssetCheckoutTest extends TestCase ->assertRedirect(route('hardware.show',['hardware' => $asset->id])); } - public function testAssetCheckoutPagePostIsRedirectedIfRedirectSelectionIsIndex(): void + public function testAssetCheckoutPagePostIsRedirectedIfRedirectSelectionIsIndex() { $asset = Asset::factory()->create(); @@ -268,7 +268,7 @@ final class AssetCheckoutTest extends TestCase ->assertRedirect(route('hardware.index')); } - public function testAssetCheckoutPagePostIsRedirectedIfRedirectSelectionIsItem(): void + public function testAssetCheckoutPagePostIsRedirectedIfRedirectSelectionIsItem() { $asset = Asset::factory()->create(); @@ -284,7 +284,7 @@ final class AssetCheckoutTest extends TestCase ->assertRedirect(route('hardware.show', ['hardware' => $asset->id])); } - public function testAssetCheckoutPagePostIsRedirectedIfRedirectSelectionIsUserTarget(): void + public function testAssetCheckoutPagePostIsRedirectedIfRedirectSelectionIsUserTarget() { $user = User::factory()->create(); $asset = Asset::factory()->create(); @@ -301,7 +301,7 @@ final class AssetCheckoutTest extends TestCase ->assertRedirect(route('users.show', ['user' => $user])); } - public function testAssetCheckoutPagePostIsRedirectedIfRedirectSelectionIsAssetTarget(): void + public function testAssetCheckoutPagePostIsRedirectedIfRedirectSelectionIsAssetTarget() { $target = Asset::factory()->create(); $asset = Asset::factory()->create(); @@ -318,7 +318,7 @@ final class AssetCheckoutTest extends TestCase ->assertRedirect(route('hardware.show', ['hardware' => $target])); } - public function testAssetCheckoutPagePostIsRedirectedIfRedirectSelectionIsLocationTarget(): void + public function testAssetCheckoutPagePostIsRedirectedIfRedirectSelectionIsLocationTarget() { $target = Location::factory()->create(); $asset = Asset::factory()->create(); diff --git a/tests/Feature/Checkouts/Ui/ComponentsCheckoutTest.php b/tests/Feature/Checkouts/Ui/ComponentsCheckoutTest.php index 5f8e8d6f3e..ab79388677 100644 --- a/tests/Feature/Checkouts/Ui/ComponentsCheckoutTest.php +++ b/tests/Feature/Checkouts/Ui/ComponentsCheckoutTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class ComponentsCheckoutTest extends TestCase { - public function testCheckingOutComponentRequiresCorrectPermission(): void + public function testCheckingOutComponentRequiresCorrectPermission() { $this->actingAs(User::factory()->create()) ->post(route('components.checkout.store', [ @@ -18,7 +18,7 @@ final class ComponentsCheckoutTest extends TestCase ->assertForbidden(); } - public function testComponentCheckoutPagePostIsRedirectedIfRedirectSelectionIsIndex(): void + public function testComponentCheckoutPagePostIsRedirectedIfRedirectSelectionIsIndex() { $component = Component::factory()->create(); @@ -33,7 +33,7 @@ final class ComponentsCheckoutTest extends TestCase ->assertRedirect(route('components.index')); } - public function testComponentCheckoutPagePostIsRedirectedIfRedirectSelectionIsItem(): void + public function testComponentCheckoutPagePostIsRedirectedIfRedirectSelectionIsItem() { $component = Component::factory()->create(); @@ -48,7 +48,7 @@ final class ComponentsCheckoutTest extends TestCase ->assertRedirect(route('components.show', ['component' => $component->id])); } - public function testComponentCheckoutPagePostIsRedirectedIfRedirectSelectionIsTarget(): void + public function testComponentCheckoutPagePostIsRedirectedIfRedirectSelectionIsTarget() { $asset = Asset::factory()->create(); $component = Component::factory()->create(); diff --git a/tests/Feature/Checkouts/Ui/ConsumableCheckoutTest.php b/tests/Feature/Checkouts/Ui/ConsumableCheckoutTest.php index e08d101a08..f85031ccd3 100644 --- a/tests/Feature/Checkouts/Ui/ConsumableCheckoutTest.php +++ b/tests/Feature/Checkouts/Ui/ConsumableCheckoutTest.php @@ -13,14 +13,14 @@ use Tests\TestCase; final class ConsumableCheckoutTest extends TestCase { - public function testCheckingOutConsumableRequiresCorrectPermission(): void + public function testCheckingOutConsumableRequiresCorrectPermission() { $this->actingAs(User::factory()->create()) ->post(route('consumables.checkout.store', Consumable::factory()->create())) ->assertForbidden(); } - public function testValidationWhenCheckingOutConsumable(): void + public function testValidationWhenCheckingOutConsumable() { $this->actingAs(User::factory()->checkoutConsumables()->create()) ->post(route('consumables.checkout.store', Consumable::factory()->create()), [ @@ -29,7 +29,7 @@ final class ConsumableCheckoutTest extends TestCase ->assertSessionHas('error'); } - public function testConsumableMustBeAvailableWhenCheckingOut(): void + public function testConsumableMustBeAvailableWhenCheckingOut() { $this->actingAs(User::factory()->checkoutConsumables()->create()) ->post(route('consumables.checkout.store', Consumable::factory()->withoutItemsRemaining()->create()), [ @@ -38,7 +38,7 @@ final class ConsumableCheckoutTest extends TestCase ->assertSessionHas('error'); } - public function testConsumableCanBeCheckedOut(): void + public function testConsumableCanBeCheckedOut() { $consumable = Consumable::factory()->create(); $user = User::factory()->create(); @@ -51,7 +51,7 @@ final class ConsumableCheckoutTest extends TestCase $this->assertTrue($user->consumables->contains($consumable)); } - public function testUserSentNotificationUponCheckout(): void + public function testUserSentNotificationUponCheckout() { Notification::fake(); @@ -66,7 +66,7 @@ final class ConsumableCheckoutTest extends TestCase Notification::assertSentTo($user, CheckoutConsumableNotification::class); } - public function testActionLogCreatedUponCheckout(): void + public function testActionLogCreatedUponCheckout() { $consumable = Consumable::factory()->create(); $actor = User::factory()->checkoutConsumables()->create(); @@ -93,7 +93,7 @@ final class ConsumableCheckoutTest extends TestCase ); } - public function testConsumableCheckoutPagePostIsRedirectedIfRedirectSelectionIsIndex(): void + public function testConsumableCheckoutPagePostIsRedirectedIfRedirectSelectionIsIndex() { $consumable = Consumable::factory()->create(); @@ -108,7 +108,7 @@ final class ConsumableCheckoutTest extends TestCase ->assertRedirect(route('consumables.index')); } - public function testConsumableCheckoutPagePostIsRedirectedIfRedirectSelectionIsItem(): void + public function testConsumableCheckoutPagePostIsRedirectedIfRedirectSelectionIsItem() { $consumable = Consumable::factory()->create(); @@ -123,7 +123,7 @@ final class ConsumableCheckoutTest extends TestCase ->assertRedirect(route('consumables.show', ['consumable' => $consumable->id])); } - public function testConsumableCheckoutPagePostIsRedirectedIfRedirectSelectionIsTarget(): void + public function testConsumableCheckoutPagePostIsRedirectedIfRedirectSelectionIsTarget() { $user = User::factory()->create(); $consumable = Consumable::factory()->create(); diff --git a/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php b/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php index 6d8cb649a4..5498193352 100644 --- a/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php +++ b/tests/Feature/Checkouts/Ui/LicenseCheckoutTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; final class LicenseCheckoutTest extends TestCase { - public function testNotesAreStoredInActionLogOnCheckoutToAsset(): void + public function testNotesAreStoredInActionLogOnCheckoutToAsset() { $admin = User::factory()->superuser()->create(); $asset = Asset::factory()->create(); @@ -34,7 +34,7 @@ final class LicenseCheckoutTest extends TestCase ]); } - public function testNotesAreStoredInActionLogOnCheckoutToUser(): void + public function testNotesAreStoredInActionLogOnCheckoutToUser() { $admin = User::factory()->superuser()->create(); $licenseSeat = LicenseSeat::factory()->create(); @@ -57,7 +57,7 @@ final class LicenseCheckoutTest extends TestCase ]); } - public function testLicenseCheckoutPagePostIsRedirectedIfRedirectSelectionIsIndex(): void + public function testLicenseCheckoutPagePostIsRedirectedIfRedirectSelectionIsIndex() { $license = License::factory()->create(); @@ -72,7 +72,7 @@ final class LicenseCheckoutTest extends TestCase ->assertRedirect(route('licenses.index')); } - public function testLicenseCheckoutPagePostIsRedirectedIfRedirectSelectionIsItem(): void + public function testLicenseCheckoutPagePostIsRedirectedIfRedirectSelectionIsItem() { $license = License::factory()->create(); @@ -86,7 +86,7 @@ final class LicenseCheckoutTest extends TestCase ->assertRedirect(route('licenses.show', ['license' => $license->id])); } - public function testLicenseCheckoutPagePostIsRedirectedIfRedirectSelectionIsUserTarget(): void + public function testLicenseCheckoutPagePostIsRedirectedIfRedirectSelectionIsUserTarget() { $user = User::factory()->create(); $license = License::factory()->create(); @@ -100,7 +100,7 @@ final class LicenseCheckoutTest extends TestCase ->assertStatus(302) ->assertRedirect(route('users.show', ['user' => $user->id])); } - public function testLicenseCheckoutPagePostIsRedirectedIfRedirectSelectionIsAssetTarget(): void + public function testLicenseCheckoutPagePostIsRedirectedIfRedirectSelectionIsAssetTarget() { $asset = Asset::factory()->create(); $license = License::factory()->create(); diff --git a/tests/Feature/Components/Api/ComponentIndexTest.php b/tests/Feature/Components/Api/ComponentIndexTest.php index df1e91544c..a0091f3159 100644 --- a/tests/Feature/Components/Api/ComponentIndexTest.php +++ b/tests/Feature/Components/Api/ComponentIndexTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class ComponentIndexTest extends TestCase { - public function testComponentIndexAdheresToCompanyScoping(): void + public function testComponentIndexAdheresToCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Feature/Components/Ui/ComponentIndexTest.php b/tests/Feature/Components/Ui/ComponentIndexTest.php index c0e8422fbc..49e062a8e7 100644 --- a/tests/Feature/Components/Ui/ComponentIndexTest.php +++ b/tests/Feature/Components/Ui/ComponentIndexTest.php @@ -7,14 +7,14 @@ use Tests\TestCase; final class ComponentIndexTest extends TestCase { - public function testPermissionRequiredToViewComponentsList(): void + public function testPermissionRequiredToViewComponentsList() { $this->actingAs(User::factory()->create()) ->get(route('components.index')) ->assertForbidden(); } - public function testUserCanListComponents(): void + public function testUserCanListComponents() { $this->actingAs(User::factory()->superuser()->create()) ->get(route('components.index')) diff --git a/tests/Feature/Console/MergeUsersTest.php b/tests/Feature/Console/MergeUsersTest.php index e775e1c4a3..e46be18c70 100644 --- a/tests/Feature/Console/MergeUsersTest.php +++ b/tests/Feature/Console/MergeUsersTest.php @@ -13,7 +13,7 @@ use Tests\TestCase; final class MergeUsersTest extends TestCase { - public function testAssetsAreTransferredOnUserMerge(): void + public function testAssetsAreTransferredOnUserMerge() { $user1 = User::factory()->create(['username' => 'user1']); $user_to_merge_into = User::factory()->create(['username' => 'user1@example.com']); diff --git a/tests/Feature/Console/OptimizeTest.php b/tests/Feature/Console/OptimizeTest.php index a6648c363f..2dd2ce6c4b 100644 --- a/tests/Feature/Console/OptimizeTest.php +++ b/tests/Feature/Console/OptimizeTest.php @@ -6,7 +6,7 @@ use Tests\TestCase; final class OptimizeTest extends TestCase { - public function testOptimizeSucceeds(): void + public function testOptimizeSucceeds() { $this->beforeApplicationDestroyed(function () { $this->artisan('config:clear'); diff --git a/tests/Feature/Consumables/Api/ConsumableIndexTest.php b/tests/Feature/Consumables/Api/ConsumableIndexTest.php index d4d4ca9ffe..2ad8601657 100644 --- a/tests/Feature/Consumables/Api/ConsumableIndexTest.php +++ b/tests/Feature/Consumables/Api/ConsumableIndexTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class ConsumableIndexTest extends TestCase { - public function testConsumableIndexAdheresToCompanyScoping(): void + public function testConsumableIndexAdheresToCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); @@ -55,7 +55,7 @@ final class ConsumableIndexTest extends TestCase ->assertResponseContainsInRows($consumableB); } - public function testConsumableIndexReturnsExpectedSearchResults(): void + public function testConsumableIndexReturnsExpectedSearchResults() { Consumable::factory()->count(10)->create(); Consumable::factory()->count(1)->create(['name' => 'My Test Consumable']); diff --git a/tests/Feature/Consumables/Api/ConsumableUpdateTest.php b/tests/Feature/Consumables/Api/ConsumableUpdateTest.php index c622b820cc..a21052f0a2 100644 --- a/tests/Feature/Consumables/Api/ConsumableUpdateTest.php +++ b/tests/Feature/Consumables/Api/ConsumableUpdateTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; final class ConsumableUpdateTest extends TestCase { - public function testCanUpdateConsumableViaPatchWithoutCategoryType(): void + public function testCanUpdateConsumableViaPatchWithoutCategoryType() { $consumable = Consumable::factory()->create(); @@ -28,7 +28,7 @@ final class ConsumableUpdateTest extends TestCase } - public function testCannotUpdateConsumableViaPatchWithInvalidCategoryType(): void + public function testCannotUpdateConsumableViaPatchWithInvalidCategoryType() { $category = Category::factory()->create(['category_type' => 'asset']); $consumable = Consumable::factory()->create(); diff --git a/tests/Feature/Consumables/Api/ConsumableViewTest.php b/tests/Feature/Consumables/Api/ConsumableViewTest.php index 52bd4e31bd..1cc5c26e4a 100644 --- a/tests/Feature/Consumables/Api/ConsumableViewTest.php +++ b/tests/Feature/Consumables/Api/ConsumableViewTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class ConsumableViewTest extends TestCase { - public function testConsumableViewAdheresToCompanyScoping(): void + public function testConsumableViewAdheresToCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Feature/Consumables/Ui/ConsumableIndexTest.php b/tests/Feature/Consumables/Ui/ConsumableIndexTest.php index a14d551d2a..ae2ad06119 100644 --- a/tests/Feature/Consumables/Ui/ConsumableIndexTest.php +++ b/tests/Feature/Consumables/Ui/ConsumableIndexTest.php @@ -7,14 +7,14 @@ use Tests\TestCase; final class ConsumableIndexTest extends TestCase { - public function testPermissionRequiredToViewConsumablesList(): void + public function testPermissionRequiredToViewConsumablesList() { $this->actingAs(User::factory()->create()) ->get(route('consumables.index')) ->assertForbidden(); } - public function testUserCanListConsumables(): void + public function testUserCanListConsumables() { $this->actingAs(User::factory()->superuser()->create()) ->get(route('consumables.index')) diff --git a/tests/Feature/Consumables/Ui/ConsumableViewTest.php b/tests/Feature/Consumables/Ui/ConsumableViewTest.php index 7e53712071..e80f4342e2 100644 --- a/tests/Feature/Consumables/Ui/ConsumableViewTest.php +++ b/tests/Feature/Consumables/Ui/ConsumableViewTest.php @@ -8,7 +8,7 @@ use Tests\TestCase; final class ConsumableViewTest extends TestCase { - public function testPermissionRequiredToViewConsumable(): void + public function testPermissionRequiredToViewConsumable() { $consumable = Consumable::factory()->create(); $this->actingAs(User::factory()->create()) @@ -16,7 +16,7 @@ final class ConsumableViewTest extends TestCase ->assertForbidden(); } - public function testUserCanListConsumables(): void + public function testUserCanListConsumables() { $consumable = Consumable::factory()->create(); $this->actingAs(User::factory()->superuser()->create()) diff --git a/tests/Feature/DashboardTest.php b/tests/Feature/DashboardTest.php index c8452763bb..a5d60e5eff 100644 --- a/tests/Feature/DashboardTest.php +++ b/tests/Feature/DashboardTest.php @@ -7,7 +7,7 @@ use Tests\TestCase; final class DashboardTest extends TestCase { - public function testUsersWithoutAdminAccessAreRedirected(): void + public function testUsersWithoutAdminAccessAreRedirected() { $this->actingAs(User::factory()->create()) ->get(route('home')) diff --git a/tests/Feature/Departments/Api/CreateDepartmentsTest.php b/tests/Feature/Departments/Api/CreateDepartmentsTest.php index 5796fd92f0..10e7823b21 100644 --- a/tests/Feature/Departments/Api/CreateDepartmentsTest.php +++ b/tests/Feature/Departments/Api/CreateDepartmentsTest.php @@ -13,7 +13,7 @@ final class CreateDepartmentsTest extends TestCase { - public function testRequiresPermissionToCreateDepartment(): void + public function testRequiresPermissionToCreateDepartment() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.departments.store')) diff --git a/tests/Feature/Departments/Api/DepartmentsIndexTest.php b/tests/Feature/Departments/Api/DepartmentsIndexTest.php index eff7f98a13..6fcf6b008f 100644 --- a/tests/Feature/Departments/Api/DepartmentsIndexTest.php +++ b/tests/Feature/Departments/Api/DepartmentsIndexTest.php @@ -10,19 +10,19 @@ use Tests\TestCase; final class DepartmentsIndexTest extends TestCase { - public function testViewingDepartmentIndexRequiresAuthentication(): void + public function testViewingDepartmentIndexRequiresAuthentication() { $this->getJson(route('api.departments.index'))->assertRedirect(); } - public function testViewingDepartmentIndexRequiresPermission(): void + public function testViewingDepartmentIndexRequiresPermission() { $this->actingAsForApi(User::factory()->create()) ->getJson(route('api.departments.index')) ->assertForbidden(); } - public function testDepartmentIndexReturnsExpectedDepartments(): void + public function testDepartmentIndexReturnsExpectedDepartments() { Department::factory()->count(3)->create(); @@ -42,7 +42,7 @@ final class DepartmentsIndexTest extends TestCase ->assertJson(fn(AssertableJson $json) => $json->has('rows', 3)->etc()); } - public function testDepartmentIndexAdheresToCompanyScoping(): void + public function testDepartmentIndexAdheresToCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Feature/Departments/Api/UpdateDepartmentsTest.php b/tests/Feature/Departments/Api/UpdateDepartmentsTest.php index 5e884e6fbe..d5d8c4811c 100644 --- a/tests/Feature/Departments/Api/UpdateDepartmentsTest.php +++ b/tests/Feature/Departments/Api/UpdateDepartmentsTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; final class UpdateDepartmentsTest extends TestCase { - public function testRequiresPermissionToEditDepartment(): void + public function testRequiresPermissionToEditDepartment() { $department = Department::factory()->create(); $this->actingAsForApi(User::factory()->create()) @@ -18,7 +18,7 @@ final class UpdateDepartmentsTest extends TestCase ->assertForbidden(); } - public function testCanUpdateDepartmentViaPatch(): void + public function testCanUpdateDepartmentViaPatch() { $department = Department::factory()->create(); diff --git a/tests/Feature/Departments/Ui/CreateDepartmentsTest.php b/tests/Feature/Departments/Ui/CreateDepartmentsTest.php index ef46fd13a8..6d975d5a75 100644 --- a/tests/Feature/Departments/Ui/CreateDepartmentsTest.php +++ b/tests/Feature/Departments/Ui/CreateDepartmentsTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class CreateDepartmentsTest extends TestCase { - public function testPermissionRequiredToCreateDepartment(): void + public function testPermissionRequiredToCreateDepartment() { $this->actingAs(User::factory()->create()) ->post(route('departments.store'), [ @@ -19,7 +19,7 @@ final class CreateDepartmentsTest extends TestCase ->assertForbidden(); } - public function testUserCanCreateDepartments(): void + public function testUserCanCreateDepartments() { $this->assertFalse(Department::where('name', 'Test Department')->exists()); diff --git a/tests/Feature/Departments/Ui/IndexDepartmentsTest.php b/tests/Feature/Departments/Ui/IndexDepartmentsTest.php index b642124ab0..0cd802af46 100644 --- a/tests/Feature/Departments/Ui/IndexDepartmentsTest.php +++ b/tests/Feature/Departments/Ui/IndexDepartmentsTest.php @@ -7,14 +7,14 @@ use Tests\TestCase; final class IndexDepartmentsTest extends TestCase { - public function testPermissionRequiredToViewDepartmentsList(): void + public function testPermissionRequiredToViewDepartmentsList() { $this->actingAs(User::factory()->create()) ->get(route('departments.index')) ->assertForbidden(); } - public function testUserCanListDepartments(): void + public function testUserCanListDepartments() { $this->actingAs(User::factory()->superuser()->create()) ->get(route('departments.index')) diff --git a/tests/Feature/Departments/Ui/UpdateDepartmentsTest.php b/tests/Feature/Departments/Ui/UpdateDepartmentsTest.php index a3864e4f2e..468176961c 100644 --- a/tests/Feature/Departments/Ui/UpdateDepartmentsTest.php +++ b/tests/Feature/Departments/Ui/UpdateDepartmentsTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class UpdateDepartmentsTest extends TestCase { - public function testPermissionRequiredToStoreDepartment(): void + public function testPermissionRequiredToStoreDepartment() { $this->actingAs(User::factory()->create()) ->post(route('departments.store'), [ @@ -20,7 +20,7 @@ final class UpdateDepartmentsTest extends TestCase } - public function testUserCanEditDepartments(): void + public function testUserCanEditDepartments() { $department = Department::factory()->create(['name' => 'Test Department']); $this->assertTrue(Department::where('name', 'Test Department')->exists()); diff --git a/tests/Feature/Groups/Api/StoreGroupTest.php b/tests/Feature/Groups/Api/StoreGroupTest.php index df8f42ddfd..f48210551a 100644 --- a/tests/Feature/Groups/Api/StoreGroupTest.php +++ b/tests/Feature/Groups/Api/StoreGroupTest.php @@ -9,14 +9,14 @@ use Tests\TestCase; final class StoreGroupTest extends TestCase { - public function testStoringGroupRequiresSuperAdminPermission(): void + public function testStoringGroupRequiresSuperAdminPermission() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.groups.store')) ->assertForbidden(); } - public function testCanStoreGroupWithPermissionsPassed(): void + public function testCanStoreGroupWithPermissionsPassed() { $this->actingAsForApi(User::factory()->superuser()->create()) ->postJson(route('api.groups.store'), [ @@ -37,7 +37,7 @@ final class StoreGroupTest extends TestCase $this->assertEquals('0', $group->decodePermissions()['reports.view']); } - public function testStoringGroupWithoutPermissionPassed(): void + public function testStoringGroupWithoutPermissionPassed() { $superuser = User::factory()->superuser()->create(); $this->actingAsForApi($superuser) @@ -61,7 +61,7 @@ final class StoreGroupTest extends TestCase ->assertOk(); } - public function testStoringGroupWithInvalidPermissionDropsBadPermission(): void + public function testStoringGroupWithInvalidPermissionDropsBadPermission() { $this->actingAsForApi(User::factory()->superuser()->create()) ->postJson(route('api.groups.store'), [ diff --git a/tests/Feature/Groups/Ui/IndexGroupTest.php b/tests/Feature/Groups/Ui/IndexGroupTest.php index a39766e25d..b9010bd303 100644 --- a/tests/Feature/Groups/Ui/IndexGroupTest.php +++ b/tests/Feature/Groups/Ui/IndexGroupTest.php @@ -7,7 +7,7 @@ use Tests\TestCase; final class IndexGroupTest extends TestCase { - public function testPermissionRequiredToViewGroupList(): void + public function testPermissionRequiredToViewGroupList() { $this->actingAs(User::factory()->create()) ->get(route('groups.index')) @@ -16,7 +16,7 @@ final class IndexGroupTest extends TestCase //$this->followRedirects($response)->assertSee('sad-panda.png'); } - public function testUserCanListGroups(): void + public function testUserCanListGroups() { $this->actingAs(User::factory()->superuser()->create()) ->get(route('groups.index')) diff --git a/tests/Feature/Licenses/Api/LicenseIndexTest.php b/tests/Feature/Licenses/Api/LicenseIndexTest.php index 11d81b06f7..1b5d933e50 100644 --- a/tests/Feature/Licenses/Api/LicenseIndexTest.php +++ b/tests/Feature/Licenses/Api/LicenseIndexTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class LicenseIndexTest extends TestCase { - public function testLicensesIndexAdheresToCompanyScoping(): void + public function testLicensesIndexAdheresToCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Feature/Licenses/Ui/CreateLicenseTest.php b/tests/Feature/Licenses/Ui/CreateLicenseTest.php index c302bbf61f..dcbe90f222 100644 --- a/tests/Feature/Licenses/Ui/CreateLicenseTest.php +++ b/tests/Feature/Licenses/Ui/CreateLicenseTest.php @@ -11,7 +11,7 @@ use Tests\TestCase; final class CreateLicenseTest extends TestCase { - public function testPermissionRequiredToViewLicense(): void + public function testPermissionRequiredToViewLicense() { $license = License::factory()->create(); $this->actingAs(User::factory()->create()) @@ -21,7 +21,7 @@ final class CreateLicenseTest extends TestCase - public function testLicenseWithoutPurchaseDateFailsValidation(): void + public function testLicenseWithoutPurchaseDateFailsValidation() { $response = $this->actingAs(User::factory()->superuser()->create()) ->from(route('licenses.create')) diff --git a/tests/Feature/Licenses/Ui/LicenseIndexTest.php b/tests/Feature/Licenses/Ui/LicenseIndexTest.php index 381fe90980..ac81ac66d5 100644 --- a/tests/Feature/Licenses/Ui/LicenseIndexTest.php +++ b/tests/Feature/Licenses/Ui/LicenseIndexTest.php @@ -7,14 +7,14 @@ use Tests\TestCase; final class LicenseIndexTest extends TestCase { - public function testPermissionRequiredToViewLicenseList(): void + public function testPermissionRequiredToViewLicenseList() { $this->actingAs(User::factory()->create()) ->get(route('licenses.index')) ->assertForbidden(); } - public function testUserCanListLicenses(): void + public function testUserCanListLicenses() { $this->actingAs(User::factory()->superuser()->create()) ->get(route('licenses.index')) diff --git a/tests/Feature/Licenses/Ui/LicenseViewTest.php b/tests/Feature/Licenses/Ui/LicenseViewTest.php index 1685e58bf3..f4b41f2df8 100644 --- a/tests/Feature/Licenses/Ui/LicenseViewTest.php +++ b/tests/Feature/Licenses/Ui/LicenseViewTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class LicenseViewTest extends TestCase { - public function testPermissionRequiredToViewLicense(): void + public function testPermissionRequiredToViewLicense() { $license = License::factory()->create(); $this->actingAs(User::factory()->create()) @@ -17,7 +17,7 @@ final class LicenseViewTest extends TestCase ->assertForbidden(); } - public function testLicenseWithPurchaseDateDepreciatesCorrectly(): void + public function testLicenseWithPurchaseDateDepreciatesCorrectly() { $depreciation = Depreciation::factory()->create(['months' => 12]); $license = License::factory()->create(['depreciation_id' => $depreciation->id, 'purchase_date' => '2020-01-01']); diff --git a/tests/Feature/Livewire/CategoryEditFormTest.php b/tests/Feature/Livewire/CategoryEditFormTest.php index 3e75781d18..6b5a32123e 100644 --- a/tests/Feature/Livewire/CategoryEditFormTest.php +++ b/tests/Feature/Livewire/CategoryEditFormTest.php @@ -8,12 +8,12 @@ use Tests\TestCase; final class CategoryEditFormTest extends TestCase { - public function testTheComponentCanRender(): void + public function testTheComponentCanRender() { Livewire::test(CategoryEditForm::class)->assertStatus(200); } - public function testSendEmailCheckboxIsCheckedOnLoadWhenSendEmailIsExistingSetting(): void + public function testSendEmailCheckboxIsCheckedOnLoadWhenSendEmailIsExistingSetting() { Livewire::test(CategoryEditForm::class, [ 'sendCheckInEmail' => true, @@ -22,7 +22,7 @@ final class CategoryEditFormTest extends TestCase ])->assertSet('sendCheckInEmail', true); } - public function testSendEmailCheckboxIsCheckedOnLoadWhenCategoryEulaSet(): void + public function testSendEmailCheckboxIsCheckedOnLoadWhenCategoryEulaSet() { Livewire::test(CategoryEditForm::class, [ 'sendCheckInEmail' => false, @@ -31,7 +31,7 @@ final class CategoryEditFormTest extends TestCase ])->assertSet('sendCheckInEmail', true); } - public function testSendEmailCheckboxIsCheckedOnLoadWhenUsingDefaultEula(): void + public function testSendEmailCheckboxIsCheckedOnLoadWhenUsingDefaultEula() { Livewire::test(CategoryEditForm::class, [ 'sendCheckInEmail' => false, @@ -40,7 +40,7 @@ final class CategoryEditFormTest extends TestCase ])->assertSet('sendCheckInEmail', true); } - public function testSendEmailCheckBoxIsUncheckedOnLoadWhenSendEmailIsFalseNoCategoryEulaSetAndNotUsingDefaultEula(): void + public function testSendEmailCheckBoxIsUncheckedOnLoadWhenSendEmailIsFalseNoCategoryEulaSetAndNotUsingDefaultEula() { Livewire::test(CategoryEditForm::class, [ 'sendCheckInEmail' => false, @@ -49,7 +49,7 @@ final class CategoryEditFormTest extends TestCase ])->assertSet('sendCheckInEmail', false); } - public function testSendEmailCheckboxIsCheckedWhenCategoryEulaEntered(): void + public function testSendEmailCheckboxIsCheckedWhenCategoryEulaEntered() { Livewire::test(CategoryEditForm::class, [ 'sendCheckInEmail' => false, @@ -59,7 +59,7 @@ final class CategoryEditFormTest extends TestCase ->assertSet('sendCheckInEmail', true); } - public function testSendEmailCheckboxCheckedAndDisabledAndEulaTextDisabledWhenUseDefaultEulaSelected(): void + public function testSendEmailCheckboxCheckedAndDisabledAndEulaTextDisabledWhenUseDefaultEulaSelected() { Livewire::test(CategoryEditForm::class, [ 'sendCheckInEmail' => false, @@ -71,7 +71,7 @@ final class CategoryEditFormTest extends TestCase ->assertSet('sendCheckInEmailDisabled', true); } - public function testSendEmailCheckboxEnabledAndSetToOriginalValueWhenNoCategoryEulaAndNotUsingGlobalEula(): void + public function testSendEmailCheckboxEnabledAndSetToOriginalValueWhenNoCategoryEulaAndNotUsingGlobalEula() { Livewire::test(CategoryEditForm::class, [ 'eulaText' => 'Some Content', @@ -94,7 +94,7 @@ final class CategoryEditFormTest extends TestCase ->assertSet('sendCheckInEmailDisabled', false); } - public function testEulaFieldEnabledOnLoadWhenNotUsingDefaultEula(): void + public function testEulaFieldEnabledOnLoadWhenNotUsingDefaultEula() { Livewire::test(CategoryEditForm::class, [ 'sendCheckInEmail' => false, diff --git a/tests/Feature/Locations/Api/CreateLocationsTest.php b/tests/Feature/Locations/Api/CreateLocationsTest.php index b114266d4d..b084c42073 100644 --- a/tests/Feature/Locations/Api/CreateLocationsTest.php +++ b/tests/Feature/Locations/Api/CreateLocationsTest.php @@ -9,14 +9,14 @@ use Tests\TestCase; final class CreateLocationsTest extends TestCase { - public function testRequiresPermissionToCreateLocation(): void + public function testRequiresPermissionToCreateLocation() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.departments.store')) ->assertForbidden(); } - public function testCannotCreateNewLocationsWithTheSameName(): void + public function testCannotCreateNewLocationsWithTheSameName() { $location = Location::factory()->create(); $location2 = Location::factory()->create(); @@ -33,7 +33,7 @@ final class CreateLocationsTest extends TestCase } - public function testUserCannotCreateLocationsThatAreTheirOwnParent(): void + public function testUserCannotCreateLocationsThatAreTheirOwnParent() { $location = Location::factory()->create(); diff --git a/tests/Feature/Locations/Api/DeleteLocationsTest.php b/tests/Feature/Locations/Api/DeleteLocationsTest.php index 111fdb1caf..8f08919686 100644 --- a/tests/Feature/Locations/Api/DeleteLocationsTest.php +++ b/tests/Feature/Locations/Api/DeleteLocationsTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; final class DeleteLocationsTest extends TestCase { - public function testErrorReturnedViaApiIfLocationDoesNotExist(): void + public function testErrorReturnedViaApiIfLocationDoesNotExist() { $this->actingAsForApi(User::factory()->superuser()->create()) ->deleteJson(route('api.users.destroy', 'invalid-id')) @@ -20,7 +20,7 @@ final class DeleteLocationsTest extends TestCase ->json(); } - public function testErrorReturnedViaApiIfLocationIsAlreadyDeleted(): void + public function testErrorReturnedViaApiIfLocationIsAlreadyDeleted() { $location = Location::factory()->deletedLocation()->create(); $this->actingAsForApi(User::factory()->superuser()->create()) @@ -31,7 +31,7 @@ final class DeleteLocationsTest extends TestCase ->json(); } - public function testDisallowLocationDeletionViaApiIfStillHasPeople(): void + public function testDisallowLocationDeletionViaApiIfStillHasPeople() { $location = Location::factory()->create(); User::factory()->count(5)->create(['location_id' => $location->id]); @@ -46,7 +46,7 @@ final class DeleteLocationsTest extends TestCase ->json(); } - public function testDisallowUserDeletionViaApiIfStillHasChildLocations(): void + public function testDisallowUserDeletionViaApiIfStillHasChildLocations() { $parent = Location::factory()->create(); Location::factory()->count(5)->create(['parent_id' => $parent->id]); @@ -60,7 +60,7 @@ final class DeleteLocationsTest extends TestCase ->json(); } - public function testDisallowUserDeletionViaApiIfStillHasAssetsAssigned(): void + public function testDisallowUserDeletionViaApiIfStillHasAssetsAssigned() { $location = Location::factory()->create(); Asset::factory()->count(5)->assignedToLocation($location)->create(); @@ -75,7 +75,7 @@ final class DeleteLocationsTest extends TestCase ->json(); } - public function testDisallowUserDeletionViaApiIfStillHasAssetsAsLocation(): void + public function testDisallowUserDeletionViaApiIfStillHasAssetsAsLocation() { $location = Location::factory()->create(); Asset::factory()->count(5)->create(['location_id' => $location->id]); diff --git a/tests/Feature/Locations/Api/IndexLocationsTest.php b/tests/Feature/Locations/Api/IndexLocationsTest.php index 6a1a7474cf..3c6309a78a 100644 --- a/tests/Feature/Locations/Api/IndexLocationsTest.php +++ b/tests/Feature/Locations/Api/IndexLocationsTest.php @@ -10,19 +10,19 @@ use Tests\TestCase; final class IndexLocationsTest extends TestCase { - public function testViewingLocationIndexRequiresAuthentication(): void + public function testViewingLocationIndexRequiresAuthentication() { $this->getJson(route('api.locations.index'))->assertRedirect(); } - public function testViewingLocationIndexRequiresPermission(): void + public function testViewingLocationIndexRequiresPermission() { $this->actingAsForApi(User::factory()->create()) ->getJson(route('api.locations.index')) ->assertForbidden(); } - public function testLocationIndexReturnsExpectedLocations(): void + public function testLocationIndexReturnsExpectedLocations() { Location::factory()->count(3)->create(); diff --git a/tests/Feature/Locations/Api/LocationsForSelectListTest.php b/tests/Feature/Locations/Api/LocationsForSelectListTest.php index 563135dddb..4e20ef3d86 100644 --- a/tests/Feature/Locations/Api/LocationsForSelectListTest.php +++ b/tests/Feature/Locations/Api/LocationsForSelectListTest.php @@ -9,14 +9,14 @@ use Tests\TestCase; final class LocationsForSelectListTest extends TestCase { - public function testGettingLocationListRequiresProperPermission(): void + public function testGettingLocationListRequiresProperPermission() { $this->actingAsForApi(User::factory()->create()) ->getJson(route('api.locations.selectlist')) ->assertForbidden(); } - public function testLocationsReturned(): void + public function testLocationsReturned() { Location::factory()->create(); @@ -35,7 +35,7 @@ final class LocationsForSelectListTest extends TestCase ->assertJson(fn(AssertableJson $json) => $json->has('results', 1)->etc()); } - public function testLocationsAreReturnedWhenUserIsUpdatingTheirProfileAndHasPermissionToUpdateLocation(): void + public function testLocationsAreReturnedWhenUserIsUpdatingTheirProfileAndHasPermissionToUpdateLocation() { $this->actingAsForApi(User::factory()->canEditOwnLocation()->create()) ->withHeader('referer', route('profile')) diff --git a/tests/Feature/Locations/Api/LocationsViewTest.php b/tests/Feature/Locations/Api/LocationsViewTest.php index 270db594e8..618bf9c593 100644 --- a/tests/Feature/Locations/Api/LocationsViewTest.php +++ b/tests/Feature/Locations/Api/LocationsViewTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class LocationsViewTest extends TestCase { - public function testViewingLocationRequiresPermission(): void + public function testViewingLocationRequiresPermission() { $location = Location::factory()->create(); $this->actingAsForApi(User::factory()->create()) @@ -17,7 +17,7 @@ final class LocationsViewTest extends TestCase ->assertForbidden(); } - public function testViewingLocationAssetIndexRequiresPermission(): void + public function testViewingLocationAssetIndexRequiresPermission() { $location = Location::factory()->create(); $this->actingAsForApi(User::factory()->create()) @@ -25,7 +25,7 @@ final class LocationsViewTest extends TestCase ->assertForbidden(); } - public function testViewingLocationAssetIndex(): void + public function testViewingLocationAssetIndex() { $location = Location::factory()->create(); Asset::factory()->count(3)->assignedToLocation($location)->create(); diff --git a/tests/Feature/Locations/Api/UpdateLocationsTest.php b/tests/Feature/Locations/Api/UpdateLocationsTest.php index 6cc52cfc60..ca38568714 100644 --- a/tests/Feature/Locations/Api/UpdateLocationsTest.php +++ b/tests/Feature/Locations/Api/UpdateLocationsTest.php @@ -9,14 +9,14 @@ use Tests\TestCase; final class UpdateLocationsTest extends TestCase { - public function testRequiresPermissionToEditLocation(): void + public function testRequiresPermissionToEditLocation() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.locations.store', Location::factory()->create())) ->assertForbidden(); } - public function testCanUpdateLocationViaPatch(): void + public function testCanUpdateLocationViaPatch() { $location = Location::factory()->create(); diff --git a/tests/Feature/Locations/Ui/CreateLocationsTest.php b/tests/Feature/Locations/Ui/CreateLocationsTest.php index 0994e69e06..ef981d7d1c 100644 --- a/tests/Feature/Locations/Ui/CreateLocationsTest.php +++ b/tests/Feature/Locations/Ui/CreateLocationsTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class CreateLocationsTest extends TestCase { - public function testPermissionRequiredToCreateLocation(): void + public function testPermissionRequiredToCreateLocation() { $this->actingAs(User::factory()->create()) ->post(route('locations.store'), [ @@ -19,7 +19,7 @@ final class CreateLocationsTest extends TestCase ->assertForbidden(); } - public function testUserCanCreateLocations(): void + public function testUserCanCreateLocations() { $this->assertFalse(Location::where('name', 'Test Location')->exists()); diff --git a/tests/Feature/Locations/Ui/IndexLocationsTest.php b/tests/Feature/Locations/Ui/IndexLocationsTest.php index cc74cfd919..23574ae0ca 100644 --- a/tests/Feature/Locations/Ui/IndexLocationsTest.php +++ b/tests/Feature/Locations/Ui/IndexLocationsTest.php @@ -7,14 +7,14 @@ use Tests\TestCase; final class IndexLocationsTest extends TestCase { - public function testPermissionRequiredToViewLocationsList(): void + public function testPermissionRequiredToViewLocationsList() { $this->actingAs(User::factory()->create()) ->get(route('locations.index')) ->assertForbidden(); } - public function testUserCanListLocations(): void + public function testUserCanListLocations() { $this->actingAs(User::factory()->superuser()->create()) ->get(route('locations.index')) diff --git a/tests/Feature/Locations/Ui/UpdateLocationsTest.php b/tests/Feature/Locations/Ui/UpdateLocationsTest.php index a93a679b79..0db66a800c 100644 --- a/tests/Feature/Locations/Ui/UpdateLocationsTest.php +++ b/tests/Feature/Locations/Ui/UpdateLocationsTest.php @@ -8,7 +8,7 @@ use Tests\TestCase; final class UpdateLocationsTest extends TestCase { - public function testPermissionRequiredToStoreLocation(): void + public function testPermissionRequiredToStoreLocation() { $this->actingAs(User::factory()->create()) ->post(route('locations.store'), [ @@ -19,7 +19,7 @@ final class UpdateLocationsTest extends TestCase } - public function testUserCanEditLocations(): void + public function testUserCanEditLocations() { $location = Location::factory()->create(['name' => 'Test Location']); $this->assertTrue(Location::where('name', 'Test Location')->exists()); @@ -36,7 +36,7 @@ final class UpdateLocationsTest extends TestCase $this->assertTrue(Location::where('name', 'Test Location Edited')->exists()); } - public function testUserCannotEditLocationsToMakeThemTheirOwnParent(): void + public function testUserCannotEditLocationsToMakeThemTheirOwnParent() { $location = Location::factory()->create(); diff --git a/tests/Feature/Notifications/Email/EmailNotificationsUponCheckinTest.php b/tests/Feature/Notifications/Email/EmailNotificationsUponCheckinTest.php index 2533050494..b00472b4ed 100644 --- a/tests/Feature/Notifications/Email/EmailNotificationsUponCheckinTest.php +++ b/tests/Feature/Notifications/Email/EmailNotificationsUponCheckinTest.php @@ -20,7 +20,7 @@ final class EmailNotificationsUponCheckinTest extends TestCase Notification::fake(); } - public function testCheckInEmailSentToUserIfSettingEnabled(): void + public function testCheckInEmailSentToUserIfSettingEnabled() { $user = User::factory()->create(); $asset = Asset::factory()->assignedToUser($user)->create(); @@ -37,7 +37,7 @@ final class EmailNotificationsUponCheckinTest extends TestCase ); } - public function testCheckInEmailNotSentToUserIfSettingDisabled(): void + public function testCheckInEmailNotSentToUserIfSettingDisabled() { $user = User::factory()->create(); $asset = Asset::factory()->assignedToUser($user)->create(); diff --git a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php index b881dd9f14..32aa34770c 100644 --- a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php +++ b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckinTest.php @@ -45,7 +45,7 @@ final class SlackNotificationsUponCheckinTest extends TestCase ]; } - public function testAccessoryCheckinSendsSlackNotificationWhenSettingEnabled(): void + public function testAccessoryCheckinSendsSlackNotificationWhenSettingEnabled() { $this->settings->enableSlackWebhook(); @@ -57,7 +57,7 @@ final class SlackNotificationsUponCheckinTest extends TestCase $this->assertSlackNotificationSent(CheckinAccessoryNotification::class); } - public function testAccessoryCheckinDoesNotSendSlackNotificationWhenSettingDisabled(): void + public function testAccessoryCheckinDoesNotSendSlackNotificationWhenSettingDisabled() { $this->settings->disableSlackWebhook(); @@ -70,7 +70,7 @@ final class SlackNotificationsUponCheckinTest extends TestCase } #[DataProvider('assetCheckInTargets')] - public function testAssetCheckinSendsSlackNotificationWhenSettingEnabled($checkoutTarget): void + public function testAssetCheckinSendsSlackNotificationWhenSettingEnabled($checkoutTarget) { $this->settings->enableSlackWebhook(); @@ -83,7 +83,7 @@ final class SlackNotificationsUponCheckinTest extends TestCase } #[DataProvider('assetCheckInTargets')] - public function testAssetCheckinDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget): void + public function testAssetCheckinDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget) { $this->settings->disableSlackWebhook(); @@ -95,7 +95,7 @@ final class SlackNotificationsUponCheckinTest extends TestCase $this->assertNoSlackNotificationSent(CheckinAssetNotification::class); } - public function testComponentCheckinDoesNotSendSlackNotification(): void + public function testComponentCheckinDoesNotSendSlackNotification() { $this->settings->enableSlackWebhook(); @@ -108,7 +108,7 @@ final class SlackNotificationsUponCheckinTest extends TestCase } #[DataProvider('licenseCheckInTargets')] - public function testLicenseCheckinSendsSlackNotificationWhenSettingEnabled($checkoutTarget): void + public function testLicenseCheckinSendsSlackNotificationWhenSettingEnabled($checkoutTarget) { $this->settings->enableSlackWebhook(); @@ -121,7 +121,7 @@ final class SlackNotificationsUponCheckinTest extends TestCase } #[DataProvider('licenseCheckInTargets')] - public function testLicenseCheckinDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget): void + public function testLicenseCheckinDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget) { $this->settings->disableSlackWebhook(); diff --git a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php index dd9633a8a4..d6ad65041a 100644 --- a/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php +++ b/tests/Feature/Notifications/Webhooks/SlackNotificationsUponCheckoutTest.php @@ -47,7 +47,7 @@ final class SlackNotificationsUponCheckoutTest extends TestCase ]; } - public function testAccessoryCheckoutSendsSlackNotificationWhenSettingEnabled(): void + public function testAccessoryCheckoutSendsSlackNotificationWhenSettingEnabled() { $this->settings->enableSlackWebhook(); @@ -59,7 +59,7 @@ final class SlackNotificationsUponCheckoutTest extends TestCase $this->assertSlackNotificationSent(CheckoutAccessoryNotification::class); } - public function testAccessoryCheckoutDoesNotSendSlackNotificationWhenSettingDisabled(): void + public function testAccessoryCheckoutDoesNotSendSlackNotificationWhenSettingDisabled() { $this->settings->disableSlackWebhook(); @@ -72,7 +72,7 @@ final class SlackNotificationsUponCheckoutTest extends TestCase } #[DataProvider('assetCheckoutTargets')] - public function testAssetCheckoutSendsSlackNotificationWhenSettingEnabled($checkoutTarget): void + public function testAssetCheckoutSendsSlackNotificationWhenSettingEnabled($checkoutTarget) { $this->settings->enableSlackWebhook(); @@ -85,7 +85,7 @@ final class SlackNotificationsUponCheckoutTest extends TestCase } #[DataProvider('assetCheckoutTargets')] - public function testAssetCheckoutDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget): void + public function testAssetCheckoutDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget) { $this->settings->disableSlackWebhook(); @@ -97,7 +97,7 @@ final class SlackNotificationsUponCheckoutTest extends TestCase $this->assertNoSlackNotificationSent(CheckoutAssetNotification::class); } - public function testComponentCheckoutDoesNotSendSlackNotification(): void + public function testComponentCheckoutDoesNotSendSlackNotification() { $this->settings->enableSlackWebhook(); @@ -109,7 +109,7 @@ final class SlackNotificationsUponCheckoutTest extends TestCase Notification::assertNothingSent(); } - public function testConsumableCheckoutSendsSlackNotificationWhenSettingEnabled(): void + public function testConsumableCheckoutSendsSlackNotificationWhenSettingEnabled() { $this->settings->enableSlackWebhook(); @@ -121,7 +121,7 @@ final class SlackNotificationsUponCheckoutTest extends TestCase $this->assertSlackNotificationSent(CheckoutConsumableNotification::class); } - public function testConsumableCheckoutDoesNotSendSlackNotificationWhenSettingDisabled(): void + public function testConsumableCheckoutDoesNotSendSlackNotificationWhenSettingDisabled() { $this->settings->disableSlackWebhook(); @@ -134,7 +134,7 @@ final class SlackNotificationsUponCheckoutTest extends TestCase } #[DataProvider('licenseCheckoutTargets')] - public function testLicenseCheckoutSendsSlackNotificationWhenSettingEnabled($checkoutTarget): void + public function testLicenseCheckoutSendsSlackNotificationWhenSettingEnabled($checkoutTarget) { $this->settings->enableSlackWebhook(); @@ -147,7 +147,7 @@ final class SlackNotificationsUponCheckoutTest extends TestCase } #[DataProvider('licenseCheckoutTargets')] - public function testLicenseCheckoutDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget): void + public function testLicenseCheckoutDoesNotSendSlackNotificationWhenSettingDisabled($checkoutTarget) { $this->settings->disableSlackWebhook(); diff --git a/tests/Feature/Reporting/CustomReportTest.php b/tests/Feature/Reporting/CustomReportTest.php index ce2053c162..89dcafa2c8 100644 --- a/tests/Feature/Reporting/CustomReportTest.php +++ b/tests/Feature/Reporting/CustomReportTest.php @@ -43,7 +43,7 @@ final class CustomReportTest extends TestCase ); } - public function testCustomAssetReport(): void + public function testCustomAssetReport() { Asset::factory()->create(['name' => 'Asset A']); Asset::factory()->create(['name' => 'Asset B']); @@ -59,7 +59,7 @@ final class CustomReportTest extends TestCase ->assertSeeTextInStreamedResponse('Asset B'); } - public function testCustomAssetReportAdheresToCompanyScoping(): void + public function testCustomAssetReportAdheresToCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); @@ -105,7 +105,7 @@ final class CustomReportTest extends TestCase ->assertSeeTextInStreamedResponse('Asset B'); } - public function testCanLimitAssetsByLastCheckIn(): void + public function testCanLimitAssetsByLastCheckIn() { Asset::factory()->create(['name' => 'Asset A', 'last_checkin' => '2023-08-01']); Asset::factory()->create(['name' => 'Asset B', 'last_checkin' => '2023-08-02']); diff --git a/tests/Feature/Reporting/UnacceptedAssetReportTest.php b/tests/Feature/Reporting/UnacceptedAssetReportTest.php index c987e82766..90ef96bc85 100644 --- a/tests/Feature/Reporting/UnacceptedAssetReportTest.php +++ b/tests/Feature/Reporting/UnacceptedAssetReportTest.php @@ -44,14 +44,14 @@ final class UnacceptedAssetReportTest extends TestCase } - public function testPermissionRequiredToViewUnacceptedAssetReport(): void + public function testPermissionRequiredToViewUnacceptedAssetReport() { $this->actingAs(User::factory()->create()) ->get(route('reports/unaccepted_assets')) ->assertForbidden(); } - public function testUserCanListUnacceptedAssets(): void + public function testUserCanListUnacceptedAssets() { $this->actingAs(User::factory()->superuser()->create()) ->get(route('reports/unaccepted_assets')) diff --git a/tests/Feature/Settings/BrandingSettingsTest.php b/tests/Feature/Settings/BrandingSettingsTest.php index 4262b63e5d..1543bdce9a 100644 --- a/tests/Feature/Settings/BrandingSettingsTest.php +++ b/tests/Feature/Settings/BrandingSettingsTest.php @@ -12,7 +12,7 @@ use App\Models\Setting; final class BrandingSettingsTest extends TestCase { - public function testSiteNameIsRequired(): void + public function testSiteNameIsRequired() { $response = $this->actingAs(User::factory()->superuser()->create()) ->from(route('settings.branding.index')) @@ -25,7 +25,7 @@ final class BrandingSettingsTest extends TestCase $this->followRedirects($response)->assertSee(trans('general.error')); } - public function testSiteNameCanBeSaved(): void + public function testSiteNameCanBeSaved() { $response = $this->actingAs(User::factory()->superuser()->create()) ->post(route('settings.branding.save', ['site_name' => 'My Awesome Site'])) @@ -38,7 +38,7 @@ final class BrandingSettingsTest extends TestCase } - public function testLogoCanBeUploaded(): void + public function testLogoCanBeUploaded() { Storage::fake('public'); $setting = Setting::factory()->create(['logo' => null]); @@ -58,7 +58,7 @@ final class BrandingSettingsTest extends TestCase Storage::disk('public')->assertExists($setting->logo); } - public function testLogoCanBeDeleted(): void + public function testLogoCanBeDeleted() { Storage::fake('public'); @@ -82,7 +82,7 @@ final class BrandingSettingsTest extends TestCase //Storage::disk('public')->assertMissing($original_file); } - public function testEmailLogoCanBeUploaded(): void + public function testEmailLogoCanBeUploaded() { Storage::fake('public'); @@ -108,7 +108,7 @@ final class BrandingSettingsTest extends TestCase // Storage::disk('public')->assertMissing($original_file); } - public function testEmailLogoCanBeDeleted(): void + public function testEmailLogoCanBeDeleted() { Storage::fake('public'); @@ -135,7 +135,7 @@ final class BrandingSettingsTest extends TestCase } - public function testLabelLogoCanBeUploaded(): void + public function testLabelLogoCanBeUploaded() { Storage::fake('public'); @@ -164,7 +164,7 @@ final class BrandingSettingsTest extends TestCase } - public function testLabelLogoCanBeDeleted(): void + public function testLabelLogoCanBeDeleted() { Storage::fake('public'); @@ -191,7 +191,7 @@ final class BrandingSettingsTest extends TestCase } - public function testDefaultAvatarCanBeUploaded(): void + public function testDefaultAvatarCanBeUploaded() { Storage::fake('public'); @@ -213,7 +213,7 @@ final class BrandingSettingsTest extends TestCase // Storage::disk('public')->assertMissing($original_file); } - public function testDefaultAvatarCanBeDeleted(): void + public function testDefaultAvatarCanBeDeleted() { Storage::fake('public'); @@ -238,7 +238,7 @@ final class BrandingSettingsTest extends TestCase // Storage::disk('public')->assertMissing($original_file); } - public function testSnipeDefaultAvatarCanBeDeleted(): void + public function testSnipeDefaultAvatarCanBeDeleted() { $setting = Setting::getSettings()->first(); @@ -263,7 +263,7 @@ final class BrandingSettingsTest extends TestCase } - public function testFaviconCanBeUploaded(): void + public function testFaviconCanBeUploaded() { $this->markTestIncomplete('This fails mimetype validation on the mock'); Storage::fake('public'); @@ -284,7 +284,7 @@ final class BrandingSettingsTest extends TestCase Storage::disk('public')->assertExists('favicon.png'); } - public function testFaviconCanBeDeleted(): void + public function testFaviconCanBeDeleted() { $this->markTestIncomplete('This fails mimetype validation on the mock'); Storage::fake('public'); diff --git a/tests/Feature/Settings/ShowSetUpPageTest.php b/tests/Feature/Settings/ShowSetUpPageTest.php index 511b31fe4a..83b0a1e3f0 100644 --- a/tests/Feature/Settings/ShowSetUpPageTest.php +++ b/tests/Feature/Settings/ShowSetUpPageTest.php @@ -302,7 +302,7 @@ final class ShowSetUpPageTest extends TestCase $this->assertSeeDirectoryPermissionError(false); } - public function testInvalidTLSCertsOkWhenCheckingForEnvFile(): void + public function testInvalidTLSCertsOkWhenCheckingForEnvFile() { //set the weird bad SSL cert place - https://self-signed.badssl.com $this->markTestIncomplete("Not yet sure how to write this test, it requires messing with .env ..."); diff --git a/tests/Feature/Users/Api/DeleteUserTest.php b/tests/Feature/Users/Api/DeleteUserTest.php index 070a40092b..2c134ccc64 100644 --- a/tests/Feature/Users/Api/DeleteUserTest.php +++ b/tests/Feature/Users/Api/DeleteUserTest.php @@ -12,7 +12,7 @@ final class DeleteUserTest extends TestCase { - public function testErrorReturnedViaApiIfUserDoesNotExist(): void + public function testErrorReturnedViaApiIfUserDoesNotExist() { $this->actingAsForApi(User::factory()->deleteUsers()->create()) ->deleteJson(route('api.users.destroy', 'invalid-id')) @@ -22,7 +22,7 @@ final class DeleteUserTest extends TestCase ->json(); } - public function testErrorReturnedViaApiIfUserIsAlreadyDeleted(): void + public function testErrorReturnedViaApiIfUserIsAlreadyDeleted() { $user = User::factory()->deletedUser()->create(); $this->actingAsForApi(User::factory()->deleteUsers()->create()) @@ -34,7 +34,7 @@ final class DeleteUserTest extends TestCase } - public function testDisallowUserDeletionViaApiIfStillManagingPeople(): void + public function testDisallowUserDeletionViaApiIfStillManagingPeople() { $manager = User::factory()->create(); User::factory()->count(5)->create(['manager_id' => $manager->id]); @@ -48,7 +48,7 @@ final class DeleteUserTest extends TestCase ->json(); } - public function testDisallowUserDeletionViaApiIfStillManagingLocations(): void + public function testDisallowUserDeletionViaApiIfStillManagingLocations() { $manager = User::factory()->create(); Location::factory()->count(5)->create(['manager_id' => $manager->id]); @@ -63,7 +63,7 @@ final class DeleteUserTest extends TestCase ->json(); } - public function testDisallowUserDeletionViaApiIfStillHasLicenses(): void + public function testDisallowUserDeletionViaApiIfStillHasLicenses() { $manager = User::factory()->create(); LicenseSeat::factory()->count(5)->create(['assigned_to' => $manager->id]); @@ -78,7 +78,7 @@ final class DeleteUserTest extends TestCase ->json(); } - public function testDeniedPermissionsForDeletingUserViaApi(): void + public function testDeniedPermissionsForDeletingUserViaApi() { $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.users.destroy', User::factory()->create())) @@ -86,7 +86,7 @@ final class DeleteUserTest extends TestCase ->json(); } - public function testSuccessPermissionsForDeletingUserViaApi(): void + public function testSuccessPermissionsForDeletingUserViaApi() { $this->actingAsForApi(User::factory()->deleteUsers()->create()) ->deleteJson(route('api.users.destroy', User::factory()->create())) @@ -97,7 +97,7 @@ final class DeleteUserTest extends TestCase } - public function testPermissionsForDeletingIfNotInSameCompanyAndNotSuperadmin(): void + public function testPermissionsForDeletingIfNotInSameCompanyAndNotSuperadmin() { $this->settings->enableMultipleFullCompanySupport(); @@ -139,7 +139,7 @@ final class DeleteUserTest extends TestCase } - public function testUsersCannotDeleteThemselves(): void + public function testUsersCannotDeleteThemselves() { $user = User::factory()->deleteUsers()->create(); $this->actingAsForApi($user) diff --git a/tests/Feature/Users/Api/RestoreUserTest.php b/tests/Feature/Users/Api/RestoreUserTest.php index 11c5e33d07..709c2ac0fc 100644 --- a/tests/Feature/Users/Api/RestoreUserTest.php +++ b/tests/Feature/Users/Api/RestoreUserTest.php @@ -12,7 +12,7 @@ final class RestoreUserTest extends TestCase { - public function testErrorReturnedViaApiIfUserDoesNotExist(): void + public function testErrorReturnedViaApiIfUserDoesNotExist() { $this->actingAsForApi(User::factory()->deleteUsers()->create()) ->postJson(route('api.users.restore', 'invalid-id')) @@ -22,7 +22,7 @@ final class RestoreUserTest extends TestCase ->json(); } - public function testErrorReturnedViaApiIfUserIsNotDeleted(): void + public function testErrorReturnedViaApiIfUserIsNotDeleted() { $user = User::factory()->create(); $this->actingAsForApi(User::factory()->deleteUsers()->create()) @@ -34,7 +34,7 @@ final class RestoreUserTest extends TestCase } - public function testDeniedPermissionsForRestoringUserViaApi(): void + public function testDeniedPermissionsForRestoringUserViaApi() { $this->actingAsForApi(User::factory()->create()) ->postJson(route('api.users.restore', User::factory()->deletedUser()->create())) @@ -42,7 +42,7 @@ final class RestoreUserTest extends TestCase ->json(); } - public function testSuccessPermissionsForRestoringUserViaApi(): void + public function testSuccessPermissionsForRestoringUserViaApi() { $deleted_user = User::factory()->deletedUser()->create(); @@ -57,7 +57,7 @@ final class RestoreUserTest extends TestCase $this->assertNull($deleted_user->deleted_at); } - public function testPermissionsForRestoringIfNotInSameCompanyAndNotSuperadmin(): void + public function testPermissionsForRestoringIfNotInSameCompanyAndNotSuperadmin() { $this->settings->enableMultipleFullCompanySupport(); diff --git a/tests/Feature/Users/Api/UpdateUserTest.php b/tests/Feature/Users/Api/UpdateUserTest.php index de6cf116ae..918d7f0886 100644 --- a/tests/Feature/Users/Api/UpdateUserTest.php +++ b/tests/Feature/Users/Api/UpdateUserTest.php @@ -12,7 +12,7 @@ use Tests\TestCase; final class UpdateUserTest extends TestCase { - public function testCanUpdateUserViaPatch(): void + public function testCanUpdateUserViaPatch() { $admin = User::factory()->superuser()->create(); $manager = User::factory()->create(); @@ -82,7 +82,7 @@ final class UpdateUserTest extends TestCase $this->assertTrue($user->groups->contains($groupB), 'Not part of expected group'); } - public function testApiUsersCanBeActivatedWithNumber(): void + public function testApiUsersCanBeActivatedWithNumber() { $admin = User::factory()->superuser()->create(); $user = User::factory()->create(['activated' => 0]); @@ -95,7 +95,7 @@ final class UpdateUserTest extends TestCase $this->assertEquals(1, $user->refresh()->activated); } - public function testApiUsersCanBeActivatedWithBooleanTrue(): void + public function testApiUsersCanBeActivatedWithBooleanTrue() { $admin = User::factory()->superuser()->create(); $user = User::factory()->create(['activated' => false]); @@ -108,7 +108,7 @@ final class UpdateUserTest extends TestCase $this->assertEquals(1, $user->refresh()->activated); } - public function testApiUsersCanBeDeactivatedWithNumber(): void + public function testApiUsersCanBeDeactivatedWithNumber() { $admin = User::factory()->superuser()->create(); $user = User::factory()->create(['activated' => true]); @@ -121,7 +121,7 @@ final class UpdateUserTest extends TestCase $this->assertEquals(0, $user->refresh()->activated); } - public function testApiUsersCanBeDeactivatedWithBooleanFalse(): void + public function testApiUsersCanBeDeactivatedWithBooleanFalse() { $admin = User::factory()->superuser()->create(); $user = User::factory()->create(['activated' => true]); @@ -134,7 +134,7 @@ final class UpdateUserTest extends TestCase $this->assertEquals(0, $user->refresh()->activated); } - public function testUsersScopedToCompanyDuringUpdateWhenMultipleFullCompanySupportEnabled(): void + public function testUsersScopedToCompanyDuringUpdateWhenMultipleFullCompanySupportEnabled() { $this->settings->enableMultipleFullCompanySupport(); @@ -223,7 +223,7 @@ final class UpdateUserTest extends TestCase ->json(); } - public function testUserGroupsAreOnlyUpdatedIfAuthenticatedUserIsSuperUser(): void + public function testUserGroupsAreOnlyUpdatedIfAuthenticatedUserIsSuperUser() { $groupToJoin = Group::factory()->create(); @@ -250,7 +250,7 @@ final class UpdateUserTest extends TestCase $this->assertTrue($userToUpdateByToUserBySuperuser->refresh()->groups->contains($groupToJoin)); } - public function testUserGroupsCanBeClearedBySuperUser(): void + public function testUserGroupsCanBeClearedBySuperUser() { $normalUser = User::factory()->editUsers()->create(); $superUser = User::factory()->superuser()->create(); @@ -276,7 +276,7 @@ final class UpdateUserTest extends TestCase $this->assertFalse($anotherUserToUpdate->refresh()->groups->contains($joinedGroup)); } - public function testNonSuperuserCannotUpdateOwnGroups(): void + public function testNonSuperuserCannotUpdateOwnGroups() { $groupToJoin = Group::factory()->create(); $user = User::factory()->editUsers()->create(); @@ -292,7 +292,7 @@ final class UpdateUserTest extends TestCase } - public function testNonSuperuserCannotUpdateGroups(): void + public function testNonSuperuserCannotUpdateGroups() { $user = User::factory()->editUsers()->create(); $group = Group::factory()->create(); @@ -313,7 +313,7 @@ final class UpdateUserTest extends TestCase } - public function testUsersGroupsAreNotClearedIfNoGroupPassedBySuperUser(): void + public function testUsersGroupsAreNotClearedIfNoGroupPassedBySuperUser() { $user = User::factory()->create(); $superUser = User::factory()->superuser()->create(); @@ -327,7 +327,7 @@ final class UpdateUserTest extends TestCase $this->assertTrue($user->refresh()->groups->contains($group)); } - public function testMultipleGroupsUpdateBySuperUser(): void + public function testMultipleGroupsUpdateBySuperUser() { $user = User::factory()->create(); $superUser = User::factory()->superuser()->create(); diff --git a/tests/Feature/Users/Api/UserSearchTest.php b/tests/Feature/Users/Api/UserSearchTest.php index 5dea41aa64..8478171c75 100644 --- a/tests/Feature/Users/Api/UserSearchTest.php +++ b/tests/Feature/Users/Api/UserSearchTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class UserSearchTest extends TestCase { - public function testCanSearchByUserFirstAndLastName(): void + public function testCanSearchByUserFirstAndLastName() { User::factory()->create(['first_name' => 'Luke', 'last_name' => 'Skywalker']); User::factory()->create(['first_name' => 'Darth', 'last_name' => 'Vader']); @@ -24,7 +24,7 @@ final class UserSearchTest extends TestCase $this->assertFalse($results->pluck('name')->contains(fn($text) => str_contains($text, 'Darth'))); } - public function testResultsWhenSearchingForActiveUsers(): void + public function testResultsWhenSearchingForActiveUsers() { User::factory()->create(['first_name' => 'Active', 'last_name' => 'User']); User::factory()->create(['first_name' => 'Deleted', 'last_name' => 'User'])->delete(); @@ -53,7 +53,7 @@ final class UserSearchTest extends TestCase ); } - public function testResultsWhenSearchingForDeletedUsers(): void + public function testResultsWhenSearchingForDeletedUsers() { User::factory()->create(['first_name' => 'Active', 'last_name' => 'User']); User::factory()->create(['first_name' => 'Deleted', 'last_name' => 'User'])->delete(); @@ -82,7 +82,7 @@ final class UserSearchTest extends TestCase ); } - public function testUsersScopedToCompanyWhenMultipleFullCompanySupportEnabled(): void + public function testUsersScopedToCompanyWhenMultipleFullCompanySupportEnabled() { $this->settings->enableMultipleFullCompanySupport(); @@ -110,7 +110,7 @@ final class UserSearchTest extends TestCase ); } - public function testUsersScopedToCompanyDuringSearchWhenMultipleFullCompanySupportEnabled(): void + public function testUsersScopedToCompanyDuringSearchWhenMultipleFullCompanySupportEnabled() { $this->settings->enableMultipleFullCompanySupport(); @@ -145,7 +145,7 @@ final class UserSearchTest extends TestCase ); } - public function testUsersIndexWhenInvalidSortFieldIsPassed(): void + public function testUsersIndexWhenInvalidSortFieldIsPassed() { $this->markIncompleteIfSqlite('This test is not compatible with SQLite'); diff --git a/tests/Feature/Users/Api/UsersForSelectListTest.php b/tests/Feature/Users/Api/UsersForSelectListTest.php index 2921bc4188..237ee57c83 100644 --- a/tests/Feature/Users/Api/UsersForSelectListTest.php +++ b/tests/Feature/Users/Api/UsersForSelectListTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; final class UsersForSelectListTest extends TestCase { - public function testUsersAreReturned(): void + public function testUsersAreReturned() { $users = User::factory()->superuser()->count(3)->create(); @@ -27,7 +27,7 @@ final class UsersForSelectListTest extends TestCase ->assertJson(fn(AssertableJson $json) => $json->has('results', 3)->etc()); } - public function testUsersCanBeSearchedByFirstAndLastName(): void + public function testUsersCanBeSearchedByFirstAndLastName() { User::factory()->create(['first_name' => 'Luke', 'last_name' => 'Skywalker']); @@ -40,7 +40,7 @@ final class UsersForSelectListTest extends TestCase $this->assertTrue($results->pluck('text')->contains(fn($text) => str_contains($text, 'Luke'))); } - public function testUsersScopedToCompanyWhenMultipleFullCompanySupportEnabled(): void + public function testUsersScopedToCompanyWhenMultipleFullCompanySupportEnabled() { $this->settings->enableMultipleFullCompanySupport(); @@ -68,7 +68,7 @@ final class UsersForSelectListTest extends TestCase ); } - public function testUsersScopedToCompanyDuringSearchWhenMultipleFullCompanySupportEnabled(): void + public function testUsersScopedToCompanyDuringSearchWhenMultipleFullCompanySupportEnabled() { $this->settings->enableMultipleFullCompanySupport(); diff --git a/tests/Feature/Users/Api/ViewUserTest.php b/tests/Feature/Users/Api/ViewUserTest.php index 738907e5a3..325c8ec1f4 100644 --- a/tests/Feature/Users/Api/ViewUserTest.php +++ b/tests/Feature/Users/Api/ViewUserTest.php @@ -11,7 +11,7 @@ use Tests\TestCase; final class ViewUserTest extends TestCase { - public function testCanReturnUser(): void + public function testCanReturnUser() { $user = User::factory()->create(); diff --git a/tests/Feature/Users/Ui/DeleteUserTest.php b/tests/Feature/Users/Ui/DeleteUserTest.php index 6dd5d84f71..6d71041d61 100644 --- a/tests/Feature/Users/Ui/DeleteUserTest.php +++ b/tests/Feature/Users/Ui/DeleteUserTest.php @@ -14,7 +14,7 @@ use App\Models\Asset; final class DeleteUserTest extends TestCase { - public function testUserCanDeleteAnotherUser(): void + public function testUserCanDeleteAnotherUser() { $user = User::factory()->deleteUsers()->viewUsers()->create(); $this->actingAs(User::factory()->deleteUsers()->viewUsers()->create())->assertTrue($user->isDeletable()); @@ -28,7 +28,7 @@ final class DeleteUserTest extends TestCase } - public function testErrorReturnedIfUserDoesNotExist(): void + public function testErrorReturnedIfUserDoesNotExist() { $response = $this->actingAs(User::factory()->deleteUsers()->viewUsers()->create()) ->delete(route('users.destroy', ['user' => '40596803548609346'])) @@ -37,7 +37,7 @@ final class DeleteUserTest extends TestCase $this->followRedirects($response)->assertSee(trans('alert-danger')); } - public function testErrorReturnedIfUserIsAlreadyDeleted(): void + public function testErrorReturnedIfUserIsAlreadyDeleted() { $user = User::factory()->deletedUser()->viewUsers()->create(); $response = $this->actingAs(User::factory()->deleteUsers()->viewUsers()->create()) @@ -49,7 +49,7 @@ final class DeleteUserTest extends TestCase } - public function testFmcsPermissionsToDeleteUser(): void + public function testFmcsPermissionsToDeleteUser() { $this->settings->enableMultipleFullCompanySupport(); @@ -90,7 +90,7 @@ final class DeleteUserTest extends TestCase } - public function testDisallowUserDeletionIfStillManagingPeople(): void + public function testDisallowUserDeletionIfStillManagingPeople() { $manager = User::factory()->create(); User::factory()->count(1)->create(['manager_id' => $manager->id]); @@ -105,7 +105,7 @@ final class DeleteUserTest extends TestCase $this->followRedirects($response)->assertSee('Error'); } - public function testDisallowUserDeletionIfStillManagingLocations(): void + public function testDisallowUserDeletionIfStillManagingLocations() { $manager = User::factory()->create(); Location::factory()->count(2)->create(['manager_id' => $manager->id]); @@ -120,7 +120,7 @@ final class DeleteUserTest extends TestCase $this->followRedirects($response)->assertSee('Error'); } - public function testDisallowUserDeletionIfStillHaveAccessories(): void + public function testDisallowUserDeletionIfStillHaveAccessories() { $user = User::factory()->create(); Accessory::factory()->count(3)->checkedOutToUser($user)->create(); @@ -135,7 +135,7 @@ final class DeleteUserTest extends TestCase $this->followRedirects($response)->assertSee('Error'); } - public function testDisallowUserDeletionIfStillHaveLicenses(): void + public function testDisallowUserDeletionIfStillHaveLicenses() { $user = User::factory()->create(); LicenseSeat::factory()->count(4)->create(['assigned_to' => $user->id]); @@ -151,7 +151,7 @@ final class DeleteUserTest extends TestCase } - public function testAllowUserDeletionIfNotManagingLocations(): void + public function testAllowUserDeletionIfNotManagingLocations() { $manager = User::factory()->create(); $this->actingAs(User::factory()->deleteUsers()->viewUsers()->create())->assertTrue($manager->isDeletable()); @@ -165,14 +165,14 @@ final class DeleteUserTest extends TestCase } - public function testDisallowUserDeletionIfNoDeletePermissions(): void + public function testDisallowUserDeletionIfNoDeletePermissions() { $manager = User::factory()->create(); Location::factory()->create(['manager_id' => $manager->id]); $this->actingAs(User::factory()->editUsers()->viewUsers()->create())->assertFalse($manager->isDeletable()); } - public function testDisallowUserDeletionIfTheyStillHaveAssets(): void + public function testDisallowUserDeletionIfTheyStillHaveAssets() { $user = User::factory()->create(); $asset = Asset::factory()->create(); @@ -195,7 +195,7 @@ final class DeleteUserTest extends TestCase } - public function testUsersCannotDeleteThemselves(): void + public function testUsersCannotDeleteThemselves() { $manager = User::factory()->deleteUsers()->viewUsers()->create(); $this->actingAs(User::factory()->deleteUsers()->viewUsers()->create())->assertTrue($manager->isDeletable()); diff --git a/tests/Feature/Users/Ui/MergeUsersTest.php b/tests/Feature/Users/Ui/MergeUsersTest.php index 7877e94fb1..2685a72e88 100644 --- a/tests/Feature/Users/Ui/MergeUsersTest.php +++ b/tests/Feature/Users/Ui/MergeUsersTest.php @@ -13,7 +13,7 @@ use Tests\TestCase; final class MergeUsersTest extends TestCase { - public function testAssetsAreTransferredOnUserMerge(): void + public function testAssetsAreTransferredOnUserMerge() { $user1 = User::factory()->create(); $user2 = User::factory()->create(); @@ -39,7 +39,7 @@ final class MergeUsersTest extends TestCase } - public function testLicensesAreTransferredOnUserMerge(): void + public function testLicensesAreTransferredOnUserMerge() { $user1 = User::factory()->create(); $user2 = User::factory()->create(); @@ -67,7 +67,7 @@ final class MergeUsersTest extends TestCase } - public function testAccessoriesTransferredOnUserMerge(): void + public function testAccessoriesTransferredOnUserMerge() { $user1 = User::factory()->create(); $user2 = User::factory()->create(); @@ -95,7 +95,7 @@ final class MergeUsersTest extends TestCase } - public function testConsumablesTransferredOnUserMerge(): void + public function testConsumablesTransferredOnUserMerge() { $user1 = User::factory()->create(); $user2 = User::factory()->create(); @@ -123,7 +123,7 @@ final class MergeUsersTest extends TestCase } - public function testFilesAreTransferredOnUserMerge(): void + public function testFilesAreTransferredOnUserMerge() { $user1 = User::factory()->create(); $user2 = User::factory()->create(); @@ -151,7 +151,7 @@ final class MergeUsersTest extends TestCase } - public function testAcceptancesAreTransferredOnUserMerge(): void + public function testAcceptancesAreTransferredOnUserMerge() { $user1 = User::factory()->create(); $user2 = User::factory()->create(); @@ -179,7 +179,7 @@ final class MergeUsersTest extends TestCase } - public function testUserUpdateHistoryIsTransferredOnUserMerge(): void + public function testUserUpdateHistoryIsTransferredOnUserMerge() { $user1 = User::factory()->create(); $user2 = User::factory()->create(); diff --git a/tests/Feature/Users/Ui/UpdateUserTest.php b/tests/Feature/Users/Ui/UpdateUserTest.php index 9d8cc04dfc..89c005b590 100644 --- a/tests/Feature/Users/Ui/UpdateUserTest.php +++ b/tests/Feature/Users/Ui/UpdateUserTest.php @@ -7,7 +7,7 @@ use Tests\TestCase; final class UpdateUserTest extends TestCase { - public function testUsersCanBeActivatedWithNumber(): void + public function testUsersCanBeActivatedWithNumber() { $admin = User::factory()->superuser()->create(); $user = User::factory()->create(['activated' => 0]); @@ -22,7 +22,7 @@ final class UpdateUserTest extends TestCase $this->assertEquals(1, $user->refresh()->activated); } - public function testUsersCanBeActivatedWithBooleanTrue(): void + public function testUsersCanBeActivatedWithBooleanTrue() { $admin = User::factory()->superuser()->create(); $user = User::factory()->create(['activated' => false]); @@ -37,7 +37,7 @@ final class UpdateUserTest extends TestCase $this->assertEquals(1, $user->refresh()->activated); } - public function testUsersCanBeDeactivatedWithNumber(): void + public function testUsersCanBeDeactivatedWithNumber() { $admin = User::factory()->superuser()->create(); $user = User::factory()->create(['activated' => true]); @@ -52,7 +52,7 @@ final class UpdateUserTest extends TestCase $this->assertEquals(0, $user->refresh()->activated); } - public function testUsersCanBeDeactivatedWithBooleanFalse(): void + public function testUsersCanBeDeactivatedWithBooleanFalse() { $admin = User::factory()->superuser()->create(); $user = User::factory()->create(['activated' => true]); @@ -67,7 +67,7 @@ final class UpdateUserTest extends TestCase $this->assertEquals(0, $user->refresh()->activated); } - public function testUsersUpdatingThemselvesDoNotDeactivateTheirAccount(): void + public function testUsersUpdatingThemselvesDoNotDeactivateTheirAccount() { $admin = User::factory()->superuser()->create(['activated' => true]); diff --git a/tests/Feature/Users/Ui/ViewUserTest.php b/tests/Feature/Users/Ui/ViewUserTest.php index 111e950f27..d28bbb6d31 100644 --- a/tests/Feature/Users/Ui/ViewUserTest.php +++ b/tests/Feature/Users/Ui/ViewUserTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; final class ViewUserTest extends TestCase { - public function testPermissionsForUserDetailPage(): void + public function testPermissionsForUserDetailPage() { $this->settings->enableMultipleFullCompanySupport(); @@ -29,7 +29,7 @@ final class ViewUserTest extends TestCase ->assertStatus(200); } - public function testPermissionsForPrintAllInventoryPage(): void + public function testPermissionsForPrintAllInventoryPage() { $this->settings->enableMultipleFullCompanySupport(); @@ -52,7 +52,7 @@ final class ViewUserTest extends TestCase ->assertStatus(200); } - public function testUserWithoutCompanyPermissionsCannotSendInventory(): void + public function testUserWithoutCompanyPermissionsCannotSendInventory() { Notification::fake(); diff --git a/tests/Unit/AccessoryTest.php b/tests/Unit/AccessoryTest.php index 98021c5094..2ce1b96242 100644 --- a/tests/Unit/AccessoryTest.php +++ b/tests/Unit/AccessoryTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; final class AccessoryTest extends TestCase { - public function testAnAccessoryBelongsToACompany(): void + public function testAnAccessoryBelongsToACompany() { $accessory = Accessory::factory() ->create( @@ -20,7 +20,7 @@ final class AccessoryTest extends TestCase $this->assertInstanceOf(Company::class, $accessory->company); } - public function testAnAccessoryHasALocation(): void + public function testAnAccessoryHasALocation() { $accessory = Accessory::factory() ->create( @@ -30,7 +30,7 @@ final class AccessoryTest extends TestCase $this->assertInstanceOf(Location::class, $accessory->location); } - public function testAnAccessoryBelongsToACategory(): void + public function testAnAccessoryBelongsToACategory() { $accessory = Accessory::factory()->appleBtKeyboard() ->create( @@ -45,7 +45,7 @@ final class AccessoryTest extends TestCase $this->assertEquals('accessory', $accessory->category->category_type); } - public function testAnAccessoryHasAManufacturer(): void + public function testAnAccessoryHasAManufacturer() { $accessory = Accessory::factory()->appleBtKeyboard()->create( [ diff --git a/tests/Unit/AssetMaintenanceTest.php b/tests/Unit/AssetMaintenanceTest.php index f033ba9b8f..50ccaac357 100644 --- a/tests/Unit/AssetMaintenanceTest.php +++ b/tests/Unit/AssetMaintenanceTest.php @@ -6,7 +6,7 @@ use Tests\TestCase; final class AssetMaintenanceTest extends TestCase { - public function testZerosOutWarrantyIfBlank(): void + public function testZerosOutWarrantyIfBlank() { $c = new AssetMaintenance; $c->is_warranty = ''; @@ -15,7 +15,7 @@ final class AssetMaintenanceTest extends TestCase $this->assertTrue($c->is_warranty == 4); } - public function testSetsCostsAppropriately(): void + public function testSetsCostsAppropriately() { $c = new AssetMaintenance(); $c->cost = '0.00'; @@ -26,7 +26,7 @@ final class AssetMaintenanceTest extends TestCase $this->assertTrue($c->cost === 9.5); } - public function testNullsOutNotesIfBlank(): void + public function testNullsOutNotesIfBlank() { $c = new AssetMaintenance; $c->notes = ''; @@ -35,7 +35,7 @@ final class AssetMaintenanceTest extends TestCase $this->assertTrue($c->notes === 'This is a long note'); } - public function testNullsOutCompletionDateIfBlankOrInvalid(): void + public function testNullsOutCompletionDateIfBlankOrInvalid() { $c = new AssetMaintenance; $c->completion_date = ''; diff --git a/tests/Unit/AssetModelTest.php b/tests/Unit/AssetModelTest.php index 9e4f8920f4..57ac292f73 100644 --- a/tests/Unit/AssetModelTest.php +++ b/tests/Unit/AssetModelTest.php @@ -8,7 +8,7 @@ use Tests\TestCase; final class AssetModelTest extends TestCase { - public function testAnAssetModelContainsAssets(): void + public function testAnAssetModelContainsAssets() { $category = Category::factory()->create([ 'category_type' => 'asset' diff --git a/tests/Unit/AssetTest.php b/tests/Unit/AssetTest.php index 34b1876604..7ba468ee3f 100644 --- a/tests/Unit/AssetTest.php +++ b/tests/Unit/AssetTest.php @@ -10,7 +10,7 @@ use App\Models\Setting; final class AssetTest extends TestCase { - public function testAutoIncrement(): void + public function testAutoIncrement() { $this->settings->enableAutoIncrement(); @@ -22,7 +22,7 @@ final class AssetTest extends TestCase } - public function testAutoIncrementCollision(): void + public function testAutoIncrementCollision() { $this->settings->enableAutoIncrement(); @@ -34,7 +34,7 @@ final class AssetTest extends TestCase $this->assertFalse($b->save()); } - public function testAutoIncrementDouble(): void + public function testAutoIncrementDouble() { // make one asset with the autoincrement *ONE* higher than the next auto-increment // make sure you can then still make another @@ -53,7 +53,7 @@ final class AssetTest extends TestCase $this->assertEquals($c->asset_tag, $final_number); } - public function testAutoIncrementGapAndBackfill(): void + public function testAutoIncrementGapAndBackfill() { // make one asset 3 higher than the next auto-increment // manually make one that's 1 lower than that @@ -82,7 +82,7 @@ final class AssetTest extends TestCase $this->assertEquals($final->asset_tag, $final_result); } - public function testPrefixlessAutoincrementBackfill(): void + public function testPrefixlessAutoincrementBackfill() { // TODO: COPYPASTA FROM above, is there a way to still run this test but not have it be so duplicative? $this->settings->enableAutoIncrement()->set(['auto_increment_prefix' => '']); @@ -109,7 +109,7 @@ final class AssetTest extends TestCase $this->assertEquals($final->asset_tag, $final_result); } - public function testUnzerofilledPrefixlessAutoincrementBackfill(): void + public function testUnzerofilledPrefixlessAutoincrementBackfill() { // TODO: COPYPASTA FROM above (AGAIN), is there a way to still run this test but not have it be so duplicative? $this->settings->enableAutoIncrement()->set(['auto_increment_prefix' => '','zerofill_count' => 0]); @@ -136,7 +136,7 @@ final class AssetTest extends TestCase $this->assertEquals($final->asset_tag, $final_result); } - public function testAutoIncrementBIG(): void + public function testAutoIncrementBIG() { $this->settings->enableAutoIncrement(); @@ -153,7 +153,7 @@ final class AssetTest extends TestCase $this->assertEquals(Setting::getSettings()->next_auto_tag_base, $matches[0] + 1, "Next auto increment number should be the last normally-saved one plus one, but isn't"); } - public function testAutoIncrementAlmostBIG(): void + public function testAutoIncrementAlmostBIG() { // TODO: this looks pretty close to the one above, could we maybe squish them together? $this->settings->enableAutoIncrement(); @@ -170,7 +170,7 @@ final class AssetTest extends TestCase } - public function testWarrantyExpiresAttribute(): void + public function testWarrantyExpiresAttribute() { $asset = Asset::factory() diff --git a/tests/Unit/CategoryTest.php b/tests/Unit/CategoryTest.php index 8e1fe83f83..75e79b0bd4 100644 --- a/tests/Unit/CategoryTest.php +++ b/tests/Unit/CategoryTest.php @@ -8,7 +8,7 @@ use Tests\TestCase; final class CategoryTest extends TestCase { - public function testFailsEmptyValidation(): void + public function testFailsEmptyValidation() { // An Asset requires a name, a qty, and a category_id. $a = Category::create(); @@ -24,7 +24,7 @@ final class CategoryTest extends TestCase } } - public function testACategoryCanHaveAssets(): void + public function testACategoryCanHaveAssets() { $category = Category::factory()->assetDesktopCategory()->create(); diff --git a/tests/Unit/CompanyScopingTest.php b/tests/Unit/CompanyScopingTest.php index a86a767dd0..664d6301fd 100644 --- a/tests/Unit/CompanyScopingTest.php +++ b/tests/Unit/CompanyScopingTest.php @@ -29,7 +29,7 @@ final class CompanyScopingTest extends TestCase } #[DataProvider('models')] - public function testCompanyScoping($model): void + public function testCompanyScoping($model) { [$companyA, $companyB] = Company::factory()->count(2)->create(); @@ -69,7 +69,7 @@ final class CompanyScopingTest extends TestCase $this->assertCanSee($modelB); } - public function testAssetMaintenanceCompanyScoping(): void + public function testAssetMaintenanceCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); @@ -109,7 +109,7 @@ final class CompanyScopingTest extends TestCase $this->assertCanSee($assetMaintenanceForCompanyB); } - public function testLicenseSeatCompanyScoping(): void + public function testLicenseSeatCompanyScoping() { [$companyA, $companyB] = Company::factory()->count(2)->create(); diff --git a/tests/Unit/ComponentTest.php b/tests/Unit/ComponentTest.php index 8d411bc7d2..d0f9605740 100644 --- a/tests/Unit/ComponentTest.php +++ b/tests/Unit/ComponentTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class ComponentTest extends TestCase { - public function testAComponentBelongsToACompany(): void + public function testAComponentBelongsToACompany() { $component = Component::factory() ->create( @@ -20,14 +20,14 @@ final class ComponentTest extends TestCase $this->assertInstanceOf(Company::class, $component->company); } - public function testAComponentHasALocation(): void + public function testAComponentHasALocation() { $component = Component::factory() ->create(['location_id' => Location::factory()->create()->id]); $this->assertInstanceOf(Location::class, $component->location); } - public function testAComponentBelongsToACategory(): void + public function testAComponentBelongsToACategory() { $component = Component::factory()->ramCrucial4() ->create( diff --git a/tests/Unit/CustomFieldTest.php b/tests/Unit/CustomFieldTest.php index 34b8f65758..da4272323b 100644 --- a/tests/Unit/CustomFieldTest.php +++ b/tests/Unit/CustomFieldTest.php @@ -10,14 +10,14 @@ use Tests\TestCase; */ final class CustomFieldTest extends TestCase { - public function testFormat(): void + public function testFormat() { $customfield = CustomField::factory()->make(['format' => 'IP']); $this->assertEquals($customfield->getAttributes()['format'], CustomField::PREDEFINED_FORMATS['IP']); //this seems undocumented... $this->assertEquals($customfield->format, 'IP'); } - public function testDbNameAscii(): void + public function testDbNameAscii() { $customfield = new CustomField(); $customfield->name = 'My hovercraft is full of eels'; @@ -26,7 +26,7 @@ final class CustomFieldTest extends TestCase } // Western Europe - public function testDbNameLatin(): void + public function testDbNameLatin() { $customfield = new CustomField(); $customfield->name = 'My hovercraft is full of eels'; @@ -35,7 +35,7 @@ final class CustomFieldTest extends TestCase } // Asian - public function testDbNameChinese(): void + public function testDbNameChinese() { $customfield = new CustomField(); $customfield->name = '我的氣墊船裝滿了鱔魚'; @@ -47,7 +47,7 @@ final class CustomFieldTest extends TestCase } } - public function testDbNameJapanese(): void + public function testDbNameJapanese() { $customfield = new CustomField(); $customfield->name = '私のホバークラフトは鰻でいっぱいです'; @@ -59,7 +59,7 @@ final class CustomFieldTest extends TestCase } } - public function testDbNameKorean(): void + public function testDbNameKorean() { $customfield = new CustomField(); $customfield->name = '내 호버크라프트는 장어로 가득 차 있어요'; @@ -72,7 +72,7 @@ final class CustomFieldTest extends TestCase } // Nordic languages - public function testDbNameNonLatinEuro(): void + public function testDbNameNonLatinEuro() { $customfield = new CustomField(); $customfield->name = 'Mój poduszkowiec jest pełen węgorzy'; @@ -85,7 +85,7 @@ final class CustomFieldTest extends TestCase } // - public function testDbNameTurkish(): void + public function testDbNameTurkish() { $customfield = new CustomField(); $customfield->name = 'Hoverkraftım yılan balığı dolu'; @@ -97,7 +97,7 @@ final class CustomFieldTest extends TestCase } } - public function testDbNameArabic(): void + public function testDbNameArabic() { $customfield = new CustomField(); $customfield->name = 'حَوّامتي مُمْتِلئة بِأَنْقَلَيْسون'; diff --git a/tests/Unit/DepreciationTest.php b/tests/Unit/DepreciationTest.php index 566c29fe10..c622eaa92b 100644 --- a/tests/Unit/DepreciationTest.php +++ b/tests/Unit/DepreciationTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class DepreciationTest extends TestCase { - public function testADepreciationHasModels(): void + public function testADepreciationHasModels() { $depreciation = Depreciation::factory()->create(); @@ -26,7 +26,7 @@ final class DepreciationTest extends TestCase $this->assertEquals(5, $depreciation->models->count()); } - public function testADepreciationHasLicenses(): void + public function testADepreciationHasLicenses() { $depreciation = Depreciation::factory()->create(); diff --git a/tests/Unit/Helpers/HelperTest.php b/tests/Unit/Helpers/HelperTest.php index 82a71fd915..dc06887e73 100644 --- a/tests/Unit/Helpers/HelperTest.php +++ b/tests/Unit/Helpers/HelperTest.php @@ -10,17 +10,17 @@ use Tests\TestCase; final class HelperTest extends TestCase { - public function testDefaultChartColorsMethodHandlesHighValues(): void + public function testDefaultChartColorsMethodHandlesHighValues() { $this->assertIsString(Helper::defaultChartColors(1000)); } - public function testDefaultChartColorsMethodHandlesNegativeNumbers(): void + public function testDefaultChartColorsMethodHandlesNegativeNumbers() { $this->assertIsString(Helper::defaultChartColors(-1)); } - public function testParseCurrencyMethod(): void + public function testParseCurrencyMethod() { $this->settings->set(['default_currency' => 'USD']); $this->assertSame(12.34, Helper::ParseCurrency('USD 12.34')); @@ -28,7 +28,7 @@ final class HelperTest extends TestCase $this->settings->set(['digit_separator' => '1.234,56']); $this->assertSame(12.34, Helper::ParseCurrency('12,34')); } - public function testGetRedirectOptionMethod(): void + public function testGetRedirectOptionMethod() { $test_data = [ 'Option target: redirect for user assigned to ' => [ diff --git a/tests/Unit/LdapTest.php b/tests/Unit/LdapTest.php index f93c48be15..3e7b9d75fa 100644 --- a/tests/Unit/LdapTest.php +++ b/tests/Unit/LdapTest.php @@ -11,7 +11,7 @@ final class LdapTest extends TestCase { use \phpmock\phpunit\PHPMock; - public function testConnect(): void + public function testConnect() { $this->settings->enableLdap(); @@ -31,14 +31,14 @@ final class LdapTest extends TestCase // with/without ignore cert validation? // test (and mock) ldap_start_tls() ? - public function testBindAdmin(): void + public function testBindAdmin() { $this->settings->enableLdap(); $this->getFunctionMock("App\\Models", "ldap_bind")->expects($this->once())->willReturn(true); $this->assertNull(Ldap::bindAdminToLdap("dummy")); } - public function testBindBad(): void + public function testBindBad() { $this->settings->enableLdap(); $this->getFunctionMock("App\\Models", "ldap_bind")->expects($this->once())->willReturn(false); @@ -49,7 +49,7 @@ final class LdapTest extends TestCase } // other test cases - test donked password? - public function testAnonymousBind(): void + public function testAnonymousBind() { //todo - would be nice to introspect somehow to make sure the right parameters were passed? $this->settings->enableAnonymousLdap(); @@ -57,7 +57,7 @@ final class LdapTest extends TestCase $this->assertNull(Ldap::bindAdminToLdap("dummy")); } - public function testBadAnonymousBind(): void + public function testBadAnonymousBind() { $this->settings->enableAnonymousLdap(); $this->getFunctionMock("App\\Models", "ldap_bind")->expects($this->once())->willReturn(false); @@ -67,7 +67,7 @@ final class LdapTest extends TestCase $this->assertNull(Ldap::bindAdminToLdap("dummy")); } - public function testBadEncryptedPassword(): void + public function testBadEncryptedPassword() { $this->settings->enableBadPasswordLdap(); @@ -75,7 +75,7 @@ final class LdapTest extends TestCase $this->assertNull(Ldap::bindAdminToLdap("dummy")); } - public function testFindAndBind(): void + public function testFindAndBind() { $this->settings->enableLdap(); @@ -105,7 +105,7 @@ final class LdapTest extends TestCase $this->assertEqualsCanonicalizing(["count" =>1,0 =>['sn' => 'Surname','firstname' => 'FirstName']],$results); } - public function testFindAndBindBadPassword(): void + public function testFindAndBindBadPassword() { $this->settings->enableLdap(); @@ -126,7 +126,7 @@ final class LdapTest extends TestCase $this->assertFalse($results); } - public function testFindAndBindCannotFindSelf(): void + public function testFindAndBindCannotFindSelf() { $this->settings->enableLdap(); @@ -147,7 +147,7 @@ final class LdapTest extends TestCase //maybe should do an AD test as well? - public function testFindLdapUsers(): void + public function testFindLdapUsers() { $this->settings->enableLdap(); @@ -170,7 +170,7 @@ final class LdapTest extends TestCase $this->assertEqualsCanonicalizing(["count" => 1], $results); } - public function testFindLdapUsersPaginated(): void + public function testFindLdapUsersPaginated() { $this->settings->enableLdap(); diff --git a/tests/Unit/Listeners/LogListenerTest.php b/tests/Unit/Listeners/LogListenerTest.php index 3361886793..f5ab6d1393 100644 --- a/tests/Unit/Listeners/LogListenerTest.php +++ b/tests/Unit/Listeners/LogListenerTest.php @@ -10,7 +10,7 @@ use Tests\TestCase; final class LogListenerTest extends TestCase { - public function testLogsEntryOnCheckoutableCheckedOut(): void + public function testLogsEntryOnCheckoutableCheckedOut() { $asset = Asset::factory()->create(); $checkedOutTo = User::factory()->create(); diff --git a/tests/Unit/LocationTest.php b/tests/Unit/LocationTest.php index 1898d3f877..0c5f535b04 100644 --- a/tests/Unit/LocationTest.php +++ b/tests/Unit/LocationTest.php @@ -6,7 +6,7 @@ use Tests\TestCase; final class LocationTest extends TestCase { - public function testPassesIfNotSelfParent(): void + public function testPassesIfNotSelfParent() { $a = Location::factory()->make([ 'name' => 'Test Location', @@ -17,7 +17,7 @@ final class LocationTest extends TestCase $this->assertTrue($a->isValid()); } - public function testFailsIfSelfParent(): void + public function testFailsIfSelfParent() { $a = Location::factory()->make([ 'name' => 'Test Location', diff --git a/tests/Unit/Models/Company/CompanyTest.php b/tests/Unit/Models/Company/CompanyTest.php index 5d5cbd2a67..66836afd73 100644 --- a/tests/Unit/Models/Company/CompanyTest.php +++ b/tests/Unit/Models/Company/CompanyTest.php @@ -7,7 +7,7 @@ use Tests\TestCase; final class CompanyTest extends TestCase { - public function testACompanyCanHaveUsers(): void + public function testACompanyCanHaveUsers() { $company = Company::factory()->create(); $user = User::factory() diff --git a/tests/Unit/Models/Company/GetIdForCurrentUserTest.php b/tests/Unit/Models/Company/GetIdForCurrentUserTest.php index fff572c18c..7ef5b9595d 100644 --- a/tests/Unit/Models/Company/GetIdForCurrentUserTest.php +++ b/tests/Unit/Models/Company/GetIdForCurrentUserTest.php @@ -8,7 +8,7 @@ use Tests\TestCase; final class GetIdForCurrentUserTest extends TestCase { - public function testReturnsProvidedValueWhenFullCompanySupportDisabled(): void + public function testReturnsProvidedValueWhenFullCompanySupportDisabled() { $this->settings->disableMultipleFullCompanySupport(); @@ -16,7 +16,7 @@ final class GetIdForCurrentUserTest extends TestCase $this->assertEquals(1000, Company::getIdForCurrentUser(1000)); } - public function testReturnsProvidedValueForSuperUsersWhenFullCompanySupportEnabled(): void + public function testReturnsProvidedValueForSuperUsersWhenFullCompanySupportEnabled() { $this->settings->enableMultipleFullCompanySupport(); @@ -24,7 +24,7 @@ final class GetIdForCurrentUserTest extends TestCase $this->assertEquals(2000, Company::getIdForCurrentUser(2000)); } - public function testReturnsNonSuperUsersCompanyIdWhenFullCompanySupportEnabled(): void + public function testReturnsNonSuperUsersCompanyIdWhenFullCompanySupportEnabled() { $this->settings->enableMultipleFullCompanySupport(); @@ -32,7 +32,7 @@ final class GetIdForCurrentUserTest extends TestCase $this->assertEquals(2000, Company::getIdForCurrentUser(1000)); } - public function testReturnsProvidedValueForNonSuperUserWithoutCompanyIdWhenFullCompanySupportEnabled(): void + public function testReturnsProvidedValueForNonSuperUserWithoutCompanyIdWhenFullCompanySupportEnabled() { $this->settings->enableMultipleFullCompanySupport(); diff --git a/tests/Unit/Models/Labels/FieldOptionTest.php b/tests/Unit/Models/Labels/FieldOptionTest.php index 4eb0829cb3..45756daec2 100644 --- a/tests/Unit/Models/Labels/FieldOptionTest.php +++ b/tests/Unit/Models/Labels/FieldOptionTest.php @@ -9,7 +9,7 @@ use Tests\TestCase; final class FieldOptionTest extends TestCase { - public function testItDisplaysAssignedToProperly(): void + public function testItDisplaysAssignedToProperly() { // "assignedTo" is a "special" value that can be used in the new label engine $fieldOption = FieldOption::fromString('Assigned To=assignedTo'); diff --git a/tests/Unit/NotificationTest.php b/tests/Unit/NotificationTest.php index b636bff7a6..dbeaa44ca2 100644 --- a/tests/Unit/NotificationTest.php +++ b/tests/Unit/NotificationTest.php @@ -12,7 +12,7 @@ use Tests\TestCase; final class NotificationTest extends TestCase { - public function testAUserIsEmailedIfTheyCheckoutAnAssetWithEULA(): void + public function testAUserIsEmailedIfTheyCheckoutAnAssetWithEULA() { $admin = User::factory()->superuser()->create(); $user = User::factory()->create(); diff --git a/tests/Unit/SnipeModelTest.php b/tests/Unit/SnipeModelTest.php index 7a95655abd..3084aba1bd 100644 --- a/tests/Unit/SnipeModelTest.php +++ b/tests/Unit/SnipeModelTest.php @@ -6,7 +6,7 @@ use Tests\TestCase; final class SnipeModelTest extends TestCase { - public function testSetsPurchaseDatesAppropriately(): void + public function testSetsPurchaseDatesAppropriately() { $c = new SnipeModel; $c->purchase_date = ''; @@ -15,7 +15,7 @@ final class SnipeModelTest extends TestCase $this->assertTrue($c->purchase_date === '2016-03-25 12:35:50'); } - public function testSetsPurchaseCostsAppropriately(): void + public function testSetsPurchaseCostsAppropriately() { $c = new SnipeModel; $c->purchase_cost = '0.00'; @@ -26,7 +26,7 @@ final class SnipeModelTest extends TestCase $this->assertTrue($c->purchase_cost === 9.5); } - public function testNullsBlankLocationIdsButNotOthers(): void + public function testNullsBlankLocationIdsButNotOthers() { $c = new SnipeModel; $c->location_id = ''; @@ -35,7 +35,7 @@ final class SnipeModelTest extends TestCase $this->assertTrue($c->location_id == 5); } - public function testNullsBlankCategoriesButNotOthers(): void + public function testNullsBlankCategoriesButNotOthers() { $c = new SnipeModel; $c->category_id = ''; @@ -44,7 +44,7 @@ final class SnipeModelTest extends TestCase $this->assertTrue($c->category_id == 1); } - public function testNullsBlankSuppliersButNotOthers(): void + public function testNullsBlankSuppliersButNotOthers() { $c = new SnipeModel; $c->supplier_id = ''; @@ -53,7 +53,7 @@ final class SnipeModelTest extends TestCase $this->assertTrue($c->supplier_id == 4); } - public function testNullsBlankDepreciationsButNotOthers(): void + public function testNullsBlankDepreciationsButNotOthers() { $c = new SnipeModel; $c->depreciation_id = ''; @@ -62,7 +62,7 @@ final class SnipeModelTest extends TestCase $this->assertTrue($c->depreciation_id == 4); } - public function testNullsBlankManufacturersButNotOthers(): void + public function testNullsBlankManufacturersButNotOthers() { $c = new SnipeModel; $c->manufacturer_id = ''; diff --git a/tests/Unit/SnipeTranslatorTest.php b/tests/Unit/SnipeTranslatorTest.php index 6a582d0735..c8f10b7621 100644 --- a/tests/Unit/SnipeTranslatorTest.php +++ b/tests/Unit/SnipeTranslatorTest.php @@ -11,17 +11,17 @@ final class SnipeTranslatorTest extends TestCase // WARNING: If these translation strings are updated, these tests will start to fail. Update them as appropriate. - public function testBasic(): void + public function testBasic() { $this->assertEquals('This user has admin privileges',trans('general.admin_tooltip',[],'en-US')); } - public function testPortuguese(): void + public function testPortuguese() { $this->assertEquals('Acessório',trans('general.accessory',[],'pt-PT')); } - public function testFallback(): void + public function testFallback() { $this->assertEquals( 'This user has admin privileges', @@ -30,7 +30,7 @@ final class SnipeTranslatorTest extends TestCase ); } - public function testBackupString(): void + public function testBackupString() { $this->assertEquals( 'Ingen sikkerhetskopier ble gjort ennå', @@ -39,7 +39,7 @@ final class SnipeTranslatorTest extends TestCase ); } - public function testBackupFallback(): void + public function testBackupFallback() { $this->assertEquals( 'No backups were made yet', @@ -49,7 +49,7 @@ final class SnipeTranslatorTest extends TestCase } - public function testTransChoiceSingular(): void + public function testTransChoiceSingular() { $this->assertEquals( '1 Consumível', @@ -57,7 +57,7 @@ final class SnipeTranslatorTest extends TestCase ); } - public function testTransChoicePlural(): void + public function testTransChoicePlural() { $this->assertEquals( '2 Consumíveis', @@ -65,7 +65,7 @@ final class SnipeTranslatorTest extends TestCase ); } - public function testTotallyBogusKey(): void + public function testTotallyBogusKey() { $this->assertEquals( 'bogus_key', @@ -74,7 +74,7 @@ final class SnipeTranslatorTest extends TestCase ); } - public function testReplacements(): void { + public function testReplacements() { $this->assertEquals( 'Artigos alocados a Some Name Here', trans('admin/users/general.assets_user',['name' => 'Some Name Here'],'pt-PT'), @@ -82,7 +82,7 @@ final class SnipeTranslatorTest extends TestCase ); } - public function testNonlegacyBackupLocale(): void { + public function testNonlegacyBackupLocale() { //Spatie backup *usually* uses two-character locales, but pt-BR is an exception $this->assertEquals( 'Mensagem de exceção: MESSAGE', diff --git a/tests/Unit/StatuslabelTest.php b/tests/Unit/StatuslabelTest.php index dc57831fa3..71e74ababe 100644 --- a/tests/Unit/StatuslabelTest.php +++ b/tests/Unit/StatuslabelTest.php @@ -6,37 +6,37 @@ use Tests\TestCase; final class StatuslabelTest extends TestCase { - public function testRTDStatuslabelAdd(): void + public function testRTDStatuslabelAdd() { $statuslabel = Statuslabel::factory()->rtd()->create(); $this->assertModelExists($statuslabel); } - public function testPendingStatuslabelAdd(): void + public function testPendingStatuslabelAdd() { $statuslabel = Statuslabel::factory()->pending()->create(); $this->assertModelExists($statuslabel); } - public function testArchivedStatuslabelAdd(): void + public function testArchivedStatuslabelAdd() { $statuslabel = Statuslabel::factory()->archived()->create(); $this->assertModelExists($statuslabel); } - public function testOutForRepairStatuslabelAdd(): void + public function testOutForRepairStatuslabelAdd() { $statuslabel = Statuslabel::factory()->outForRepair()->create(); $this->assertModelExists($statuslabel); } - public function testBrokenStatuslabelAdd(): void + public function testBrokenStatuslabelAdd() { $statuslabel = Statuslabel::factory()->broken()->create(); $this->assertModelExists($statuslabel); } - public function testLostStatuslabelAdd(): void + public function testLostStatuslabelAdd() { $statuslabel = Statuslabel::factory()->lost()->create(); $this->assertModelExists($statuslabel); diff --git a/tests/Unit/UserTest.php b/tests/Unit/UserTest.php index 1d32bc83e9..1681fac942 100644 --- a/tests/Unit/UserTest.php +++ b/tests/Unit/UserTest.php @@ -6,7 +6,7 @@ use Tests\TestCase; final class UserTest extends TestCase { - public function testFirstNameSplit(): void + public function testFirstNameSplit() { $fullname = "Natalia Allanovna Romanova-O'Shostakova"; $expected_firstname = 'Natalia'; @@ -16,7 +16,7 @@ final class UserTest extends TestCase $this->assertEquals($expected_lastname, $user['last_name']); } - public function testFirstName(): void + public function testFirstName() { $fullname = "Natalia Allanovna Romanova-O'Shostakova"; $expected_username = 'natalia'; @@ -24,7 +24,7 @@ final class UserTest extends TestCase $this->assertEquals($expected_username, $user['username']); } - public function testFirstNameDotLastName(): void + public function testFirstNameDotLastName() { $fullname = "Natalia Allanovna Romanova-O'Shostakova"; $expected_username = 'natalia.allanovna-romanova-oshostakova'; @@ -32,7 +32,7 @@ final class UserTest extends TestCase $this->assertEquals($expected_username, $user['username']); } - public function testLastNameFirstInitial(): void + public function testLastNameFirstInitial() { $fullname = "Natalia Allanovna Romanova-O'Shostakova"; $expected_username = 'allanovna-romanova-oshostakovan'; @@ -40,7 +40,7 @@ final class UserTest extends TestCase $this->assertEquals($expected_username, $user['username']); } - public function testFirstInitialLastName(): void + public function testFirstInitialLastName() { $fullname = "Natalia Allanovna Romanova-O'Shostakova"; $expected_username = 'nallanovna-romanova-oshostakova'; @@ -48,7 +48,7 @@ final class UserTest extends TestCase $this->assertEquals($expected_username, $user['username']); } - public function testFirstInitialUnderscoreLastName(): void + public function testFirstInitialUnderscoreLastName() { $fullname = "Natalia Allanovna Romanova-O'Shostakova"; $expected_username = 'nallanovna-romanova-oshostakova'; @@ -56,7 +56,7 @@ final class UserTest extends TestCase $this->assertEquals($expected_username, $user['username']); } - public function testSingleName(): void + public function testSingleName() { $fullname = 'Natalia'; $expected_username = 'natalia';