diff --git a/tests/Feature/Accessories/Api/DeleteAccessoriesTest.php b/tests/Feature/Accessories/Api/DeleteAccessoriesTest.php index 8f2fabac6d32..aa5d7e5bcd87 100644 --- a/tests/Feature/Accessories/Api/DeleteAccessoriesTest.php +++ b/tests/Feature/Accessories/Api/DeleteAccessoriesTest.php @@ -18,6 +18,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.accessories.destroy', $accessory)) ->assertForbidden(); + + $this->assertNotSoftDeleted($accessory); } public function testAdheresToMultipleFullCompanySupportScoping() diff --git a/tests/Feature/AssetMaintenances/Api/DeleteAssetMaintenancesTest.php b/tests/Feature/AssetMaintenances/Api/DeleteAssetMaintenancesTest.php index 06bf9bcd7742..ed7ed44447fc 100644 --- a/tests/Feature/AssetMaintenances/Api/DeleteAssetMaintenancesTest.php +++ b/tests/Feature/AssetMaintenances/Api/DeleteAssetMaintenancesTest.php @@ -18,6 +18,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.maintenances.destroy', $assetMaintenance)) ->assertForbidden(); + + $this->assertNotSoftDeleted($assetMaintenance); } public function testAdheresToMultipleFullCompanySupportScoping() diff --git a/tests/Feature/AssetModels/Api/DeleteAssetModelsTest.php b/tests/Feature/AssetModels/Api/DeleteAssetModelsTest.php index 7de82db65bbe..a07978865129 100644 --- a/tests/Feature/AssetModels/Api/DeleteAssetModelsTest.php +++ b/tests/Feature/AssetModels/Api/DeleteAssetModelsTest.php @@ -17,6 +17,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.models.destroy', $assetModel)) ->assertForbidden(); + + $this->assertNotSoftDeleted($assetModel); } public function testCannotDeleteAssetModelThatStillHasAssociatedAssets() diff --git a/tests/Feature/Assets/Api/DeleteAssetsTest.php b/tests/Feature/Assets/Api/DeleteAssetsTest.php index d09d7d403440..95640ed83f31 100644 --- a/tests/Feature/Assets/Api/DeleteAssetsTest.php +++ b/tests/Feature/Assets/Api/DeleteAssetsTest.php @@ -18,6 +18,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.assets.destroy', $asset)) ->assertForbidden(); + + $this->assertNotSoftDeleted($asset); } public function testAdheresToMultipleFullCompanySupportScoping() diff --git a/tests/Feature/Categories/Api/DeleteCategoriesTest.php b/tests/Feature/Categories/Api/DeleteCategoriesTest.php index 2da03c3ca3c6..eb9b73b050ce 100644 --- a/tests/Feature/Categories/Api/DeleteCategoriesTest.php +++ b/tests/Feature/Categories/Api/DeleteCategoriesTest.php @@ -17,6 +17,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.categories.destroy', $category)) ->assertForbidden(); + + $this->assertNotSoftDeleted($category); } public function testCannotDeleteCategoryThatStillHasAssociatedItems() diff --git a/tests/Feature/Companies/Api/DeleteCompaniesTest.php b/tests/Feature/Companies/Api/DeleteCompaniesTest.php index 4ecc3c183fa4..3dcdb4fd2102 100644 --- a/tests/Feature/Companies/Api/DeleteCompaniesTest.php +++ b/tests/Feature/Companies/Api/DeleteCompaniesTest.php @@ -16,6 +16,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.companies.destroy', $company)) ->assertForbidden(); + + $this->assertDatabaseHas('companies', ['id' => $company->id]); } public function testCannotDeleteCompanyThatHasAssociatedItems() diff --git a/tests/Feature/Components/Api/DeleteComponentsTest.php b/tests/Feature/Components/Api/DeleteComponentsTest.php index c25e8a55003e..df965d745cf3 100644 --- a/tests/Feature/Components/Api/DeleteComponentsTest.php +++ b/tests/Feature/Components/Api/DeleteComponentsTest.php @@ -18,6 +18,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.components.destroy', $component)) ->assertForbidden(); + + $this->assertNotSoftDeleted($component); } public function testAdheresToMultipleFullCompanySupportScoping() diff --git a/tests/Feature/Consumables/Api/DeleteConsumablesTest.php b/tests/Feature/Consumables/Api/DeleteConsumablesTest.php index fa50207ebec7..c57e2e0df874 100644 --- a/tests/Feature/Consumables/Api/DeleteConsumablesTest.php +++ b/tests/Feature/Consumables/Api/DeleteConsumablesTest.php @@ -18,6 +18,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.consumables.destroy', $consumable)) ->assertForbidden(); + + $this->assertNotSoftDeleted($consumable); } public function testAdheresToMultipleFullCompanySupportScoping() diff --git a/tests/Feature/CustomFields/Api/DeleteCustomFieldsTest.php b/tests/Feature/CustomFields/Api/DeleteCustomFieldsTest.php index ef124b8214f9..ab40591e90cd 100644 --- a/tests/Feature/CustomFields/Api/DeleteCustomFieldsTest.php +++ b/tests/Feature/CustomFields/Api/DeleteCustomFieldsTest.php @@ -19,6 +19,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.customfields.destroy', $customField)) ->assertForbidden(); + + $this->assertDatabaseHas('custom_fields', ['id' => $customField->id]); } public function testCustomFieldsCannotBeDeletedIfTheyHaveAssociatedFieldsets() diff --git a/tests/Feature/CustomFieldsets/Api/DeleteCustomFieldsetsTest.php b/tests/Feature/CustomFieldsets/Api/DeleteCustomFieldsetsTest.php index 161b1cd4b1e8..c464323653fe 100644 --- a/tests/Feature/CustomFieldsets/Api/DeleteCustomFieldsetsTest.php +++ b/tests/Feature/CustomFieldsets/Api/DeleteCustomFieldsetsTest.php @@ -19,6 +19,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.fieldsets.destroy', $customFieldset)) ->assertForbidden(); + + $this->assertDatabaseHas('custom_fieldsets', ['id' => $customFieldset->id]); } public function testCannotDeleteCustomFieldsetWithAssociatedFields() diff --git a/tests/Feature/Departments/Api/DeleteDepartmentTest.php b/tests/Feature/Departments/Api/DeleteDepartmentTest.php index 331876709542..5865a7f2e5aa 100644 --- a/tests/Feature/Departments/Api/DeleteDepartmentTest.php +++ b/tests/Feature/Departments/Api/DeleteDepartmentTest.php @@ -18,6 +18,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.departments.destroy', $department)) ->assertForbidden(); + + $this->assertDatabaseHas('departments', ['id' => $department->id]); } public function testAdheresToMultipleFullCompanySupportScoping() diff --git a/tests/Feature/Depreciations/Api/DeleteDepreciationTest.php b/tests/Feature/Depreciations/Api/DeleteDepreciationTest.php index d45beb6aed37..a8ec45f6ede0 100644 --- a/tests/Feature/Depreciations/Api/DeleteDepreciationTest.php +++ b/tests/Feature/Depreciations/Api/DeleteDepreciationTest.php @@ -16,6 +16,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.depreciations.destroy', $depreciation)) ->assertForbidden(); + + $this->assertDatabaseHas('depreciations', ['id' => $depreciation->id]); } public function testCannotDeleteDepreciationThatHasAssociatedModels() diff --git a/tests/Feature/Groups/Api/DeleteGroupTest.php b/tests/Feature/Groups/Api/DeleteGroupTest.php index 8d057a7ed348..ec0766340be9 100644 --- a/tests/Feature/Groups/Api/DeleteGroupTest.php +++ b/tests/Feature/Groups/Api/DeleteGroupTest.php @@ -16,6 +16,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.groups.destroy', $group)) ->assertForbidden(); + + $this->assertDatabaseHas('permission_groups', ['id' => $group->id]); } public function testCanDeleteGroup() diff --git a/tests/Feature/Licenses/Api/DeleteLicenseTest.php b/tests/Feature/Licenses/Api/DeleteLicenseTest.php index c41c0eca8817..5261c339e6ce 100644 --- a/tests/Feature/Licenses/Api/DeleteLicenseTest.php +++ b/tests/Feature/Licenses/Api/DeleteLicenseTest.php @@ -18,6 +18,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.licenses.destroy', $license)) ->assertForbidden(); + + $this->assertNotSoftDeleted($license); } public function testAdheresToMultipleFullCompanySupportScoping() diff --git a/tests/Feature/PredefinedKits/Api/DeletePredefinedKitTest.php b/tests/Feature/PredefinedKits/Api/DeletePredefinedKitTest.php index e5eb54414938..265278a30242 100644 --- a/tests/Feature/PredefinedKits/Api/DeletePredefinedKitTest.php +++ b/tests/Feature/PredefinedKits/Api/DeletePredefinedKitTest.php @@ -17,6 +17,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.kits.destroy', $predefinedKit)) ->assertForbidden(); + + $this->assertDatabaseHas('kits', ['id' => $predefinedKit->id]); } public function testCanDeletePredefinedKits() diff --git a/tests/Feature/StatusLabels/Api/DeleteStatusLabelTest.php b/tests/Feature/StatusLabels/Api/DeleteStatusLabelTest.php index b7e92dcf22b8..46b8c6a61df9 100644 --- a/tests/Feature/StatusLabels/Api/DeleteStatusLabelTest.php +++ b/tests/Feature/StatusLabels/Api/DeleteStatusLabelTest.php @@ -16,6 +16,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.statuslabels.destroy', $statusLabel)) ->assertForbidden(); + + $this->assertNotSoftDeleted($statusLabel); } public function testCannotDeleteStatusLabelWhileStillAssociatedToAssets() diff --git a/tests/Feature/Suppliers/Api/DeleteSupplierTest.php b/tests/Feature/Suppliers/Api/DeleteSupplierTest.php index f1600a963c92..fd619cf7bd10 100644 --- a/tests/Feature/Suppliers/Api/DeleteSupplierTest.php +++ b/tests/Feature/Suppliers/Api/DeleteSupplierTest.php @@ -17,6 +17,8 @@ public function testRequiresPermission() $this->actingAsForApi(User::factory()->create()) ->deleteJson(route('api.suppliers.destroy', $supplier)) ->assertForbidden(); + + $this->assertNotSoftDeleted($supplier); } public function testCannotDeleteSupplierWithDataStillAssociated()