From 68ee27fc41f6e64d8fc72a520e230194edc06493 Mon Sep 17 00:00:00 2001 From: Jeremy Postlethwaite Date: Tue, 12 Mar 2024 18:19:21 -0700 Subject: [PATCH] GH-23 (#24) GH-23 --- .php-cs-fixer.dist.php | 3 +- .../2014_10_12_000000_create_users_table.php | 14 ++++ src/Models/{Traits => Concerns}/Abilities.php | 4 +- src/Models/{Traits => Concerns}/Admin.php | 4 +- .../{Traits => Concerns}/Privileges.php | 4 +- src/Models/{Traits => Concerns}/Role.php | 4 +- .../{Traits => Concerns}/WithChildren.php | 4 +- .../{Traits => Concerns}/WithCreator.php | 4 +- .../{Traits => Concerns}/WithModifier.php | 4 +- src/Models/{Traits => Concerns}/WithOwner.php | 4 +- .../{Traits => Concerns}/WithParent.php | 4 +- .../Revision.php} | 4 +- .../WithChildren.php} | 6 +- .../WithCreator.php} | 6 +- src/Models/Contracts/WithMatrix.php | 24 ++++++ .../WithModifier.php} | 6 +- .../WithOwner.php} | 6 +- .../WithParent.php} | 6 +- src/Models/Model.php | 46 +++++++----- .../{Traits => Scopes}/ScopeFilterColumns.php | 4 +- .../{Traits => Scopes}/ScopeFilterDates.php | 4 +- .../{Traits => Scopes}/ScopeFilterFlags.php | 4 +- .../{Traits => Scopes}/ScopeFilterIds.php | 4 +- .../{Traits => Scopes}/ScopeFilterTrash.php | 4 +- src/Models/{Traits => Scopes}/ScopeSort.php | 4 +- src/Models/User.php | 73 +++++++++++++------ src/ServiceProvider.php | 16 ++-- .../ScopeFilterColumns/ModelTest.php | 4 +- .../ScopeFilterDates/ModelTest.php | 4 +- .../ScopeFilterFlags/ModelTest.php | 4 +- .../ScopeFilterIds/ModelTest.php | 4 +- .../ScopeFilterTrash/ModelTest.php | 4 +- .../ScopeSort/ModelTest.php | 4 +- tests/Unit/Models/User/ModelTest.php | 1 + 34 files changed, 188 insertions(+), 107 deletions(-) rename src/Models/{Traits => Concerns}/Abilities.php (95%) rename src/Models/{Traits => Concerns}/Admin.php (79%) rename src/Models/{Traits => Concerns}/Privileges.php (95%) rename src/Models/{Traits => Concerns}/Role.php (95%) rename src/Models/{Traits => Concerns}/WithChildren.php (80%) rename src/Models/{Traits => Concerns}/WithCreator.php (84%) rename src/Models/{Traits => Concerns}/WithModifier.php (84%) rename src/Models/{Traits => Concerns}/WithOwner.php (84%) rename src/Models/{Traits => Concerns}/WithParent.php (80%) rename src/Models/{Interfaces/WithRevisionInterface.php => Contracts/Revision.php} (70%) rename src/Models/{Interfaces/WithChildrenInterface.php => Contracts/WithChildren.php} (60%) rename src/Models/{Interfaces/WithCreatorInterface.php => Contracts/WithCreator.php} (59%) create mode 100644 src/Models/Contracts/WithMatrix.php rename src/Models/{Interfaces/WithModifierInterface.php => Contracts/WithModifier.php} (59%) rename src/Models/{Interfaces/WithOwnerInterface.php => Contracts/WithOwner.php} (59%) rename src/Models/{Interfaces/WithParentInterface.php => Contracts/WithParent.php} (59%) rename src/Models/{Traits => Scopes}/ScopeFilterColumns.php (98%) rename src/Models/{Traits => Scopes}/ScopeFilterDates.php (98%) rename src/Models/{Traits => Scopes}/ScopeFilterFlags.php (93%) rename src/Models/{Traits => Scopes}/ScopeFilterIds.php (97%) rename src/Models/{Traits => Scopes}/ScopeFilterTrash.php (87%) rename src/Models/{Traits => Scopes}/ScopeSort.php (95%) rename tests/Unit/Models/{Traits => Scopes}/ScopeFilterColumns/ModelTest.php (99%) rename tests/Unit/Models/{Traits => Scopes}/ScopeFilterDates/ModelTest.php (99%) rename tests/Unit/Models/{Traits => Scopes}/ScopeFilterFlags/ModelTest.php (96%) rename tests/Unit/Models/{Traits => Scopes}/ScopeFilterIds/ModelTest.php (99%) rename tests/Unit/Models/{Traits => Scopes}/ScopeFilterTrash/ModelTest.php (95%) rename tests/Unit/Models/{Traits => Scopes}/ScopeSort/ModelTest.php (98%) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 5bf46cb..cdf705b 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -45,7 +45,7 @@ 'class_definition' => [ 'multi_line_extends_each_single_line' => true, 'single_item_single_line' => true, - 'single_line' => true, + 'single_line' => false, ], 'clean_namespace' => true, 'compact_nullable_typehint' => true, @@ -220,6 +220,7 @@ __DIR__.'/tests/Unit', ]) ->name('*.php') + ->name('*.phps') ->notName('*.blade.php') ->ignoreDotFiles(true) ->ignoreVCS(true) diff --git a/database/migrations-playground/2014_10_12_000000_create_users_table.php b/database/migrations-playground/2014_10_12_000000_create_users_table.php index b68c554..1f90a54 100644 --- a/database/migrations-playground/2014_10_12_000000_create_users_table.php +++ b/database/migrations-playground/2014_10_12_000000_create_users_table.php @@ -53,6 +53,20 @@ public function up(): void $table->bigInteger('rank')->default(0); $table->bigInteger('size')->default(0); + // Matrix + + $table->string('matrix')->default(''); + $table->bigInteger('x')->nullable(); + $table->bigInteger('y')->nullable(); + $table->bigInteger('z')->nullable(); + $table->decimal('r', 65, 10)->nullable()->default(null); + $table->decimal('theta', 10, 6)->nullable()->default(null); + $table->decimal('rho', 10, 6)->nullable()->default(null); + $table->decimal('phi', 10, 6)->nullable()->default(null); + $table->decimal('elevation', 65, 10)->nullable()->default(null); + $table->decimal('latitude', 8, 6)->nullable()->default(null); + $table->decimal('longitude', 9, 6)->nullable()->default(null); + // Flags $table->boolean('active')->default(1)->index(); diff --git a/src/Models/Traits/Abilities.php b/src/Models/Concerns/Abilities.php similarity index 95% rename from src/Models/Traits/Abilities.php rename to src/Models/Concerns/Abilities.php index ddaaabb..c605851 100644 --- a/src/Models/Traits/Abilities.php +++ b/src/Models/Concerns/Abilities.php @@ -2,10 +2,10 @@ /** * Playground */ -namespace Playground\Models\Traits; +namespace Playground\Models\Concerns; /** - * \Playground\Models\Traits\Abilities + * \Playground\Models\Concerns\Abilities */ trait Abilities { diff --git a/src/Models/Traits/Admin.php b/src/Models/Concerns/Admin.php similarity index 79% rename from src/Models/Traits/Admin.php rename to src/Models/Concerns/Admin.php index ea471f4..dd5ff61 100644 --- a/src/Models/Traits/Admin.php +++ b/src/Models/Concerns/Admin.php @@ -2,10 +2,10 @@ /** * Playground */ -namespace Playground\Models\Traits; +namespace Playground\Models\Concerns; /** - * \Playground\Models\Traits\Admin + * \Playground\Models\Concerns\Admin */ trait Admin { diff --git a/src/Models/Traits/Privileges.php b/src/Models/Concerns/Privileges.php similarity index 95% rename from src/Models/Traits/Privileges.php rename to src/Models/Concerns/Privileges.php index 8675198..1ad9420 100644 --- a/src/Models/Traits/Privileges.php +++ b/src/Models/Concerns/Privileges.php @@ -2,10 +2,10 @@ /** * Playground */ -namespace Playground\Models\Traits; +namespace Playground\Models\Concerns; /** - * \Playground\Models\Traits\Privileges + * \Playground\Models\Concerns\Privileges */ trait Privileges { diff --git a/src/Models/Traits/Role.php b/src/Models/Concerns/Role.php similarity index 95% rename from src/Models/Traits/Role.php rename to src/Models/Concerns/Role.php index 236b8af..1f96354 100644 --- a/src/Models/Traits/Role.php +++ b/src/Models/Concerns/Role.php @@ -2,10 +2,10 @@ /** * Playground */ -namespace Playground\Models\Traits; +namespace Playground\Models\Concerns; /** - * \Playground\Models\Traits\Role + * \Playground\Models\Concerns\Role * * @property string $role * @property array $roles diff --git a/src/Models/Traits/WithChildren.php b/src/Models/Concerns/WithChildren.php similarity index 80% rename from src/Models/Traits/WithChildren.php rename to src/Models/Concerns/WithChildren.php index f2772d1..ee224ad 100644 --- a/src/Models/Traits/WithChildren.php +++ b/src/Models/Concerns/WithChildren.php @@ -2,12 +2,12 @@ /** * Playground */ -namespace Playground\Models\Traits; +namespace Playground\Models\Concerns; use Illuminate\Database\Eloquent\Relations\HasMany; /** - * \Playground\Models\Traits\WithChildren + * \Playground\Models\Concerns\WithChildren */ trait WithChildren { diff --git a/src/Models/Traits/WithCreator.php b/src/Models/Concerns/WithCreator.php similarity index 84% rename from src/Models/Traits/WithCreator.php rename to src/Models/Concerns/WithCreator.php index a4a1647..16afdf9 100644 --- a/src/Models/Traits/WithCreator.php +++ b/src/Models/Concerns/WithCreator.php @@ -2,12 +2,12 @@ /** * Playground */ -namespace Playground\Models\Traits; +namespace Playground\Models\Concerns; use Illuminate\Database\Eloquent\Relations\HasOne; /** - * \Playground\Models\Traits\WithCreator + * \Playground\Models\Concerns\WithCreator */ trait WithCreator { diff --git a/src/Models/Traits/WithModifier.php b/src/Models/Concerns/WithModifier.php similarity index 84% rename from src/Models/Traits/WithModifier.php rename to src/Models/Concerns/WithModifier.php index beb8e38..4a171aa 100644 --- a/src/Models/Traits/WithModifier.php +++ b/src/Models/Concerns/WithModifier.php @@ -2,12 +2,12 @@ /** * Playground */ -namespace Playground\Models\Traits; +namespace Playground\Models\Concerns; use Illuminate\Database\Eloquent\Relations\HasOne; /** - * \Playground\Models\Traits\WithModifier + * \Playground\Models\Concerns\WithModifier */ trait WithModifier { diff --git a/src/Models/Traits/WithOwner.php b/src/Models/Concerns/WithOwner.php similarity index 84% rename from src/Models/Traits/WithOwner.php rename to src/Models/Concerns/WithOwner.php index 302ad9b..083d4a2 100644 --- a/src/Models/Traits/WithOwner.php +++ b/src/Models/Concerns/WithOwner.php @@ -2,12 +2,12 @@ /** * Playground */ -namespace Playground\Models\Traits; +namespace Playground\Models\Concerns; use Illuminate\Database\Eloquent\Relations\HasOne; /** - * \Playground\Models\Traits\WithOwner + * \Playground\Models\Concerns\WithOwner */ trait WithOwner { diff --git a/src/Models/Traits/WithParent.php b/src/Models/Concerns/WithParent.php similarity index 80% rename from src/Models/Traits/WithParent.php rename to src/Models/Concerns/WithParent.php index 51a37ba..b84eb2d 100644 --- a/src/Models/Traits/WithParent.php +++ b/src/Models/Concerns/WithParent.php @@ -2,12 +2,12 @@ /** * Playground */ -namespace Playground\Models\Traits; +namespace Playground\Models\Concerns; use Illuminate\Database\Eloquent\Relations\HasOne; /** - * \Playground\Models\Traits\WithParent + * \Playground\Models\Concerns\WithParent */ trait WithParent { diff --git a/src/Models/Interfaces/WithRevisionInterface.php b/src/Models/Contracts/Revision.php similarity index 70% rename from src/Models/Interfaces/WithRevisionInterface.php rename to src/Models/Contracts/Revision.php index 331e9be..61301a5 100644 --- a/src/Models/Interfaces/WithRevisionInterface.php +++ b/src/Models/Contracts/Revision.php @@ -2,12 +2,12 @@ /** * Playground */ -namespace Playground\Models\Interfaces; +namespace Playground\Models\Contracts; use Illuminate\Database\Eloquent\Relations\HasMany; /** - * \Playground\Models\Interfaces\WithRevisionInterface + * \Playground\Models\Contracts\WithRevisionInterface */ interface WithRevisionInterface { diff --git a/src/Models/Interfaces/WithChildrenInterface.php b/src/Models/Contracts/WithChildren.php similarity index 60% rename from src/Models/Interfaces/WithChildrenInterface.php rename to src/Models/Contracts/WithChildren.php index 741a499..248f811 100644 --- a/src/Models/Interfaces/WithChildrenInterface.php +++ b/src/Models/Contracts/WithChildren.php @@ -2,14 +2,14 @@ /** * Playground */ -namespace Playground\Models\Interfaces; +namespace Playground\Models\Contracts; use Illuminate\Database\Eloquent\Relations\HasMany; /** - * \Playground\Models\Interfaces\WithChildrenInterface + * \Playground\Models\Contracts\WithChildren */ -interface WithChildrenInterface +interface WithChildren { /** * Get the children under the model. diff --git a/src/Models/Interfaces/WithCreatorInterface.php b/src/Models/Contracts/WithCreator.php similarity index 59% rename from src/Models/Interfaces/WithCreatorInterface.php rename to src/Models/Contracts/WithCreator.php index ecf67f7..a9eedd5 100644 --- a/src/Models/Interfaces/WithCreatorInterface.php +++ b/src/Models/Contracts/WithCreator.php @@ -2,14 +2,14 @@ /** * Playground */ -namespace Playground\Models\Interfaces; +namespace Playground\Models\Contracts; use Illuminate\Database\Eloquent\Relations\HasOne; /** - * \Playground\Models\Interfaces\WithCreatorInterface + * \Playground\Models\Contracts\WithCreator */ -interface WithCreatorInterface +interface WithCreator { /** * Get the creator of the model. diff --git a/src/Models/Contracts/WithMatrix.php b/src/Models/Contracts/WithMatrix.php new file mode 100644 index 0000000..07db815 --- /dev/null +++ b/src/Models/Contracts/WithMatrix.php @@ -0,0 +1,24 @@ + 0, 'rank' => 0, 'size' => 0, + 'matrix' => '', + 'x' => null, + 'y' => null, + 'z' => null, + 'r' => null, + 'theta' => null, + 'rho' => null, + 'phi' => null, + 'elevation' => null, + 'latitude' => null, + 'longitude' => null, 'active' => true, 'banned' => false, 'flagged' => false, diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 0f19db7..013d590 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -70,16 +70,16 @@ public function about(array $config): void 'User Illuminate\Auth\Authenticatable' => $this->userHasAuthenticatableConcerns ? 'USED' : 'NOT USED', 'User Illuminate\Contracts\Auth\Authenticatable' => $this->userHasAuthenticatableContracts ? 'IMPLEMENTED' : 'NOT IMPLEMENTED', - 'User Playground\Models\Traits\Abilities' => $this->userPlaygroundAbilitiesConcerns ? 'USED' : 'NOT USED', + 'User Playground\Models\Concerns\Abilities' => $this->userPlaygroundAbilitiesConcerns ? 'USED' : 'NOT USED', 'User Playground\Models\Contracts\Abilities' => $this->userHasPlaygroundAbilitiesContracts ? 'IMPLEMENTED' : 'NOT IMPLEMENTED', - 'User Playground\Models\Traits\Admin' => $this->userPlaygroundAdminConcerns ? 'USED' : 'NOT USED', + 'User Playground\Models\Concerns\Admin' => $this->userPlaygroundAdminConcerns ? 'USED' : 'NOT USED', 'User Playground\Models\Contracts\Admin' => $this->userHasPlaygroundAdminContracts ? 'IMPLEMENTED' : 'NOT IMPLEMENTED', - 'User Playground\Models\Traits\Privileges' => $this->userPlaygroundPrivilegesConcerns ? 'USED' : 'NOT USED', + 'User Playground\Models\Concerns\Privileges' => $this->userPlaygroundPrivilegesConcerns ? 'USED' : 'NOT USED', 'User Playground\Models\Contracts\Privileges' => $this->userHasPlaygroundPrivilegesContracts ? 'IMPLEMENTED' : 'NOT IMPLEMENTED', - 'User Playground\Models\Traits\Role' => $this->userPlaygroundRoleConcerns ? 'USED' : 'NOT USED', + 'User Playground\Models\Concerns\Role' => $this->userPlaygroundRoleConcerns ? 'USED' : 'NOT USED', 'User Playground\Models\Contracts\Role' => $this->userHasPlaygroundRoleContracts ? 'IMPLEMENTED' : 'NOT IMPLEMENTED', 'Packages' => implode(', ', $packages), @@ -173,16 +173,16 @@ private function userPrimaryKeyTypeParse(string $auth_providers_users_model): st $this->userHasMustVerifyEmail = $user instanceof \Illuminate\Contracts\Auth\MustVerifyEmail; - $this->userPlaygroundAbilitiesConcerns = in_array(Models\Traits\Abilities::class, class_uses_recursive($user)); + $this->userPlaygroundAbilitiesConcerns = in_array(Models\Concerns\Abilities::class, class_uses_recursive($user)); $this->userHasPlaygroundAbilitiesContracts = $user instanceof Models\Contracts\Abilities; - $this->userPlaygroundAdminConcerns = in_array(Models\Traits\Admin::class, class_uses_recursive($user)); + $this->userPlaygroundAdminConcerns = in_array(Models\Concerns\Admin::class, class_uses_recursive($user)); $this->userHasPlaygroundAdminContracts = $user instanceof Models\Contracts\Admin; - $this->userPlaygroundPrivilegesConcerns = in_array(Models\Traits\Privileges::class, class_uses_recursive($user)); + $this->userPlaygroundPrivilegesConcerns = in_array(Models\Concerns\Privileges::class, class_uses_recursive($user)); $this->userHasPlaygroundPrivilegesContracts = $user instanceof Models\Contracts\Privileges; - $this->userPlaygroundRoleConcerns = in_array(Models\Traits\Role::class, class_uses_recursive($user)); + $this->userPlaygroundRoleConcerns = in_array(Models\Concerns\Role::class, class_uses_recursive($user)); $this->userHasPlaygroundRoleContracts = $user instanceof Models\Contracts\Role; if (in_array(\Illuminate\Database\Eloquent\Concerns\HasUuids::class, class_uses_recursive($user)) diff --git a/tests/Unit/Models/Traits/ScopeFilterColumns/ModelTest.php b/tests/Unit/Models/Scopes/ScopeFilterColumns/ModelTest.php similarity index 99% rename from tests/Unit/Models/Traits/ScopeFilterColumns/ModelTest.php rename to tests/Unit/Models/Scopes/ScopeFilterColumns/ModelTest.php index d36b4ab..f5f17d4 100644 --- a/tests/Unit/Models/Traits/ScopeFilterColumns/ModelTest.php +++ b/tests/Unit/Models/Scopes/ScopeFilterColumns/ModelTest.php @@ -2,7 +2,7 @@ /** * Playground */ -namespace Tests\Unit\Playground\Models\Traits\ScopeFilterColumns; +namespace Tests\Unit\Playground\Models\Scopes\ScopeFilterColumns; use Illuminate\Database\Eloquent\Builder; use PHPUnit\Framework\MockObject\MockObject; @@ -11,7 +11,7 @@ use Tests\Unit\Playground\TestCase; /** - * \Tests\Unit\Playground\Models\Traits\ScopeFilterColumns\ModelTest + * \Tests\Unit\Playground\Models\Scopes\ScopeFilterColumns\ModelTest */ class ModelTest extends TestCase { diff --git a/tests/Unit/Models/Traits/ScopeFilterDates/ModelTest.php b/tests/Unit/Models/Scopes/ScopeFilterDates/ModelTest.php similarity index 99% rename from tests/Unit/Models/Traits/ScopeFilterDates/ModelTest.php rename to tests/Unit/Models/Scopes/ScopeFilterDates/ModelTest.php index 04fa435..cada017 100644 --- a/tests/Unit/Models/Traits/ScopeFilterDates/ModelTest.php +++ b/tests/Unit/Models/Scopes/ScopeFilterDates/ModelTest.php @@ -2,7 +2,7 @@ /** * Playground */ -namespace Tests\Unit\Playground\Models\Traits\ScopeFilterDates; +namespace Tests\Unit\Playground\Models\Scopes\ScopeFilterDates; use Illuminate\Database\Eloquent\Builder; use Illuminate\Support\Carbon; @@ -12,7 +12,7 @@ use Tests\Unit\Playground\TestCase; /** - * \Tests\Unit\Playground\Models\Traits\ScopeFilterDates\ModelTest + * \Tests\Unit\Playground\Models\Scopes\ScopeFilterDates\ModelTest */ class ModelTest extends TestCase { diff --git a/tests/Unit/Models/Traits/ScopeFilterFlags/ModelTest.php b/tests/Unit/Models/Scopes/ScopeFilterFlags/ModelTest.php similarity index 96% rename from tests/Unit/Models/Traits/ScopeFilterFlags/ModelTest.php rename to tests/Unit/Models/Scopes/ScopeFilterFlags/ModelTest.php index 582782a..9a704a0 100644 --- a/tests/Unit/Models/Traits/ScopeFilterFlags/ModelTest.php +++ b/tests/Unit/Models/Scopes/ScopeFilterFlags/ModelTest.php @@ -2,7 +2,7 @@ /** * Playground */ -namespace Tests\Unit\Playground\Models\Traits\ScopeFilterFlags; +namespace Tests\Unit\Playground\Models\Scopes\ScopeFilterFlags; use Illuminate\Database\Eloquent\Builder; use PHPUnit\Framework\MockObject\MockObject; @@ -11,7 +11,7 @@ use Tests\Unit\Playground\TestCase; /** - * \Tests\Unit\Playground\Models\Traits\ScopeFilterFlags\ModelTest + * \Tests\Unit\Playground\Models\Scopes\ScopeFilterFlags\ModelTest */ class ModelTest extends TestCase { diff --git a/tests/Unit/Models/Traits/ScopeFilterIds/ModelTest.php b/tests/Unit/Models/Scopes/ScopeFilterIds/ModelTest.php similarity index 99% rename from tests/Unit/Models/Traits/ScopeFilterIds/ModelTest.php rename to tests/Unit/Models/Scopes/ScopeFilterIds/ModelTest.php index 1850667..0071643 100644 --- a/tests/Unit/Models/Traits/ScopeFilterIds/ModelTest.php +++ b/tests/Unit/Models/Scopes/ScopeFilterIds/ModelTest.php @@ -2,7 +2,7 @@ /** * Playground */ -namespace Tests\Unit\Playground\Models\Traits\ScopeFilterIds; +namespace Tests\Unit\Playground\Models\Scopes\ScopeFilterIds; use Illuminate\Database\Eloquent\Builder; use PHPUnit\Framework\MockObject\MockObject; @@ -11,7 +11,7 @@ use Tests\Unit\Playground\TestCase; /** - * \Tests\Unit\Playground\Models\Traits\ScopeFilterIds\ModelTest + * \Tests\Unit\Playground\Models\Scopes\ScopeFilterIds\ModelTest */ class ModelTest extends TestCase { diff --git a/tests/Unit/Models/Traits/ScopeFilterTrash/ModelTest.php b/tests/Unit/Models/Scopes/ScopeFilterTrash/ModelTest.php similarity index 95% rename from tests/Unit/Models/Traits/ScopeFilterTrash/ModelTest.php rename to tests/Unit/Models/Scopes/ScopeFilterTrash/ModelTest.php index dc1018a..1858263 100644 --- a/tests/Unit/Models/Traits/ScopeFilterTrash/ModelTest.php +++ b/tests/Unit/Models/Scopes/ScopeFilterTrash/ModelTest.php @@ -2,7 +2,7 @@ /** * Playground */ -namespace Tests\Unit\Playground\Models\Traits\ScopeFilterTrash; +namespace Tests\Unit\Playground\Models\Scopes\ScopeFilterTrash; use Illuminate\Database\Eloquent\Builder; use PHPUnit\Framework\MockObject\MockObject; @@ -11,7 +11,7 @@ use Tests\Unit\Playground\TestCase; /** - * \Tests\Unit\Playground\Models\Traits\ScopeFilterTrash\ModelTest + * \Tests\Unit\Playground\Models\Scopes\ScopeFilterTrash\ModelTest */ class ModelTest extends TestCase { diff --git a/tests/Unit/Models/Traits/ScopeSort/ModelTest.php b/tests/Unit/Models/Scopes/ScopeSort/ModelTest.php similarity index 98% rename from tests/Unit/Models/Traits/ScopeSort/ModelTest.php rename to tests/Unit/Models/Scopes/ScopeSort/ModelTest.php index 1b0db61..fa2dc52 100644 --- a/tests/Unit/Models/Traits/ScopeSort/ModelTest.php +++ b/tests/Unit/Models/Scopes/ScopeSort/ModelTest.php @@ -2,7 +2,7 @@ /** * Playground */ -namespace Tests\Unit\Playground\Models\Traits\ScopeSort; +namespace Tests\Unit\Playground\Models\Scopes\ScopeSort; use Illuminate\Database\Eloquent\Builder; use PHPUnit\Framework\MockObject\MockObject; @@ -11,7 +11,7 @@ use Tests\Unit\Playground\TestCase; /** - * \Tests\Unit\Playground\Models\Traits\ScopeSort\ModelTest + * \Tests\Unit\Playground\Models\Scopes\ScopeSort\ModelTest */ class ModelTest extends TestCase { diff --git a/tests/Unit/Models/User/ModelTest.php b/tests/Unit/Models/User/ModelTest.php index 99ae807..4b46810 100644 --- a/tests/Unit/Models/User/ModelTest.php +++ b/tests/Unit/Models/User/ModelTest.php @@ -155,5 +155,6 @@ public function test_isAdmin_with_admins_and_users(): void $this->assertTrue($instance_admin_secondary->hasRole('manager')); $instance_admin_secondary->addRole('admin'); $this->assertTrue($instance_admin_secondary->isAdmin()); + // dump($instance_root->toArray()); } }