diff --git a/tests/unit/AccessoryTest.php b/tests/unit/AccessoryTest.php index b1c1327449..68dc903b5e 100644 --- a/tests/unit/AccessoryTest.php +++ b/tests/unit/AccessoryTest.php @@ -6,7 +6,6 @@ use App\Models\Category; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; class AccessoryTest extends BaseTest diff --git a/tests/unit/AssetModelTest.php b/tests/unit/AssetModelTest.php index 313ce5a1d6..03ae558937 100644 --- a/tests/unit/AssetModelTest.php +++ b/tests/unit/AssetModelTest.php @@ -6,7 +6,6 @@ use App\Models\AssetModel; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; class AssetModelTest extends BaseTest diff --git a/tests/unit/AssetTest.php b/tests/unit/AssetTest.php index b649e27aac..cf94600285 100644 --- a/tests/unit/AssetTest.php +++ b/tests/unit/AssetTest.php @@ -10,7 +10,6 @@ use App\Models\User; use Carbon\Carbon; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; class AssetTest extends BaseTest diff --git a/tests/unit/BaseTest.php b/tests/unit/BaseTest.php index a92a0ef62d..9ad3fb213f 100644 --- a/tests/unit/BaseTest.php +++ b/tests/unit/BaseTest.php @@ -5,8 +5,9 @@ use App\Models\User; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; +use PHPUnit\Framework\TestCase; -class BaseTest extends \Tests\TestCase +class BaseTest extends TestCase { use DatabaseTransactions; diff --git a/tests/unit/CategoryTest.php b/tests/unit/CategoryTest.php index f574a0d12d..26ffc19391 100644 --- a/tests/unit/CategoryTest.php +++ b/tests/unit/CategoryTest.php @@ -5,7 +5,6 @@ use App\Models\Category; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; class CategoryTest extends BaseTest diff --git a/tests/unit/CompanyTest.php b/tests/unit/CompanyTest.php index 1d1589f5b2..11842847bc 100644 --- a/tests/unit/CompanyTest.php +++ b/tests/unit/CompanyTest.php @@ -5,7 +5,6 @@ use App\Models\Company; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; class CompanyTest extends BaseTest diff --git a/tests/unit/ComponentTest.php b/tests/unit/ComponentTest.php index f8bd36119d..a94fbe8583 100644 --- a/tests/unit/ComponentTest.php +++ b/tests/unit/ComponentTest.php @@ -8,7 +8,6 @@ use App\Models\Location; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; class ComponentTest extends BaseTest diff --git a/tests/unit/ConsumableTest.php b/tests/unit/ConsumableTest.php index 963e53d1dd..76f1a330c7 100644 --- a/tests/unit/ConsumableTest.php +++ b/tests/unit/ConsumableTest.php @@ -5,7 +5,6 @@ use App\Models\Consumable; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; class ConsumableTest extends BaseTest diff --git a/tests/unit/CustomFieldTest.php b/tests/unit/CustomFieldTest.php index 1fbe3c2b86..7df281fe1d 100644 --- a/tests/unit/CustomFieldTest.php +++ b/tests/unit/CustomFieldTest.php @@ -5,7 +5,6 @@ use App\Models\CustomField; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; /* diff --git a/tests/unit/ImporterTest.php b/tests/unit/ImporterTest.php index d5467fb758..b6605c93a0 100644 --- a/tests/unit/ImporterTest.php +++ b/tests/unit/ImporterTest.php @@ -16,7 +16,6 @@ use App\Models\User; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Notification; use Tests\Unit\BaseTest; diff --git a/tests/unit/LocationTest.php b/tests/unit/LocationTest.php index c3dee570fd..d4739e1a31 100644 --- a/tests/unit/LocationTest.php +++ b/tests/unit/LocationTest.php @@ -5,7 +5,6 @@ use App\Models\Location; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; class LocationTest extends BaseTest diff --git a/tests/unit/NotificationTest.php b/tests/unit/NotificationTest.php index 38839ddcd4..0fd2810e1d 100644 --- a/tests/unit/NotificationTest.php +++ b/tests/unit/NotificationTest.php @@ -11,7 +11,6 @@ use App\Notifications\CheckoutAssetNotification; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Notification; use Tests\Unit\BaseTest; diff --git a/tests/unit/StatuslabelTest.php b/tests/unit/StatuslabelTest.php index ff509427aa..2eb7e62121 100644 --- a/tests/unit/StatuslabelTest.php +++ b/tests/unit/StatuslabelTest.php @@ -5,7 +5,6 @@ use App\Models\Statuslabel; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; class StatuslabelTest extends BaseTest diff --git a/tests/unit/UserTest.php b/tests/unit/UserTest.php index 638884f0d7..d5891a8323 100644 --- a/tests/unit/UserTest.php +++ b/tests/unit/UserTest.php @@ -5,7 +5,6 @@ use App\Models\User; use Illuminate\Foundation\Testing\DatabaseMigrations; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\WithoutMiddleware; -use Illuminate\Support\Facades\Hash; use Tests\Unit\BaseTest; class UserTest extends BaseTest @@ -15,27 +14,12 @@ class UserTest extends BaseTest */ protected $tester; - // public function testUserAdd() - // { - // $user = factory(User::class)->make(); - // $values = [ - // 'first_name' => $user->first_name, - // 'last_name' => $user->last_name, - // 'email' => $user->email, - // 'username' => $user->username, - // 'password' => $user->password, - // ]; - - // User::create($values); - // $this->tester->seeRecord('users', $values); - // } - public function testFirstNameSplit() { $fullname = "Natalia Allanovna Romanova-O'Shostakova"; $expected_firstname = 'Natalia'; $expected_lastname = "Allanovna Romanova-O'Shostakova"; - $user = User::generateFormattedNameFromFullName('firstname', $fullname); + $user = User::generateFormattedNameFromFullName($fullname, 'firstname'); $this->assertEquals($expected_firstname, $user['first_name']); $this->assertEquals($expected_lastname, $user['last_name']); } @@ -75,8 +59,8 @@ class UserTest extends BaseTest public function testFirstInitialUnderscoreLastName() { $fullname = "Natalia Allanovna Romanova-O'Shostakova"; - $expected_username = 'n_allanovna-romanova-oshostakova'; - $user = User::generateFormattedNameFromFullName($fullname, 'firstname_lastname'); + $expected_username = 'nallanovna-romanova-oshostakova'; + $user = User::generateFormattedNameFromFullName($fullname, 'firstinitial_lastname'); $this->assertEquals($expected_username, $user['username']); } @@ -84,7 +68,7 @@ class UserTest extends BaseTest { $fullname = 'Natalia'; $expected_username = 'natalia'; - $user = User::generateFormattedNameFromFullName('firstname_lastname', $fullname); + $user = User::generateFormattedNameFromFullName($fullname, 'firstname_lastname',); $this->assertEquals($expected_username, $user['username']); }