Skip to content

A free open source IT asset/license management system

Remove redundant base test case

Marcus Moore43ff7261b2c5
diff --git a/tests/Feature/Api/Users/UsersForSelectListTest.php b/tests/Feature/Api/Users/UsersForSelectListTest.php
index 0aca637eb9..b4ede4b117 100644
--- a/tests/Feature/Api/Users/UsersForSelectListTest.php
+++ b/tests/Feature/Api/Users/UsersForSelectListTest.php
@@ -5,15 +5,12 @@ namespace Tests\Feature\Api\Users;
use App\Models\Company;
use App\Models\Setting;
use App\Models\User;
-use Illuminate\Foundation\Testing\LazilyRefreshDatabase;
use Illuminate\Testing\Fluent\AssertableJson;
use Laravel\Passport\Passport;
use Tests\TestCase;
class UsersForSelectListTest extends TestCase
{
- use LazilyRefreshDatabase;
-
public function testUsersAreReturned()
{
Setting::factory()->create();
diff --git a/tests/TestCase.php b/tests/TestCase.php
index 4a19344eb3..efa533b8cc 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -4,11 +4,13 @@ namespace Tests;
use App\Http\Middleware\SecurityHeaders;
use App\Models\Setting;
+use Illuminate\Foundation\Testing\LazilyRefreshDatabase;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
+ use LazilyRefreshDatabase;
private array $globallyDisabledMiddleware = [
SecurityHeaders::class,
diff --git a/tests/Unit/AccessoryTest.php b/tests/Unit/AccessoryTest.php
index a9ed782aea..25bd849b61 100644
--- a/tests/Unit/AccessoryTest.php
+++ b/tests/Unit/AccessoryTest.php
@@ -9,9 +9,9 @@ use App\Models\Company;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
-class AccessoryTest extends BaseTest
+class AccessoryTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/AssetMaintenanceTest.php b/tests/Unit/AssetMaintenanceTest.php
index ad16679887..d403b7ff92 100644
--- a/tests/Unit/AssetMaintenanceTest.php
+++ b/tests/Unit/AssetMaintenanceTest.php
@@ -2,10 +2,10 @@
namespace Tests\Unit;
use App\Models\AssetMaintenance;
-use Tests\Unit\BaseTest;
use Carbon\Carbon;
+use Tests\TestCase;
-class AssetMaintenanceTest extends BaseTest
+class AssetMaintenanceTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/AssetModelTest.php b/tests/Unit/AssetModelTest.php
index d7c18dc9a7..d1582c9066 100644
--- a/tests/Unit/AssetModelTest.php
+++ b/tests/Unit/AssetModelTest.php
@@ -7,9 +7,9 @@ use App\Models\AssetModel;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
-class AssetModelTest extends BaseTest
+class AssetModelTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/AssetTest.php b/tests/Unit/AssetTest.php
index e3fa5b4497..d49137be74 100644
--- a/tests/Unit/AssetTest.php
+++ b/tests/Unit/AssetTest.php
@@ -11,12 +11,12 @@ use App\Models\Category;
use Carbon\Carbon;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\Unit\BaseTest;
use App\Models\Component;
use App\Models\ActionLog;
+use Tests\TestCase;
-class AssetTest extends BaseTest
+class AssetTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/BaseTest.php b/tests/Unit/BaseTest.php
deleted file mode 100644
index 977e8b02eb..0000000000
--- a/tests/Unit/BaseTest.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-namespace Tests\Unit;
-
-use App\Models\User;
-use App\Models\Setting;
-use Illuminate\Foundation\Testing\DatabaseMigrations;
-use Illuminate\Foundation\Testing\DatabaseTransactions;
-use Illuminate\Foundation\Testing\LazilyRefreshDatabase;
-use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\TestCase;
-use Auth;
-use Artisan;
-
-abstract class BaseTest extends TestCase
-{
- use LazilyRefreshDatabase;
-}
diff --git a/tests/Unit/CategoryTest.php b/tests/Unit/CategoryTest.php
index eb1c06e696..5a29e53885 100644
--- a/tests/Unit/CategoryTest.php
+++ b/tests/Unit/CategoryTest.php
@@ -5,12 +5,12 @@ use App\Models\Category;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\Unit\BaseTest;
use App\Models\AssetModel;
use App\Models\Asset;
use App\Models\Accessory;
+use Tests\TestCase;
-class CategoryTest extends BaseTest
+class CategoryTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/CompanyTest.php b/tests/Unit/CompanyTest.php
index c5c7600290..c756b90848 100644
--- a/tests/Unit/CompanyTest.php
+++ b/tests/Unit/CompanyTest.php
@@ -5,13 +5,13 @@ use App\Models\Company;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\Unit\BaseTest;
use App\Models\Component;
use App\Models\Asset;
use App\Models\Consumable;
use App\Models\User;
+use Tests\TestCase;
-class CompanyTest extends BaseTest
+class CompanyTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/ComponentTest.php b/tests/Unit/ComponentTest.php
index bca8f3e67c..48a4a998ee 100644
--- a/tests/Unit/ComponentTest.php
+++ b/tests/Unit/ComponentTest.php
@@ -8,9 +8,9 @@ use App\Models\Location;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
-class ComponentTest extends BaseTest
+class ComponentTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/CustomFieldTest.php b/tests/Unit/CustomFieldTest.php
index f991fda208..16313efb34 100644
--- a/tests/Unit/CustomFieldTest.php
+++ b/tests/Unit/CustomFieldTest.php
@@ -5,13 +5,13 @@ use App\Models\CustomField;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
/*
* Test strings for db column names gathered from
* http://www.omniglot.com/language/phrases/hovercraft.htm
*/
-class CustomFieldTest extends BaseTest
+class CustomFieldTest extends TestCase
{
protected $tester;
diff --git a/tests/Unit/DepreciationTest.php b/tests/Unit/DepreciationTest.php
index d8885dcf96..84b10d7fbd 100644
--- a/tests/Unit/DepreciationTest.php
+++ b/tests/Unit/DepreciationTest.php
@@ -2,12 +2,12 @@
namespace Tests\Unit;
use App\Models\Depreciation;
-use Tests\Unit\BaseTest;
use App\Models\Category;
use App\Models\License;
use App\Models\AssetModel;
+use Tests\TestCase;
-class DepreciationTest extends BaseTest
+class DepreciationTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/ImporterTest.php b/tests/Unit/ImporterTest.php
index dcd7927c2a..94d537cce5 100644
--- a/tests/Unit/ImporterTest.php
+++ b/tests/Unit/ImporterTest.php
@@ -17,9 +17,9 @@ use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Support\Facades\Notification;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
-class ImporterTest extends BaseTest
+class ImporterTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/LocationTest.php b/tests/Unit/LocationTest.php
index 962d441b2b..a729201900 100644
--- a/tests/Unit/LocationTest.php
+++ b/tests/Unit/LocationTest.php
@@ -2,10 +2,10 @@
namespace Tests\Unit;
use App\Models\Location;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
-class LocationTest extends BaseTest
+class LocationTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/NotificationTest.php b/tests/Unit/NotificationTest.php
index 4b85fa4c4b..4cc0930252 100644
--- a/tests/Unit/NotificationTest.php
+++ b/tests/Unit/NotificationTest.php
@@ -8,10 +8,10 @@ use App\Models\Category;
use Carbon\Carbon;
use App\Notifications\CheckoutAssetNotification;
use Illuminate\Support\Facades\Notification;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
-class NotificationTest extends BaseTest
+class NotificationTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/PermissionsTest.php b/tests/Unit/PermissionsTest.php
index 86d40de866..dcdbd1bb47 100644
--- a/tests/Unit/PermissionsTest.php
+++ b/tests/Unit/PermissionsTest.php
@@ -10,9 +10,9 @@ use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
-class PermissionsTest extends BaseTest
+class PermissionsTest extends TestCase
{
// public function _before()
// {
diff --git a/tests/Unit/SnipeModelTest.php b/tests/Unit/SnipeModelTest.php
index f9dcfe0cb4..1455502216 100644
--- a/tests/Unit/SnipeModelTest.php
+++ b/tests/Unit/SnipeModelTest.php
@@ -2,9 +2,9 @@
namespace Tests\Unit;
use App\Models\SnipeModel;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
-class SnipeModelTest extends BaseTest
+class SnipeModelTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/StatuslabelTest.php b/tests/Unit/StatuslabelTest.php
index 5ec209af1b..2dfd0143c2 100644
--- a/tests/Unit/StatuslabelTest.php
+++ b/tests/Unit/StatuslabelTest.php
@@ -5,9 +5,9 @@ use App\Models\Statuslabel;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
-class StatuslabelTest extends BaseTest
+class StatuslabelTest extends TestCase
{
/**
* @var \UnitTester
diff --git a/tests/Unit/UserTest.php b/tests/Unit/UserTest.php
index d5891a8323..c5eebd6b08 100644
--- a/tests/Unit/UserTest.php
+++ b/tests/Unit/UserTest.php
@@ -5,9 +5,9 @@ use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithoutMiddleware;
-use Tests\Unit\BaseTest;
+use Tests\TestCase;
-class UserTest extends BaseTest
+class UserTest extends TestCase
{
/**
* @var \UnitTester