From e40a5d6e1518edb6d0bf44d1ca2525e690e138d0 Mon Sep 17 00:00:00 2001 From: Anton Komarev <1849174+antonkomarev@users.noreply.github.com> Date: Sat, 25 Feb 2023 17:35:15 +0300 Subject: [PATCH] Remove legacy factories (#79) --- composer.json | 6 +-- phpunit.xml.dist | 1 - .../Models/Classic/EntityWithAcceptedAt.php | 4 +- .../Classic/EntityWithAcceptedAtApplied.php | 2 +- .../Classic/EntityWithAcceptedAtUnapplied.php | 2 +- .../Models/Classic/EntityWithAcceptedFlag.php | 4 +- .../Classic/EntityWithAcceptedFlagApplied.php | 2 +- .../EntityWithAcceptedFlagUnapplied.php | 2 +- .../Models/Classic/EntityWithActiveFlag.php | 4 +- .../Classic/EntityWithActiveFlagApplied.php | 2 +- .../Classic/EntityWithActiveFlagUnapplied.php | 2 +- .../Models/Classic/EntityWithApprovedAt.php | 4 +- .../Classic/EntityWithApprovedAtApplied.php | 2 +- .../Classic/EntityWithApprovedAtUnapplied.php | 2 +- .../Models/Classic/EntityWithApprovedFlag.php | 4 +- .../Classic/EntityWithApprovedFlagApplied.php | 2 +- .../EntityWithApprovedFlagUnapplied.php | 2 +- .../Models/Classic/EntityWithInvitedAt.php | 4 +- .../Classic/EntityWithInvitedAtApplied.php | 2 +- .../Classic/EntityWithInvitedAtUnapplied.php | 2 +- .../Models/Classic/EntityWithInvitedFlag.php | 4 +- .../Classic/EntityWithInvitedFlagApplied.php | 2 +- .../EntityWithInvitedFlagUnapplied.php | 2 +- .../Models/Classic/EntityWithKeptFlag.php | 4 +- .../Classic/EntityWithKeptFlagApplied.php | 2 +- .../Classic/EntityWithKeptFlagUnapplied.php | 2 +- .../Models/Classic/EntityWithPublishedAt.php | 4 +- .../Classic/EntityWithPublishedAtApplied.php | 2 +- .../EntityWithPublishedAtUnapplied.php | 2 +- .../Classic/EntityWithPublishedFlag.php | 4 +- .../EntityWithPublishedFlagApplied.php | 2 +- .../EntityWithPublishedFlagUnapplied.php | 2 +- .../Models/Classic/EntityWithVerifiedAt.php | 4 +- .../Classic/EntityWithVerifiedAtApplied.php | 2 +- .../Classic/EntityWithVerifiedAtUnapplied.php | 2 +- .../Models/Classic/EntityWithVerifiedFlag.php | 4 +- .../Classic/EntityWithVerifiedFlagApplied.php | 2 +- .../EntityWithVerifiedFlagUnapplied.php | 2 +- .../Models/Inverse/EntityWithArchivedAt.php | 4 +- .../Inverse/EntityWithArchivedAtApplied.php | 2 +- .../Inverse/EntityWithArchivedAtUnapplied.php | 2 +- .../Models/Inverse/EntityWithArchivedFlag.php | 4 +- .../Inverse/EntityWithArchivedFlagApplied.php | 2 +- .../EntityWithArchivedFlagUnapplied.php | 2 +- .../Models/Inverse/EntityWithClosedAt.php | 4 +- .../Inverse/EntityWithClosedAtApplied.php | 2 +- .../Inverse/EntityWithClosedAtUnapplied.php | 2 +- .../Models/Inverse/EntityWithClosedFlag.php | 4 +- .../Inverse/EntityWithClosedFlagApplied.php | 2 +- .../Inverse/EntityWithClosedFlagUnapplied.php | 2 +- .../Models/Inverse/EntityWithDraftedAt.php | 4 +- .../Inverse/EntityWithDraftedAtApplied.php | 2 +- .../Inverse/EntityWithDraftedAtUnapplied.php | 2 +- .../Models/Inverse/EntityWithDraftedFlag.php | 4 +- .../Inverse/EntityWithDraftedFlagApplied.php | 2 +- .../EntityWithDraftedFlagUnapplied.php | 2 +- .../Models/Inverse/EntityWithEndedAt.php | 4 +- .../Inverse/EntityWithEndedAtApplied.php | 2 +- .../Inverse/EntityWithEndedAtUnapplied.php | 2 +- .../Models/Inverse/EntityWithEndedFlag.php | 4 +- .../Inverse/EntityWithEndedFlagApplied.php | 2 +- .../Inverse/EntityWithEndedFlagUnapplied.php | 2 +- .../Models/Inverse/EntityWithExpiredAt.php | 4 +- .../Inverse/EntityWithExpiredAtApplied.php | 2 +- .../Inverse/EntityWithExpiredAtUnapplied.php | 2 +- .../Models/Inverse/EntityWithExpiredFlag.php | 4 +- .../Inverse/EntityWithExpiredFlagApplied.php | 2 +- .../EntityWithExpiredFlagUnapplied.php | 2 +- tests/TestCase.php | 8 ++-- .../Scopes/Classic/AcceptedAtScopeTest.php | 38 +++++++++---------- .../Scopes/Classic/AcceptedFlagScopeTest.php | 38 +++++++++---------- .../Scopes/Classic/ActiveFlagScopeTest.php | 38 +++++++++---------- .../Scopes/Classic/ApprovedAtScopeTest.php | 38 +++++++++---------- .../Scopes/Classic/ApprovedFlagScopeTest.php | 38 +++++++++---------- .../Scopes/Classic/InvitedAtScopeTest.php | 38 +++++++++---------- .../Scopes/Classic/InvitedFlagScopeTest.php | 38 +++++++++---------- .../Unit/Scopes/Classic/KeptFlagScopeTest.php | 38 +++++++++---------- .../Scopes/Classic/PublishedAtScopeTest.php | 38 +++++++++---------- .../Scopes/Classic/PublishedFlagScopeTest.php | 38 +++++++++---------- .../Scopes/Classic/VerifiedAtScopeTest.php | 38 +++++++++---------- .../Scopes/Classic/VerifiedFlagScopeTest.php | 38 +++++++++---------- .../Scopes/Inverse/ArchivedAtScopeTest.php | 38 +++++++++---------- .../Scopes/Inverse/ArchivedFlagScopeTest.php | 38 +++++++++---------- .../Unit/Scopes/Inverse/ClosedAtScopeTest.php | 38 +++++++++---------- .../Scopes/Inverse/ClosedFlagScopeTest.php | 38 +++++++++---------- .../Scopes/Inverse/DraftedAtScopeTest.php | 38 +++++++++---------- .../Scopes/Inverse/DraftedFlagScopeTest.php | 38 +++++++++---------- .../Unit/Scopes/Inverse/EndedAtScopeTest.php | 38 +++++++++---------- .../Scopes/Inverse/EndedFlagScopeTest.php | 38 +++++++++---------- .../Scopes/Inverse/ExpiredAtScopeTest.php | 38 +++++++++---------- .../Scopes/Inverse/ExpiredFlagScopeTest.php | 38 +++++++++---------- .../Classic/HasAcceptedAtHelpersTest.php | 20 +++++----- .../Classic/HasAcceptedFlagHelpersTest.php | 22 +++++------ .../Classic/HasActiveFlagHelpersTest.php | 22 +++++------ .../Classic/HasApprovedAtHelpersTest.php | 20 +++++----- .../Classic/HasApprovedFlagHelpersTest.php | 22 +++++------ .../Classic/HasInvitedAtHelpersTest.php | 20 +++++----- .../Classic/HasInvitedFlagHelpersTest.php | 22 +++++------ .../Classic/HasKeptFlagBehaviorTest.php | 8 ++-- .../Traits/Classic/HasKeptFlagHelperTest.php | 30 +++++++-------- .../Classic/HasPublishedAtHelpersTest.php | 20 +++++----- .../Classic/HasPublishedFlagHelpersTest.php | 22 +++++------ .../Classic/HasVerifiedAtHelpersTest.php | 20 +++++----- .../Classic/HasVerifiedFlagHelpersTest.php | 22 +++++------ .../Inverse/HasArchivedAtHelpersTest.php | 20 +++++----- .../Inverse/HasArchivedFlagHelpersTest.php | 22 +++++------ .../Traits/Inverse/HasClosedAtHelpersTest.php | 20 +++++----- .../Inverse/HasClosedFlagHelpersTest.php | 22 +++++------ .../Inverse/HasDraftedAtHelpersTest.php | 20 +++++----- .../Inverse/HasDraftedFlagHelpersTest.php | 22 +++++------ .../Traits/Inverse/HasEndedAtHelpersTest.php | 20 +++++----- .../Inverse/HasEndedFlagHelpersTest.php | 22 +++++------ .../Inverse/HasExpiredAtHelpersTest.php | 20 +++++----- .../Inverse/HasExpiredFlagHelpersTest.php | 22 +++++------ .../factories/EntityWithAcceptedAtFactory.php | 32 +++++++++++----- .../EntityWithAcceptedFlagFactory.php | 32 +++++++++++----- .../factories/EntityWithActiveFlagFactory.php | 32 +++++++++++----- .../factories/EntityWithApprovedAtFactory.php | 32 +++++++++++----- .../EntityWithApprovedFlagFactory.php | 32 +++++++++++----- .../factories/EntityWithArchivedAtFactory.php | 32 +++++++++++----- .../EntityWithArchivedFlagFactory.php | 32 +++++++++++----- .../factories/EntityWithClosedAtFactory.php | 32 +++++++++++----- .../factories/EntityWithClosedFlagFactory.php | 32 +++++++++++----- .../factories/EntityWithDraftedAtFactory.php | 32 +++++++++++----- .../EntityWithDraftedFlagFactory.php | 32 +++++++++++----- .../factories/EntityWithEndedAtFactory.php | 32 +++++++++++----- .../factories/EntityWithEndedFlagFactory.php | 32 +++++++++++----- .../factories/EntityWithExpiredAtFactory.php | 32 +++++++++++----- .../EntityWithExpiredFlagFactory.php | 32 +++++++++++----- .../factories/EntityWithInvitedAtFactory.php | 32 +++++++++++----- .../EntityWithInvitedFlagFactory.php | 32 +++++++++++----- .../factories/EntityWithKeptFlagFactory.php | 32 +++++++++++----- .../EntityWithPublishedAtFactory.php | 32 +++++++++++----- .../EntityWithPublishedFlagFactory.php | 32 +++++++++++----- .../factories/EntityWithVerifiedAtFactory.php | 32 +++++++++++----- .../EntityWithVerifiedFlagFactory.php | 32 +++++++++++----- 136 files changed, 1260 insertions(+), 951 deletions(-) diff --git a/composer.json b/composer.json index 93c3c54..38d0f70 100644 --- a/composer.json +++ b/composer.json @@ -54,8 +54,7 @@ }, "require": { "php": "^8.0", - "illuminate/database": "^9.0|^10.0", - "laravel/legacy-factories": "^1.3" + "illuminate/database": "^9.0|^10.0" }, "require-dev": { "mockery/mockery": "^1.0", @@ -69,7 +68,8 @@ }, "autoload-dev": { "psr-4": { - "Cog\\Tests\\Flag\\": "tests/" + "Cog\\Tests\\Laravel\\Flag\\": "tests/", + "Cog\\Tests\\Laravel\\Flag\\Database\\Factories\\": "tests/database/factories/" } }, "scripts": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f20e9e3..51f1008 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -13,7 +13,6 @@ tests/ - tests/database/factories/ diff --git a/tests/Stubs/Models/Classic/EntityWithAcceptedAt.php b/tests/Stubs/Models/Classic/EntityWithAcceptedAt.php index 00a7321..44c1f31 100644 --- a/tests/Stubs/Models/Classic/EntityWithAcceptedAt.php +++ b/tests/Stubs/Models/Classic/EntityWithAcceptedAt.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasAcceptedAt; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithAcceptedAt extends Model { use HasAcceptedAt; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Classic/EntityWithAcceptedAtApplied.php b/tests/Stubs/Models/Classic/EntityWithAcceptedAtApplied.php index 6ee6775..ca70ea2 100644 --- a/tests/Stubs/Models/Classic/EntityWithAcceptedAtApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithAcceptedAtApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasAcceptedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithAcceptedAtUnapplied.php b/tests/Stubs/Models/Classic/EntityWithAcceptedAtUnapplied.php index 5e21a6b..de5ea1a 100644 --- a/tests/Stubs/Models/Classic/EntityWithAcceptedAtUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithAcceptedAtUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasAcceptedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithAcceptedFlag.php b/tests/Stubs/Models/Classic/EntityWithAcceptedFlag.php index 536fbdf..8d69e8f 100644 --- a/tests/Stubs/Models/Classic/EntityWithAcceptedFlag.php +++ b/tests/Stubs/Models/Classic/EntityWithAcceptedFlag.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasAcceptedFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithAcceptedFlag extends Model { use HasAcceptedFlag; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Classic/EntityWithAcceptedFlagApplied.php b/tests/Stubs/Models/Classic/EntityWithAcceptedFlagApplied.php index f320170..11ecf6b 100644 --- a/tests/Stubs/Models/Classic/EntityWithAcceptedFlagApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithAcceptedFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasAcceptedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithAcceptedFlagUnapplied.php b/tests/Stubs/Models/Classic/EntityWithAcceptedFlagUnapplied.php index 9aae969..2c0bdd2 100644 --- a/tests/Stubs/Models/Classic/EntityWithAcceptedFlagUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithAcceptedFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasAcceptedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithActiveFlag.php b/tests/Stubs/Models/Classic/EntityWithActiveFlag.php index dc27a5b..f7ed05c 100644 --- a/tests/Stubs/Models/Classic/EntityWithActiveFlag.php +++ b/tests/Stubs/Models/Classic/EntityWithActiveFlag.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasActiveFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithActiveFlag extends Model { use HasActiveFlag; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Classic/EntityWithActiveFlagApplied.php b/tests/Stubs/Models/Classic/EntityWithActiveFlagApplied.php index 26678cb..b03980f 100644 --- a/tests/Stubs/Models/Classic/EntityWithActiveFlagApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithActiveFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasActiveFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithActiveFlagUnapplied.php b/tests/Stubs/Models/Classic/EntityWithActiveFlagUnapplied.php index 0978d54..e73a59f 100644 --- a/tests/Stubs/Models/Classic/EntityWithActiveFlagUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithActiveFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasActiveFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithApprovedAt.php b/tests/Stubs/Models/Classic/EntityWithApprovedAt.php index 46b97b7..8af6ae0 100644 --- a/tests/Stubs/Models/Classic/EntityWithApprovedAt.php +++ b/tests/Stubs/Models/Classic/EntityWithApprovedAt.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasApprovedAt; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithApprovedAt extends Model { use HasApprovedAt; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Classic/EntityWithApprovedAtApplied.php b/tests/Stubs/Models/Classic/EntityWithApprovedAtApplied.php index cb1ce4e..58d3b73 100644 --- a/tests/Stubs/Models/Classic/EntityWithApprovedAtApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithApprovedAtApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasApprovedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithApprovedAtUnapplied.php b/tests/Stubs/Models/Classic/EntityWithApprovedAtUnapplied.php index 0bb6c14..7dbc821 100644 --- a/tests/Stubs/Models/Classic/EntityWithApprovedAtUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithApprovedAtUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasApprovedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithApprovedFlag.php b/tests/Stubs/Models/Classic/EntityWithApprovedFlag.php index c5759a5..a4c9711 100644 --- a/tests/Stubs/Models/Classic/EntityWithApprovedFlag.php +++ b/tests/Stubs/Models/Classic/EntityWithApprovedFlag.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasApprovedFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithApprovedFlag extends Model { use HasApprovedFlag; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Classic/EntityWithApprovedFlagApplied.php b/tests/Stubs/Models/Classic/EntityWithApprovedFlagApplied.php index 1117ce8..3a2c97b 100644 --- a/tests/Stubs/Models/Classic/EntityWithApprovedFlagApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithApprovedFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasApprovedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithApprovedFlagUnapplied.php b/tests/Stubs/Models/Classic/EntityWithApprovedFlagUnapplied.php index dbf4b19..5401247 100644 --- a/tests/Stubs/Models/Classic/EntityWithApprovedFlagUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithApprovedFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasApprovedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithInvitedAt.php b/tests/Stubs/Models/Classic/EntityWithInvitedAt.php index 6c35ed0..c235e2e 100644 --- a/tests/Stubs/Models/Classic/EntityWithInvitedAt.php +++ b/tests/Stubs/Models/Classic/EntityWithInvitedAt.php @@ -11,13 +11,15 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasInvitedAt; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithInvitedAt extends Model { + use HasFactory; use HasInvitedAt; /** diff --git a/tests/Stubs/Models/Classic/EntityWithInvitedAtApplied.php b/tests/Stubs/Models/Classic/EntityWithInvitedAtApplied.php index e19c694..4b53783 100644 --- a/tests/Stubs/Models/Classic/EntityWithInvitedAtApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithInvitedAtApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasInvitedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithInvitedAtUnapplied.php b/tests/Stubs/Models/Classic/EntityWithInvitedAtUnapplied.php index c259ada..8e26abb 100644 --- a/tests/Stubs/Models/Classic/EntityWithInvitedAtUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithInvitedAtUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasInvitedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithInvitedFlag.php b/tests/Stubs/Models/Classic/EntityWithInvitedFlag.php index 23b750a..c1935f6 100644 --- a/tests/Stubs/Models/Classic/EntityWithInvitedFlag.php +++ b/tests/Stubs/Models/Classic/EntityWithInvitedFlag.php @@ -11,13 +11,15 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasInvitedFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithInvitedFlag extends Model { + use HasFactory; use HasInvitedFlag; /** diff --git a/tests/Stubs/Models/Classic/EntityWithInvitedFlagApplied.php b/tests/Stubs/Models/Classic/EntityWithInvitedFlagApplied.php index c701064..d4d2506 100644 --- a/tests/Stubs/Models/Classic/EntityWithInvitedFlagApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithInvitedFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasInvitedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithInvitedFlagUnapplied.php b/tests/Stubs/Models/Classic/EntityWithInvitedFlagUnapplied.php index 048b972..009cae0 100644 --- a/tests/Stubs/Models/Classic/EntityWithInvitedFlagUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithInvitedFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasInvitedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithKeptFlag.php b/tests/Stubs/Models/Classic/EntityWithKeptFlag.php index 32d84d5..ea25f6c 100644 --- a/tests/Stubs/Models/Classic/EntityWithKeptFlag.php +++ b/tests/Stubs/Models/Classic/EntityWithKeptFlag.php @@ -11,13 +11,15 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasKeptFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithKeptFlag extends Model { + use HasFactory; use HasKeptFlag; /** diff --git a/tests/Stubs/Models/Classic/EntityWithKeptFlagApplied.php b/tests/Stubs/Models/Classic/EntityWithKeptFlagApplied.php index a082de6..ba6bb50 100644 --- a/tests/Stubs/Models/Classic/EntityWithKeptFlagApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithKeptFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasKeptFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithKeptFlagUnapplied.php b/tests/Stubs/Models/Classic/EntityWithKeptFlagUnapplied.php index 5c68050..9fcb3f1 100644 --- a/tests/Stubs/Models/Classic/EntityWithKeptFlagUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithKeptFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasKeptFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithPublishedAt.php b/tests/Stubs/Models/Classic/EntityWithPublishedAt.php index af1cd45..4caf957 100644 --- a/tests/Stubs/Models/Classic/EntityWithPublishedAt.php +++ b/tests/Stubs/Models/Classic/EntityWithPublishedAt.php @@ -11,13 +11,15 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasPublishedAt; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithPublishedAt extends Model { + use HasFactory; use HasPublishedAt; /** diff --git a/tests/Stubs/Models/Classic/EntityWithPublishedAtApplied.php b/tests/Stubs/Models/Classic/EntityWithPublishedAtApplied.php index 47ed936..012606e 100644 --- a/tests/Stubs/Models/Classic/EntityWithPublishedAtApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithPublishedAtApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasPublishedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithPublishedAtUnapplied.php b/tests/Stubs/Models/Classic/EntityWithPublishedAtUnapplied.php index ef12650..43c65b6 100644 --- a/tests/Stubs/Models/Classic/EntityWithPublishedAtUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithPublishedAtUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasPublishedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithPublishedFlag.php b/tests/Stubs/Models/Classic/EntityWithPublishedFlag.php index cd4bf80..28af888 100644 --- a/tests/Stubs/Models/Classic/EntityWithPublishedFlag.php +++ b/tests/Stubs/Models/Classic/EntityWithPublishedFlag.php @@ -11,13 +11,15 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasPublishedFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithPublishedFlag extends Model { + use HasFactory; use HasPublishedFlag; /** diff --git a/tests/Stubs/Models/Classic/EntityWithPublishedFlagApplied.php b/tests/Stubs/Models/Classic/EntityWithPublishedFlagApplied.php index 048558b..12986ce 100644 --- a/tests/Stubs/Models/Classic/EntityWithPublishedFlagApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithPublishedFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasPublishedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithPublishedFlagUnapplied.php b/tests/Stubs/Models/Classic/EntityWithPublishedFlagUnapplied.php index 8dc47ca..1c9211c 100644 --- a/tests/Stubs/Models/Classic/EntityWithPublishedFlagUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithPublishedFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasPublishedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithVerifiedAt.php b/tests/Stubs/Models/Classic/EntityWithVerifiedAt.php index 0c91b94..3db7668 100644 --- a/tests/Stubs/Models/Classic/EntityWithVerifiedAt.php +++ b/tests/Stubs/Models/Classic/EntityWithVerifiedAt.php @@ -11,13 +11,15 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasVerifiedAt; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithVerifiedAt extends Model { + use HasFactory; use HasVerifiedAt; /** diff --git a/tests/Stubs/Models/Classic/EntityWithVerifiedAtApplied.php b/tests/Stubs/Models/Classic/EntityWithVerifiedAtApplied.php index 8d7465a..bedf17f 100644 --- a/tests/Stubs/Models/Classic/EntityWithVerifiedAtApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithVerifiedAtApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasVerifiedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithVerifiedAtUnapplied.php b/tests/Stubs/Models/Classic/EntityWithVerifiedAtUnapplied.php index 87a85c6..fa4b709 100644 --- a/tests/Stubs/Models/Classic/EntityWithVerifiedAtUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithVerifiedAtUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasVerifiedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithVerifiedFlag.php b/tests/Stubs/Models/Classic/EntityWithVerifiedFlag.php index 9739299..dda6c91 100644 --- a/tests/Stubs/Models/Classic/EntityWithVerifiedFlag.php +++ b/tests/Stubs/Models/Classic/EntityWithVerifiedFlag.php @@ -11,13 +11,15 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasVerifiedFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithVerifiedFlag extends Model { + use HasFactory; use HasVerifiedFlag; /** diff --git a/tests/Stubs/Models/Classic/EntityWithVerifiedFlagApplied.php b/tests/Stubs/Models/Classic/EntityWithVerifiedFlagApplied.php index 0fcb4b6..fc67319 100644 --- a/tests/Stubs/Models/Classic/EntityWithVerifiedFlagApplied.php +++ b/tests/Stubs/Models/Classic/EntityWithVerifiedFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasVerifiedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Classic/EntityWithVerifiedFlagUnapplied.php b/tests/Stubs/Models/Classic/EntityWithVerifiedFlagUnapplied.php index b5a02ce..61a9c07 100644 --- a/tests/Stubs/Models/Classic/EntityWithVerifiedFlagUnapplied.php +++ b/tests/Stubs/Models/Classic/EntityWithVerifiedFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Classic; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Classic; use Cog\Flag\Traits\Classic\HasVerifiedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithArchivedAt.php b/tests/Stubs/Models/Inverse/EntityWithArchivedAt.php index 5673aaf..2215d1e 100644 --- a/tests/Stubs/Models/Inverse/EntityWithArchivedAt.php +++ b/tests/Stubs/Models/Inverse/EntityWithArchivedAt.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasArchivedAt; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithArchivedAt extends Model { use HasArchivedAt; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Inverse/EntityWithArchivedAtApplied.php b/tests/Stubs/Models/Inverse/EntityWithArchivedAtApplied.php index ec3bd0a..8519b98 100644 --- a/tests/Stubs/Models/Inverse/EntityWithArchivedAtApplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithArchivedAtApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasArchivedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithArchivedAtUnapplied.php b/tests/Stubs/Models/Inverse/EntityWithArchivedAtUnapplied.php index 65b8096..0e24949 100644 --- a/tests/Stubs/Models/Inverse/EntityWithArchivedAtUnapplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithArchivedAtUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasArchivedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithArchivedFlag.php b/tests/Stubs/Models/Inverse/EntityWithArchivedFlag.php index 0132de2..55c40fe 100644 --- a/tests/Stubs/Models/Inverse/EntityWithArchivedFlag.php +++ b/tests/Stubs/Models/Inverse/EntityWithArchivedFlag.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasArchivedFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithArchivedFlag extends Model { use HasArchivedFlag; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Inverse/EntityWithArchivedFlagApplied.php b/tests/Stubs/Models/Inverse/EntityWithArchivedFlagApplied.php index 66013da..9abbb59 100644 --- a/tests/Stubs/Models/Inverse/EntityWithArchivedFlagApplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithArchivedFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasArchivedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithArchivedFlagUnapplied.php b/tests/Stubs/Models/Inverse/EntityWithArchivedFlagUnapplied.php index 4f0abfd..6e10a02 100644 --- a/tests/Stubs/Models/Inverse/EntityWithArchivedFlagUnapplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithArchivedFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasArchivedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithClosedAt.php b/tests/Stubs/Models/Inverse/EntityWithClosedAt.php index 73095b2..6ca80f1 100644 --- a/tests/Stubs/Models/Inverse/EntityWithClosedAt.php +++ b/tests/Stubs/Models/Inverse/EntityWithClosedAt.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasClosedAt; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithClosedAt extends Model { use HasClosedAt; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Inverse/EntityWithClosedAtApplied.php b/tests/Stubs/Models/Inverse/EntityWithClosedAtApplied.php index 3455bac..e779568 100644 --- a/tests/Stubs/Models/Inverse/EntityWithClosedAtApplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithClosedAtApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasClosedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithClosedAtUnapplied.php b/tests/Stubs/Models/Inverse/EntityWithClosedAtUnapplied.php index f04e65a..0791b09 100644 --- a/tests/Stubs/Models/Inverse/EntityWithClosedAtUnapplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithClosedAtUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasClosedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithClosedFlag.php b/tests/Stubs/Models/Inverse/EntityWithClosedFlag.php index bf92814..f429a19 100644 --- a/tests/Stubs/Models/Inverse/EntityWithClosedFlag.php +++ b/tests/Stubs/Models/Inverse/EntityWithClosedFlag.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasClosedFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithClosedFlag extends Model { use HasClosedFlag; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Inverse/EntityWithClosedFlagApplied.php b/tests/Stubs/Models/Inverse/EntityWithClosedFlagApplied.php index 20e7411..395f167 100644 --- a/tests/Stubs/Models/Inverse/EntityWithClosedFlagApplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithClosedFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasClosedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithClosedFlagUnapplied.php b/tests/Stubs/Models/Inverse/EntityWithClosedFlagUnapplied.php index 2ffbf47..7309d7e 100644 --- a/tests/Stubs/Models/Inverse/EntityWithClosedFlagUnapplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithClosedFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasClosedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithDraftedAt.php b/tests/Stubs/Models/Inverse/EntityWithDraftedAt.php index b0b9572..564642b 100644 --- a/tests/Stubs/Models/Inverse/EntityWithDraftedAt.php +++ b/tests/Stubs/Models/Inverse/EntityWithDraftedAt.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasDraftedAt; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithDraftedAt extends Model { use HasDraftedAt; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Inverse/EntityWithDraftedAtApplied.php b/tests/Stubs/Models/Inverse/EntityWithDraftedAtApplied.php index 01e018a..cfcd9ec 100644 --- a/tests/Stubs/Models/Inverse/EntityWithDraftedAtApplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithDraftedAtApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasDraftedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithDraftedAtUnapplied.php b/tests/Stubs/Models/Inverse/EntityWithDraftedAtUnapplied.php index 174c90e..47c14ca 100644 --- a/tests/Stubs/Models/Inverse/EntityWithDraftedAtUnapplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithDraftedAtUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasDraftedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithDraftedFlag.php b/tests/Stubs/Models/Inverse/EntityWithDraftedFlag.php index 14551c8..0b9c5fb 100644 --- a/tests/Stubs/Models/Inverse/EntityWithDraftedFlag.php +++ b/tests/Stubs/Models/Inverse/EntityWithDraftedFlag.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasDraftedFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithDraftedFlag extends Model { use HasDraftedFlag; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Inverse/EntityWithDraftedFlagApplied.php b/tests/Stubs/Models/Inverse/EntityWithDraftedFlagApplied.php index e4732b7..bdd69af 100644 --- a/tests/Stubs/Models/Inverse/EntityWithDraftedFlagApplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithDraftedFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasDraftedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithDraftedFlagUnapplied.php b/tests/Stubs/Models/Inverse/EntityWithDraftedFlagUnapplied.php index b6ad61c..22c87dc 100644 --- a/tests/Stubs/Models/Inverse/EntityWithDraftedFlagUnapplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithDraftedFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasDraftedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithEndedAt.php b/tests/Stubs/Models/Inverse/EntityWithEndedAt.php index 11bf2af..5b30cd1 100644 --- a/tests/Stubs/Models/Inverse/EntityWithEndedAt.php +++ b/tests/Stubs/Models/Inverse/EntityWithEndedAt.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasEndedAt; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithEndedAt extends Model { use HasEndedAt; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Inverse/EntityWithEndedAtApplied.php b/tests/Stubs/Models/Inverse/EntityWithEndedAtApplied.php index 2dbf8bd..b6d76c9 100644 --- a/tests/Stubs/Models/Inverse/EntityWithEndedAtApplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithEndedAtApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasEndedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithEndedAtUnapplied.php b/tests/Stubs/Models/Inverse/EntityWithEndedAtUnapplied.php index 7a94754..927ac25 100644 --- a/tests/Stubs/Models/Inverse/EntityWithEndedAtUnapplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithEndedAtUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasEndedAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithEndedFlag.php b/tests/Stubs/Models/Inverse/EntityWithEndedFlag.php index f3564d6..258b1f0 100644 --- a/tests/Stubs/Models/Inverse/EntityWithEndedFlag.php +++ b/tests/Stubs/Models/Inverse/EntityWithEndedFlag.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasEndedFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithEndedFlag extends Model { use HasEndedFlag; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Inverse/EntityWithEndedFlagApplied.php b/tests/Stubs/Models/Inverse/EntityWithEndedFlagApplied.php index ccea986..3418f76 100644 --- a/tests/Stubs/Models/Inverse/EntityWithEndedFlagApplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithEndedFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasEndedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithEndedFlagUnapplied.php b/tests/Stubs/Models/Inverse/EntityWithEndedFlagUnapplied.php index 8aff0a8..5b3c346 100644 --- a/tests/Stubs/Models/Inverse/EntityWithEndedFlagUnapplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithEndedFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasEndedFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithExpiredAt.php b/tests/Stubs/Models/Inverse/EntityWithExpiredAt.php index 41f0b37..6f83d0f 100644 --- a/tests/Stubs/Models/Inverse/EntityWithExpiredAt.php +++ b/tests/Stubs/Models/Inverse/EntityWithExpiredAt.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasExpiredAt; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithExpiredAt extends Model { use HasExpiredAt; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Inverse/EntityWithExpiredAtApplied.php b/tests/Stubs/Models/Inverse/EntityWithExpiredAtApplied.php index 5133674..fe94a24 100644 --- a/tests/Stubs/Models/Inverse/EntityWithExpiredAtApplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithExpiredAtApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasExpiredAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithExpiredAtUnapplied.php b/tests/Stubs/Models/Inverse/EntityWithExpiredAtUnapplied.php index e0b6345..679a7ae 100644 --- a/tests/Stubs/Models/Inverse/EntityWithExpiredAtUnapplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithExpiredAtUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasExpiredAt; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithExpiredFlag.php b/tests/Stubs/Models/Inverse/EntityWithExpiredFlag.php index 54351df..9ce7835 100644 --- a/tests/Stubs/Models/Inverse/EntityWithExpiredFlag.php +++ b/tests/Stubs/Models/Inverse/EntityWithExpiredFlag.php @@ -11,14 +11,16 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasExpiredFlag; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; final class EntityWithExpiredFlag extends Model { use HasExpiredFlag; + use HasFactory; /** * The table associated with the model. diff --git a/tests/Stubs/Models/Inverse/EntityWithExpiredFlagApplied.php b/tests/Stubs/Models/Inverse/EntityWithExpiredFlagApplied.php index efa0e31..e8d2846 100644 --- a/tests/Stubs/Models/Inverse/EntityWithExpiredFlagApplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithExpiredFlagApplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasExpiredFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/Stubs/Models/Inverse/EntityWithExpiredFlagUnapplied.php b/tests/Stubs/Models/Inverse/EntityWithExpiredFlagUnapplied.php index 09fbf76..f1d3edc 100644 --- a/tests/Stubs/Models/Inverse/EntityWithExpiredFlagUnapplied.php +++ b/tests/Stubs/Models/Inverse/EntityWithExpiredFlagUnapplied.php @@ -11,7 +11,7 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Stubs\Models\Inverse; +namespace Cog\Tests\Laravel\Flag\Stubs\Models\Inverse; use Cog\Flag\Traits\Inverse\HasExpiredFlag; use Illuminate\Database\Eloquent\Model; diff --git a/tests/TestCase.php b/tests/TestCase.php index 220adb2..ba58975 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -11,8 +11,9 @@ declare(strict_types=1); -namespace Cog\Tests\Flag; +namespace Cog\Tests\Laravel\Flag; +use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Facades\File; use Orchestra\Testbench\TestCase as Orchestra; @@ -90,7 +91,8 @@ protected function migrateTablesUndo(): void */ private function registerPackageFactories(): void { - $pathToFactories = realpath(__DIR__ . '/database/factories'); - $this->withFactories($pathToFactories); + Factory::guessFactoryNamesUsing(function (string $modelName) { + return 'Cog\\Tests\\Laravel\\Flag\\Database\\Factories\\' . class_basename($modelName) . 'Factory'; + }); } } diff --git a/tests/Unit/Scopes/Classic/AcceptedAtScopeTest.php b/tests/Unit/Scopes/Classic/AcceptedAtScopeTest.php index c500049..77de69b 100644 --- a/tests/Unit/Scopes/Classic/AcceptedAtScopeTest.php +++ b/tests/Unit/Scopes/Classic/AcceptedAtScopeTest.php @@ -11,12 +11,12 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedAt; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedAtApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedAtUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithAcceptedAt; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithAcceptedAtApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithAcceptedAtUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class AcceptedAtScopeTest extends TestCase @@ -24,10 +24,10 @@ final class AcceptedAtScopeTest extends TestCase /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithAcceptedAt::class, 3)->create([ + EntityWithAcceptedAt::factory()->count(3)->create([ 'accepted_at' => Date::now()->subDay(), ]); - factory(EntityWithAcceptedAt::class, 2)->create([ + EntityWithAcceptedAt::factory()->count(2)->create([ 'accepted_at' => null, ]); @@ -39,10 +39,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_accepted(): void { - factory(EntityWithAcceptedAt::class, 3)->create([ + EntityWithAcceptedAt::factory()->count(3)->create([ 'accepted_at' => Date::now()->subDay(), ]); - factory(EntityWithAcceptedAt::class, 2)->create([ + EntityWithAcceptedAt::factory()->count(2)->create([ 'accepted_at' => null, ]); @@ -54,10 +54,10 @@ public function it_can_get_without_not_accepted(): void /** @test */ public function it_can_get_with_not_accepted(): void { - factory(EntityWithAcceptedAt::class, 3)->create([ + EntityWithAcceptedAt::factory()->count(3)->create([ 'accepted_at' => Date::now()->subDay(), ]); - factory(EntityWithAcceptedAt::class, 2)->create([ + EntityWithAcceptedAt::factory()->count(2)->create([ 'accepted_at' => null, ]); @@ -69,10 +69,10 @@ public function it_can_get_with_not_accepted(): void /** @test */ public function it_can_get_only_not_accepted(): void { - factory(EntityWithAcceptedAt::class, 3)->create([ + EntityWithAcceptedAt::factory()->count(3)->create([ 'accepted_at' => Date::now()->subDay(), ]); - factory(EntityWithAcceptedAt::class, 2)->create([ + EntityWithAcceptedAt::factory()->count(2)->create([ 'accepted_at' => null, ]); @@ -84,7 +84,7 @@ public function it_can_get_only_not_accepted(): void /** @test */ public function it_can_accept_model(): void { - $model = factory(EntityWithAcceptedAt::class)->create([ + $model = EntityWithAcceptedAt::factory()->create([ 'accepted_at' => null, ]); @@ -98,7 +98,7 @@ public function it_can_accept_model(): void /** @test */ public function it_can_undo_accept(): void { - $model = factory(EntityWithAcceptedAt::class)->create([ + $model = EntityWithAcceptedAt::factory()->create([ 'accepted_at' => Date::now()->subDay(), ]); @@ -112,10 +112,10 @@ public function it_can_undo_accept(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithAcceptedAt::class, 3)->create([ + EntityWithAcceptedAt::factory()->count(3)->create([ 'accepted_at' => Date::now()->subDay(), ]); - factory(EntityWithAcceptedAt::class, 2)->create([ + EntityWithAcceptedAt::factory()->count(2)->create([ 'accepted_at' => null, ]); @@ -127,10 +127,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithAcceptedAt::class, 3)->create([ + EntityWithAcceptedAt::factory()->count(3)->create([ 'accepted_at' => Date::now()->subDay(), ]); - factory(EntityWithAcceptedAt::class, 2)->create([ + EntityWithAcceptedAt::factory()->count(2)->create([ 'accepted_at' => null, ]); diff --git a/tests/Unit/Scopes/Classic/AcceptedFlagScopeTest.php b/tests/Unit/Scopes/Classic/AcceptedFlagScopeTest.php index a10c0ff..962f6e1 100644 --- a/tests/Unit/Scopes/Classic/AcceptedFlagScopeTest.php +++ b/tests/Unit/Scopes/Classic/AcceptedFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedFlag; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithAcceptedFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithAcceptedFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithAcceptedFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class AcceptedFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithAcceptedFlag::class, 3)->create([ + EntityWithAcceptedFlag::factory()->count(3)->create([ 'is_accepted' => true, ]); - factory(EntityWithAcceptedFlag::class, 2)->create([ + EntityWithAcceptedFlag::factory()->count(2)->create([ 'is_accepted' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_accepted(): void { - factory(EntityWithAcceptedFlag::class, 3)->create([ + EntityWithAcceptedFlag::factory()->count(3)->create([ 'is_accepted' => true, ]); - factory(EntityWithAcceptedFlag::class, 2)->create([ + EntityWithAcceptedFlag::factory()->count(2)->create([ 'is_accepted' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_not_accepted(): void /** @test */ public function it_can_get_with_not_accepted(): void { - factory(EntityWithAcceptedFlag::class, 3)->create([ + EntityWithAcceptedFlag::factory()->count(3)->create([ 'is_accepted' => true, ]); - factory(EntityWithAcceptedFlag::class, 2)->create([ + EntityWithAcceptedFlag::factory()->count(2)->create([ 'is_accepted' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_not_accepted(): void /** @test */ public function it_can_get_only_not_accepted(): void { - factory(EntityWithAcceptedFlag::class, 3)->create([ + EntityWithAcceptedFlag::factory()->count(3)->create([ 'is_accepted' => true, ]); - factory(EntityWithAcceptedFlag::class, 2)->create([ + EntityWithAcceptedFlag::factory()->count(2)->create([ 'is_accepted' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_not_accepted(): void /** @test */ public function it_can_accept_model(): void { - $model = factory(EntityWithAcceptedFlag::class)->create([ + $model = EntityWithAcceptedFlag::factory()->create([ 'is_accepted' => false, ]); @@ -97,7 +97,7 @@ public function it_can_accept_model(): void /** @test */ public function it_can_undo_accept_model(): void { - $model = factory(EntityWithAcceptedFlag::class)->create([ + $model = EntityWithAcceptedFlag::factory()->create([ 'is_accepted' => true, ]); @@ -111,10 +111,10 @@ public function it_can_undo_accept_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithAcceptedFlag::class, 3)->create([ + EntityWithAcceptedFlag::factory()->count(3)->create([ 'is_accepted' => true, ]); - factory(EntityWithAcceptedFlag::class, 2)->create([ + EntityWithAcceptedFlag::factory()->count(2)->create([ 'is_accepted' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithAcceptedFlag::class, 3)->create([ + EntityWithAcceptedFlag::factory()->count(3)->create([ 'is_accepted' => true, ]); - factory(EntityWithAcceptedFlag::class, 2)->create([ + EntityWithAcceptedFlag::factory()->count(2)->create([ 'is_accepted' => false, ]); diff --git a/tests/Unit/Scopes/Classic/ActiveFlagScopeTest.php b/tests/Unit/Scopes/Classic/ActiveFlagScopeTest.php index 2405d47..151d2cb 100644 --- a/tests/Unit/Scopes/Classic/ActiveFlagScopeTest.php +++ b/tests/Unit/Scopes/Classic/ActiveFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithActiveFlag; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithActiveFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithActiveFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithActiveFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithActiveFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithActiveFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class ActiveFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithActiveFlag::class, 3)->create([ + EntityWithActiveFlag::factory()->count(3)->create([ 'is_active' => true, ]); - factory(EntityWithActiveFlag::class, 2)->create([ + EntityWithActiveFlag::factory()->count(2)->create([ 'is_active' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_activated(): void { - factory(EntityWithActiveFlag::class, 3)->create([ + EntityWithActiveFlag::factory()->count(3)->create([ 'is_active' => true, ]); - factory(EntityWithActiveFlag::class, 2)->create([ + EntityWithActiveFlag::factory()->count(2)->create([ 'is_active' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_not_activated(): void /** @test */ public function it_can_get_with_not_activated(): void { - factory(EntityWithActiveFlag::class, 3)->create([ + EntityWithActiveFlag::factory()->count(3)->create([ 'is_active' => true, ]); - factory(EntityWithActiveFlag::class, 2)->create([ + EntityWithActiveFlag::factory()->count(2)->create([ 'is_active' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_not_activated(): void /** @test */ public function it_can_get_only_not_activated(): void { - factory(EntityWithActiveFlag::class, 3)->create([ + EntityWithActiveFlag::factory()->count(3)->create([ 'is_active' => true, ]); - factory(EntityWithActiveFlag::class, 2)->create([ + EntityWithActiveFlag::factory()->count(2)->create([ 'is_active' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_not_activated(): void /** @test */ public function it_can_activate_model(): void { - $model = factory(EntityWithActiveFlag::class)->create([ + $model = EntityWithActiveFlag::factory()->create([ 'is_active' => false, ]); @@ -97,7 +97,7 @@ public function it_can_activate_model(): void /** @test */ public function it_can_undo_activate_model(): void { - $model = factory(EntityWithActiveFlag::class)->create([ + $model = EntityWithActiveFlag::factory()->create([ 'is_active' => true, ]); @@ -111,10 +111,10 @@ public function it_can_undo_activate_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithActiveFlag::class, 3)->create([ + EntityWithActiveFlag::factory()->count(3)->create([ 'is_active' => true, ]); - factory(EntityWithActiveFlag::class, 2)->create([ + EntityWithActiveFlag::factory()->count(2)->create([ 'is_active' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithActiveFlag::class, 3)->create([ + EntityWithActiveFlag::factory()->count(3)->create([ 'is_active' => true, ]); - factory(EntityWithActiveFlag::class, 2)->create([ + EntityWithActiveFlag::factory()->count(2)->create([ 'is_active' => false, ]); diff --git a/tests/Unit/Scopes/Classic/ApprovedAtScopeTest.php b/tests/Unit/Scopes/Classic/ApprovedAtScopeTest.php index c31ad00..8024abb 100644 --- a/tests/Unit/Scopes/Classic/ApprovedAtScopeTest.php +++ b/tests/Unit/Scopes/Classic/ApprovedAtScopeTest.php @@ -11,12 +11,12 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithApprovedAt; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithApprovedAtApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithApprovedAtUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithApprovedAt; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithApprovedAtApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithApprovedAtUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class ApprovedAtScopeTest extends TestCase @@ -24,10 +24,10 @@ final class ApprovedAtScopeTest extends TestCase /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithApprovedAt::class, 3)->create([ + EntityWithApprovedAt::factory()->count(3)->create([ 'approved_at' => Date::now()->subDay(), ]); - factory(EntityWithApprovedAt::class, 2)->create([ + EntityWithApprovedAt::factory()->count(2)->create([ 'approved_at' => null, ]); @@ -39,10 +39,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_approved(): void { - factory(EntityWithApprovedAt::class, 3)->create([ + EntityWithApprovedAt::factory()->count(3)->create([ 'approved_at' => Date::now()->subDay(), ]); - factory(EntityWithApprovedAt::class, 2)->create([ + EntityWithApprovedAt::factory()->count(2)->create([ 'approved_at' => null, ]); @@ -54,10 +54,10 @@ public function it_can_get_without_not_approved(): void /** @test */ public function it_can_get_with_not_approved(): void { - factory(EntityWithApprovedAt::class, 3)->create([ + EntityWithApprovedAt::factory()->count(3)->create([ 'approved_at' => Date::now()->subDay(), ]); - factory(EntityWithApprovedAt::class, 2)->create([ + EntityWithApprovedAt::factory()->count(2)->create([ 'approved_at' => null, ]); @@ -69,10 +69,10 @@ public function it_can_get_with_not_approved(): void /** @test */ public function it_can_get_only_not_approved(): void { - factory(EntityWithApprovedAt::class, 3)->create([ + EntityWithApprovedAt::factory()->count(3)->create([ 'approved_at' => Date::now()->subDay(), ]); - factory(EntityWithApprovedAt::class, 2)->create([ + EntityWithApprovedAt::factory()->count(2)->create([ 'approved_at' => null, ]); @@ -84,7 +84,7 @@ public function it_can_get_only_not_approved(): void /** @test */ public function it_can_approve_model(): void { - $model = factory(EntityWithApprovedAt::class)->create([ + $model = EntityWithApprovedAt::factory()->create([ 'approved_at' => null, ]); @@ -98,7 +98,7 @@ public function it_can_approve_model(): void /** @test */ public function it_can_undo_approve_model(): void { - $model = factory(EntityWithApprovedAt::class)->create([ + $model = EntityWithApprovedAt::factory()->create([ 'approved_at' => Date::now()->subDay(), ]); @@ -112,10 +112,10 @@ public function it_can_undo_approve_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithApprovedAt::class, 3)->create([ + EntityWithApprovedAt::factory()->count(3)->create([ 'approved_at' => Date::now()->subDay(), ]); - factory(EntityWithApprovedAt::class, 2)->create([ + EntityWithApprovedAt::factory()->count(2)->create([ 'approved_at' => null, ]); @@ -127,10 +127,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithApprovedAt::class, 3)->create([ + EntityWithApprovedAt::factory()->count(3)->create([ 'approved_at' => Date::now()->subDay(), ]); - factory(EntityWithApprovedAt::class, 2)->create([ + EntityWithApprovedAt::factory()->count(2)->create([ 'approved_at' => null, ]); diff --git a/tests/Unit/Scopes/Classic/ApprovedFlagScopeTest.php b/tests/Unit/Scopes/Classic/ApprovedFlagScopeTest.php index 8f23683..cdcbad2 100644 --- a/tests/Unit/Scopes/Classic/ApprovedFlagScopeTest.php +++ b/tests/Unit/Scopes/Classic/ApprovedFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithApprovedFlag; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithApprovedFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithApprovedFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithApprovedFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithApprovedFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithApprovedFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class ApprovedFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithApprovedFlag::class, 3)->create([ + EntityWithApprovedFlag::factory()->count(3)->create([ 'is_approved' => true, ]); - factory(EntityWithApprovedFlag::class, 2)->create([ + EntityWithApprovedFlag::factory()->count(2)->create([ 'is_approved' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_approved(): void { - factory(EntityWithApprovedFlag::class, 3)->create([ + EntityWithApprovedFlag::factory()->count(3)->create([ 'is_approved' => true, ]); - factory(EntityWithApprovedFlag::class, 2)->create([ + EntityWithApprovedFlag::factory()->count(2)->create([ 'is_approved' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_not_approved(): void /** @test */ public function it_can_get_with_not_approved(): void { - factory(EntityWithApprovedFlag::class, 3)->create([ + EntityWithApprovedFlag::factory()->count(3)->create([ 'is_approved' => true, ]); - factory(EntityWithApprovedFlag::class, 2)->create([ + EntityWithApprovedFlag::factory()->count(2)->create([ 'is_approved' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_not_approved(): void /** @test */ public function it_can_get_only_not_approved(): void { - factory(EntityWithApprovedFlag::class, 3)->create([ + EntityWithApprovedFlag::factory()->count(3)->create([ 'is_approved' => true, ]); - factory(EntityWithApprovedFlag::class, 2)->create([ + EntityWithApprovedFlag::factory()->count(2)->create([ 'is_approved' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_not_approved(): void /** @test */ public function it_can_approve_model(): void { - $model = factory(EntityWithApprovedFlag::class)->create([ + $model = EntityWithApprovedFlag::factory()->create([ 'is_approved' => false, ]); @@ -97,7 +97,7 @@ public function it_can_approve_model(): void /** @test */ public function it_can_undo_approve_model(): void { - $model = factory(EntityWithApprovedFlag::class)->create([ + $model = EntityWithApprovedFlag::factory()->create([ 'is_approved' => true, ]); @@ -111,10 +111,10 @@ public function it_can_undo_approve_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithApprovedFlag::class, 3)->create([ + EntityWithApprovedFlag::factory()->count(3)->create([ 'is_approved' => true, ]); - factory(EntityWithApprovedFlag::class, 2)->create([ + EntityWithApprovedFlag::factory()->count(2)->create([ 'is_approved' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithApprovedFlag::class, 3)->create([ + EntityWithApprovedFlag::factory()->count(3)->create([ 'is_approved' => true, ]); - factory(EntityWithApprovedFlag::class, 2)->create([ + EntityWithApprovedFlag::factory()->count(2)->create([ 'is_approved' => false, ]); diff --git a/tests/Unit/Scopes/Classic/InvitedAtScopeTest.php b/tests/Unit/Scopes/Classic/InvitedAtScopeTest.php index a73b491..8a78873 100644 --- a/tests/Unit/Scopes/Classic/InvitedAtScopeTest.php +++ b/tests/Unit/Scopes/Classic/InvitedAtScopeTest.php @@ -11,12 +11,12 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithInvitedAt; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithInvitedAtApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithInvitedAtUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithInvitedAt; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithInvitedAtApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithInvitedAtUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class InvitedAtScopeTest extends TestCase @@ -24,10 +24,10 @@ final class InvitedAtScopeTest extends TestCase /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithInvitedAt::class, 3)->create([ + EntityWithInvitedAt::factory()->count(3)->create([ 'invited_at' => Date::now()->subDay(), ]); - factory(EntityWithInvitedAt::class, 2)->create([ + EntityWithInvitedAt::factory()->count(2)->create([ 'invited_at' => null, ]); @@ -39,10 +39,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_invited(): void { - factory(EntityWithInvitedAt::class, 3)->create([ + EntityWithInvitedAt::factory()->count(3)->create([ 'invited_at' => Date::now()->subDay(), ]); - factory(EntityWithInvitedAt::class, 2)->create([ + EntityWithInvitedAt::factory()->count(2)->create([ 'invited_at' => null, ]); @@ -54,10 +54,10 @@ public function it_can_get_without_not_invited(): void /** @test */ public function it_can_get_with_not_invited(): void { - factory(EntityWithInvitedAt::class, 3)->create([ + EntityWithInvitedAt::factory()->count(3)->create([ 'invited_at' => Date::now()->subDay(), ]); - factory(EntityWithInvitedAt::class, 2)->create([ + EntityWithInvitedAt::factory()->count(2)->create([ 'invited_at' => null, ]); @@ -69,10 +69,10 @@ public function it_can_get_with_not_invited(): void /** @test */ public function it_can_get_only_not_invited(): void { - factory(EntityWithInvitedAt::class, 3)->create([ + EntityWithInvitedAt::factory()->count(3)->create([ 'invited_at' => Date::now()->subDay(), ]); - factory(EntityWithInvitedAt::class, 2)->create([ + EntityWithInvitedAt::factory()->count(2)->create([ 'invited_at' => null, ]); @@ -84,7 +84,7 @@ public function it_can_get_only_not_invited(): void /** @test */ public function it_can_invite_model(): void { - $model = factory(EntityWithInvitedAt::class)->create([ + $model = EntityWithInvitedAt::factory()->create([ 'invited_at' => null, ]); @@ -98,7 +98,7 @@ public function it_can_invite_model(): void /** @test */ public function it_can_undo_invite_model(): void { - $model = factory(EntityWithInvitedAt::class)->create([ + $model = EntityWithInvitedAt::factory()->create([ 'invited_at' => Date::now()->subDay(), ]); @@ -112,10 +112,10 @@ public function it_can_undo_invite_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithInvitedAt::class, 3)->create([ + EntityWithInvitedAt::factory()->count(3)->create([ 'invited_at' => Date::now()->subDay(), ]); - factory(EntityWithInvitedAt::class, 2)->create([ + EntityWithInvitedAt::factory()->count(2)->create([ 'invited_at' => null, ]); @@ -127,10 +127,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithInvitedAt::class, 3)->create([ + EntityWithInvitedAt::factory()->count(3)->create([ 'invited_at' => Date::now()->subDay(), ]); - factory(EntityWithInvitedAt::class, 2)->create([ + EntityWithInvitedAt::factory()->count(2)->create([ 'invited_at' => null, ]); diff --git a/tests/Unit/Scopes/Classic/InvitedFlagScopeTest.php b/tests/Unit/Scopes/Classic/InvitedFlagScopeTest.php index 78eaa2e..8465fda 100644 --- a/tests/Unit/Scopes/Classic/InvitedFlagScopeTest.php +++ b/tests/Unit/Scopes/Classic/InvitedFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithInvitedFlag; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithInvitedFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithInvitedFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithInvitedFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithInvitedFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithInvitedFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class InvitedFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithInvitedFlag::class, 3)->create([ + EntityWithInvitedFlag::factory()->count(3)->create([ 'is_invited' => true, ]); - factory(EntityWithInvitedFlag::class, 2)->create([ + EntityWithInvitedFlag::factory()->count(2)->create([ 'is_invited' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_invited(): void { - factory(EntityWithInvitedFlag::class, 3)->create([ + EntityWithInvitedFlag::factory()->count(3)->create([ 'is_invited' => true, ]); - factory(EntityWithInvitedFlag::class, 2)->create([ + EntityWithInvitedFlag::factory()->count(2)->create([ 'is_invited' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_not_invited(): void /** @test */ public function it_can_get_with_not_invited(): void { - factory(EntityWithInvitedFlag::class, 3)->create([ + EntityWithInvitedFlag::factory()->count(3)->create([ 'is_invited' => true, ]); - factory(EntityWithInvitedFlag::class, 2)->create([ + EntityWithInvitedFlag::factory()->count(2)->create([ 'is_invited' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_not_invited(): void /** @test */ public function it_can_get_only_not_invited(): void { - factory(EntityWithInvitedFlag::class, 3)->create([ + EntityWithInvitedFlag::factory()->count(3)->create([ 'is_invited' => true, ]); - factory(EntityWithInvitedFlag::class, 2)->create([ + EntityWithInvitedFlag::factory()->count(2)->create([ 'is_invited' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_not_invited(): void /** @test */ public function it_can_invite_model(): void { - $model = factory(EntityWithInvitedFlag::class)->create([ + $model = EntityWithInvitedFlag::factory()->create([ 'is_invited' => false, ]); @@ -97,7 +97,7 @@ public function it_can_invite_model(): void /** @test */ public function it_can_undo_invite_model(): void { - $model = factory(EntityWithInvitedFlag::class)->create([ + $model = EntityWithInvitedFlag::factory()->create([ 'is_invited' => true, ]); @@ -111,10 +111,10 @@ public function it_can_undo_invite_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithInvitedFlag::class, 3)->create([ + EntityWithInvitedFlag::factory()->count(3)->create([ 'is_invited' => true, ]); - factory(EntityWithInvitedFlag::class, 2)->create([ + EntityWithInvitedFlag::factory()->count(2)->create([ 'is_invited' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithInvitedFlag::class, 3)->create([ + EntityWithInvitedFlag::factory()->count(3)->create([ 'is_invited' => true, ]); - factory(EntityWithInvitedFlag::class, 2)->create([ + EntityWithInvitedFlag::factory()->count(2)->create([ 'is_invited' => false, ]); diff --git a/tests/Unit/Scopes/Classic/KeptFlagScopeTest.php b/tests/Unit/Scopes/Classic/KeptFlagScopeTest.php index 34307e9..d935a63 100644 --- a/tests/Unit/Scopes/Classic/KeptFlagScopeTest.php +++ b/tests/Unit/Scopes/Classic/KeptFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithKeptFlag; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithKeptFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithKeptFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithKeptFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithKeptFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithKeptFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class KeptFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithKeptFlag::class, 3)->create([ + EntityWithKeptFlag::factory()->count(3)->create([ 'is_kept' => true, ]); - factory(EntityWithKeptFlag::class, 2)->create([ + EntityWithKeptFlag::factory()->count(2)->create([ 'is_kept' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_kept(): void { - factory(EntityWithKeptFlag::class, 3)->create([ + EntityWithKeptFlag::factory()->count(3)->create([ 'is_kept' => true, ]); - factory(EntityWithKeptFlag::class, 2)->create([ + EntityWithKeptFlag::factory()->count(2)->create([ 'is_kept' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_not_kept(): void /** @test */ public function it_can_get_with_not_kept(): void { - factory(EntityWithKeptFlag::class, 3)->create([ + EntityWithKeptFlag::factory()->count(3)->create([ 'is_kept' => true, ]); - factory(EntityWithKeptFlag::class, 2)->create([ + EntityWithKeptFlag::factory()->count(2)->create([ 'is_kept' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_not_kept(): void /** @test */ public function it_can_get_only_not_kept(): void { - factory(EntityWithKeptFlag::class, 3)->create([ + EntityWithKeptFlag::factory()->count(3)->create([ 'is_kept' => true, ]); - factory(EntityWithKeptFlag::class, 2)->create([ + EntityWithKeptFlag::factory()->count(2)->create([ 'is_kept' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_not_kept(): void /** @test */ public function it_can_keep_model(): void { - $model = factory(EntityWithKeptFlag::class)->create([ + $model = EntityWithKeptFlag::factory()->create([ 'is_kept' => false, ]); @@ -97,7 +97,7 @@ public function it_can_keep_model(): void /** @test */ public function it_can_undo_keep_model(): void { - $model = factory(EntityWithKeptFlag::class)->create([ + $model = EntityWithKeptFlag::factory()->create([ 'is_kept' => true, ]); @@ -111,10 +111,10 @@ public function it_can_undo_keep_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithKeptFlag::class, 3)->create([ + EntityWithKeptFlag::factory()->count(3)->create([ 'is_kept' => true, ]); - factory(EntityWithKeptFlag::class, 2)->create([ + EntityWithKeptFlag::factory()->count(2)->create([ 'is_kept' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithKeptFlag::class, 3)->create([ + EntityWithKeptFlag::factory()->count(3)->create([ 'is_kept' => true, ]); - factory(EntityWithKeptFlag::class, 2)->create([ + EntityWithKeptFlag::factory()->count(2)->create([ 'is_kept' => false, ]); diff --git a/tests/Unit/Scopes/Classic/PublishedAtScopeTest.php b/tests/Unit/Scopes/Classic/PublishedAtScopeTest.php index 30bcac0..8442824 100644 --- a/tests/Unit/Scopes/Classic/PublishedAtScopeTest.php +++ b/tests/Unit/Scopes/Classic/PublishedAtScopeTest.php @@ -11,12 +11,12 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithPublishedAt; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithPublishedAtApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithPublishedAtUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithPublishedAt; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithPublishedAtApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithPublishedAtUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class PublishedAtScopeTest extends TestCase @@ -24,10 +24,10 @@ final class PublishedAtScopeTest extends TestCase /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithPublishedAt::class, 3)->create([ + EntityWithPublishedAt::factory()->count(3)->create([ 'published_at' => Date::now()->subDay(), ]); - factory(EntityWithPublishedAt::class, 2)->create([ + EntityWithPublishedAt::factory()->count(2)->create([ 'published_at' => null, ]); @@ -39,10 +39,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_published(): void { - factory(EntityWithPublishedAt::class, 3)->create([ + EntityWithPublishedAt::factory()->count(3)->create([ 'published_at' => Date::now()->subDay(), ]); - factory(EntityWithPublishedAt::class, 2)->create([ + EntityWithPublishedAt::factory()->count(2)->create([ 'published_at' => null, ]); @@ -54,10 +54,10 @@ public function it_can_get_without_not_published(): void /** @test */ public function it_can_get_with_not_published(): void { - factory(EntityWithPublishedAt::class, 3)->create([ + EntityWithPublishedAt::factory()->count(3)->create([ 'published_at' => Date::now()->subDay(), ]); - factory(EntityWithPublishedAt::class, 2)->create([ + EntityWithPublishedAt::factory()->count(2)->create([ 'published_at' => null, ]); @@ -69,10 +69,10 @@ public function it_can_get_with_not_published(): void /** @test */ public function it_can_get_only_not_published(): void { - factory(EntityWithPublishedAt::class, 3)->create([ + EntityWithPublishedAt::factory()->count(3)->create([ 'published_at' => Date::now()->subDay(), ]); - factory(EntityWithPublishedAt::class, 2)->create([ + EntityWithPublishedAt::factory()->count(2)->create([ 'published_at' => null, ]); @@ -84,7 +84,7 @@ public function it_can_get_only_not_published(): void /** @test */ public function it_can_publish_model(): void { - $model = factory(EntityWithPublishedAt::class)->create([ + $model = EntityWithPublishedAt::factory()->create([ 'published_at' => null, ]); @@ -98,7 +98,7 @@ public function it_can_publish_model(): void /** @test */ public function it_can_undo_publish_model(): void { - $model = factory(EntityWithPublishedAt::class)->create([ + $model = EntityWithPublishedAt::factory()->create([ 'published_at' => Date::now()->subDay(), ]); @@ -112,10 +112,10 @@ public function it_can_undo_publish_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithPublishedAt::class, 3)->create([ + EntityWithPublishedAt::factory()->count(3)->create([ 'published_at' => Date::now()->subDay(), ]); - factory(EntityWithPublishedAt::class, 2)->create([ + EntityWithPublishedAt::factory()->count(2)->create([ 'published_at' => null, ]); @@ -127,10 +127,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithPublishedAt::class, 3)->create([ + EntityWithPublishedAt::factory()->count(3)->create([ 'published_at' => Date::now()->subDay(), ]); - factory(EntityWithPublishedAt::class, 2)->create([ + EntityWithPublishedAt::factory()->count(2)->create([ 'published_at' => null, ]); diff --git a/tests/Unit/Scopes/Classic/PublishedFlagScopeTest.php b/tests/Unit/Scopes/Classic/PublishedFlagScopeTest.php index b9afb08..58c2e3e 100644 --- a/tests/Unit/Scopes/Classic/PublishedFlagScopeTest.php +++ b/tests/Unit/Scopes/Classic/PublishedFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithPublishedFlag; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithPublishedFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithPublishedFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithPublishedFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithPublishedFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithPublishedFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class PublishedFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithPublishedFlag::class, 3)->create([ + EntityWithPublishedFlag::factory()->count(3)->create([ 'is_published' => true, ]); - factory(EntityWithPublishedFlag::class, 2)->create([ + EntityWithPublishedFlag::factory()->count(2)->create([ 'is_published' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_published(): void { - factory(EntityWithPublishedFlag::class, 3)->create([ + EntityWithPublishedFlag::factory()->count(3)->create([ 'is_published' => true, ]); - factory(EntityWithPublishedFlag::class, 2)->create([ + EntityWithPublishedFlag::factory()->count(2)->create([ 'is_published' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_not_published(): void /** @test */ public function it_can_get_with_not_published(): void { - factory(EntityWithPublishedFlag::class, 3)->create([ + EntityWithPublishedFlag::factory()->count(3)->create([ 'is_published' => true, ]); - factory(EntityWithPublishedFlag::class, 2)->create([ + EntityWithPublishedFlag::factory()->count(2)->create([ 'is_published' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_not_published(): void /** @test */ public function it_can_get_only_not_published(): void { - factory(EntityWithPublishedFlag::class, 3)->create([ + EntityWithPublishedFlag::factory()->count(3)->create([ 'is_published' => true, ]); - factory(EntityWithPublishedFlag::class, 2)->create([ + EntityWithPublishedFlag::factory()->count(2)->create([ 'is_published' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_not_published(): void /** @test */ public function it_can_publish_model(): void { - $model = factory(EntityWithPublishedFlag::class)->create([ + $model = EntityWithPublishedFlag::factory()->create([ 'is_published' => false, ]); @@ -97,7 +97,7 @@ public function it_can_publish_model(): void /** @test */ public function it_can_undo_publish_model(): void { - $model = factory(EntityWithPublishedFlag::class)->create([ + $model = EntityWithPublishedFlag::factory()->create([ 'is_published' => true, ]); @@ -111,10 +111,10 @@ public function it_can_undo_publish_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithPublishedFlag::class, 3)->create([ + EntityWithPublishedFlag::factory()->count(3)->create([ 'is_published' => true, ]); - factory(EntityWithPublishedFlag::class, 2)->create([ + EntityWithPublishedFlag::factory()->count(2)->create([ 'is_published' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithPublishedFlag::class, 3)->create([ + EntityWithPublishedFlag::factory()->count(3)->create([ 'is_published' => true, ]); - factory(EntityWithPublishedFlag::class, 2)->create([ + EntityWithPublishedFlag::factory()->count(2)->create([ 'is_published' => false, ]); diff --git a/tests/Unit/Scopes/Classic/VerifiedAtScopeTest.php b/tests/Unit/Scopes/Classic/VerifiedAtScopeTest.php index 52bb345..48a8985 100644 --- a/tests/Unit/Scopes/Classic/VerifiedAtScopeTest.php +++ b/tests/Unit/Scopes/Classic/VerifiedAtScopeTest.php @@ -11,12 +11,12 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithVerifiedAt; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithVerifiedAtApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithVerifiedAtUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithVerifiedAt; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithVerifiedAtApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithVerifiedAtUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class VerifiedAtScopeTest extends TestCase @@ -24,10 +24,10 @@ final class VerifiedAtScopeTest extends TestCase /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithVerifiedAt::class, 3)->create([ + EntityWithVerifiedAt::factory()->count(3)->create([ 'verified_at' => Date::now()->subDay(), ]); - factory(EntityWithVerifiedAt::class, 2)->create([ + EntityWithVerifiedAt::factory()->count(2)->create([ 'verified_at' => null, ]); @@ -39,10 +39,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_verified(): void { - factory(EntityWithVerifiedAt::class, 3)->create([ + EntityWithVerifiedAt::factory()->count(3)->create([ 'verified_at' => Date::now()->subDay(), ]); - factory(EntityWithVerifiedAt::class, 2)->create([ + EntityWithVerifiedAt::factory()->count(2)->create([ 'verified_at' => null, ]); @@ -54,10 +54,10 @@ public function it_can_get_without_not_verified(): void /** @test */ public function it_can_get_with_not_verified(): void { - factory(EntityWithVerifiedAt::class, 3)->create([ + EntityWithVerifiedAt::factory()->count(3)->create([ 'verified_at' => Date::now()->subDay(), ]); - factory(EntityWithVerifiedAt::class, 2)->create([ + EntityWithVerifiedAt::factory()->count(2)->create([ 'verified_at' => null, ]); @@ -69,10 +69,10 @@ public function it_can_get_with_not_verified(): void /** @test */ public function it_can_get_only_not_verified(): void { - factory(EntityWithVerifiedAt::class, 3)->create([ + EntityWithVerifiedAt::factory()->count(3)->create([ 'verified_at' => Date::now()->subDay(), ]); - factory(EntityWithVerifiedAt::class, 2)->create([ + EntityWithVerifiedAt::factory()->count(2)->create([ 'verified_at' => null, ]); @@ -84,7 +84,7 @@ public function it_can_get_only_not_verified(): void /** @test */ public function it_can_verify_model(): void { - $model = factory(EntityWithVerifiedAt::class)->create([ + $model = EntityWithVerifiedAt::factory()->create([ 'verified_at' => null, ]); @@ -98,7 +98,7 @@ public function it_can_verify_model(): void /** @test */ public function it_can_undo_verify_model(): void { - $model = factory(EntityWithVerifiedAt::class)->create([ + $model = EntityWithVerifiedAt::factory()->create([ 'verified_at' => Date::now()->subDay(), ]); @@ -112,10 +112,10 @@ public function it_can_undo_verify_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithVerifiedAt::class, 3)->create([ + EntityWithVerifiedAt::factory()->count(3)->create([ 'verified_at' => Date::now()->subDay(), ]); - factory(EntityWithVerifiedAt::class, 2)->create([ + EntityWithVerifiedAt::factory()->count(2)->create([ 'verified_at' => null, ]); @@ -127,10 +127,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithVerifiedAt::class, 3)->create([ + EntityWithVerifiedAt::factory()->count(3)->create([ 'verified_at' => Date::now()->subDay(), ]); - factory(EntityWithVerifiedAt::class, 2)->create([ + EntityWithVerifiedAt::factory()->count(2)->create([ 'verified_at' => null, ]); diff --git a/tests/Unit/Scopes/Classic/VerifiedFlagScopeTest.php b/tests/Unit/Scopes/Classic/VerifiedFlagScopeTest.php index 2eed607..9411d54 100644 --- a/tests/Unit/Scopes/Classic/VerifiedFlagScopeTest.php +++ b/tests/Unit/Scopes/Classic/VerifiedFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithVerifiedFlag; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithVerifiedFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithVerifiedFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithVerifiedFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithVerifiedFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithVerifiedFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class VerifiedFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithVerifiedFlag::class, 3)->create([ + EntityWithVerifiedFlag::factory()->count(3)->create([ 'is_verified' => true, ]); - factory(EntityWithVerifiedFlag::class, 2)->create([ + EntityWithVerifiedFlag::factory()->count(2)->create([ 'is_verified' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_not_verified(): void { - factory(EntityWithVerifiedFlag::class, 3)->create([ + EntityWithVerifiedFlag::factory()->count(3)->create([ 'is_verified' => true, ]); - factory(EntityWithVerifiedFlag::class, 2)->create([ + EntityWithVerifiedFlag::factory()->count(2)->create([ 'is_verified' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_not_verified(): void /** @test */ public function it_can_get_with_not_verified(): void { - factory(EntityWithVerifiedFlag::class, 3)->create([ + EntityWithVerifiedFlag::factory()->count(3)->create([ 'is_verified' => true, ]); - factory(EntityWithVerifiedFlag::class, 2)->create([ + EntityWithVerifiedFlag::factory()->count(2)->create([ 'is_verified' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_not_verified(): void /** @test */ public function it_can_get_only_not_verified(): void { - factory(EntityWithVerifiedFlag::class, 3)->create([ + EntityWithVerifiedFlag::factory()->count(3)->create([ 'is_verified' => true, ]); - factory(EntityWithVerifiedFlag::class, 2)->create([ + EntityWithVerifiedFlag::factory()->count(2)->create([ 'is_verified' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_not_verified(): void /** @test */ public function it_can_verify_model(): void { - $model = factory(EntityWithVerifiedFlag::class)->create([ + $model = EntityWithVerifiedFlag::factory()->create([ 'is_verified' => false, ]); @@ -97,7 +97,7 @@ public function it_can_verify_model(): void /** @test */ public function it_can_undo_verify_model(): void { - $model = factory(EntityWithVerifiedFlag::class)->create([ + $model = EntityWithVerifiedFlag::factory()->create([ 'is_verified' => true, ]); @@ -111,10 +111,10 @@ public function it_can_undo_verify_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithVerifiedFlag::class, 3)->create([ + EntityWithVerifiedFlag::factory()->count(3)->create([ 'is_verified' => true, ]); - factory(EntityWithVerifiedFlag::class, 2)->create([ + EntityWithVerifiedFlag::factory()->count(2)->create([ 'is_verified' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithVerifiedFlag::class, 3)->create([ + EntityWithVerifiedFlag::factory()->count(3)->create([ 'is_verified' => true, ]); - factory(EntityWithVerifiedFlag::class, 2)->create([ + EntityWithVerifiedFlag::factory()->count(2)->create([ 'is_verified' => false, ]); diff --git a/tests/Unit/Scopes/Inverse/ArchivedAtScopeTest.php b/tests/Unit/Scopes/Inverse/ArchivedAtScopeTest.php index cb5a271..c598579 100644 --- a/tests/Unit/Scopes/Inverse/ArchivedAtScopeTest.php +++ b/tests/Unit/Scopes/Inverse/ArchivedAtScopeTest.php @@ -11,12 +11,12 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithArchivedAt; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithArchivedAtApplied; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithArchivedAtUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithArchivedAt; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithArchivedAtApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithArchivedAtUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class ArchivedAtScopeTest extends TestCase @@ -24,10 +24,10 @@ final class ArchivedAtScopeTest extends TestCase /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithArchivedAt::class, 3)->create([ + EntityWithArchivedAt::factory()->count(3)->create([ 'archived_at' => Date::now()->subDay(), ]); - factory(EntityWithArchivedAt::class, 2)->create([ + EntityWithArchivedAt::factory()->count(2)->create([ 'archived_at' => null, ]); @@ -39,10 +39,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_archived(): void { - factory(EntityWithArchivedAt::class, 3)->create([ + EntityWithArchivedAt::factory()->count(3)->create([ 'archived_at' => Date::now()->subDay(), ]); - factory(EntityWithArchivedAt::class, 2)->create([ + EntityWithArchivedAt::factory()->count(2)->create([ 'archived_at' => null, ]); @@ -54,10 +54,10 @@ public function it_can_get_without_archived(): void /** @test */ public function it_can_get_with_archived(): void { - factory(EntityWithArchivedAt::class, 3)->create([ + EntityWithArchivedAt::factory()->count(3)->create([ 'archived_at' => Date::now()->subDay(), ]); - factory(EntityWithArchivedAt::class, 2)->create([ + EntityWithArchivedAt::factory()->count(2)->create([ 'archived_at' => null, ]); @@ -69,10 +69,10 @@ public function it_can_get_with_archived(): void /** @test */ public function it_can_get_only_archived(): void { - factory(EntityWithArchivedAt::class, 3)->create([ + EntityWithArchivedAt::factory()->count(3)->create([ 'archived_at' => Date::now()->subDay(), ]); - factory(EntityWithArchivedAt::class, 2)->create([ + EntityWithArchivedAt::factory()->count(2)->create([ 'archived_at' => null, ]); @@ -84,7 +84,7 @@ public function it_can_get_only_archived(): void /** @test */ public function it_can_undo_archive_model(): void { - $model = factory(EntityWithArchivedAt::class)->create([ + $model = EntityWithArchivedAt::factory()->create([ 'archived_at' => Date::now()->subDay(), ]); @@ -98,7 +98,7 @@ public function it_can_undo_archive_model(): void /** @test */ public function it_can_archive_model(): void { - $model = factory(EntityWithArchivedAt::class)->create([ + $model = EntityWithArchivedAt::factory()->create([ 'archived_at' => null, ]); @@ -112,10 +112,10 @@ public function it_can_archive_model(): void /** @test */ public function it_can_skip_auto_apply(): void { - factory(EntityWithArchivedAt::class, 3)->create([ + EntityWithArchivedAt::factory()->count(3)->create([ 'archived_at' => Date::now()->subDay(), ]); - factory(EntityWithArchivedAt::class, 2)->create([ + EntityWithArchivedAt::factory()->count(2)->create([ 'archived_at' => null, ]); @@ -127,10 +127,10 @@ public function it_can_skip_auto_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithArchivedAt::class, 3)->create([ + EntityWithArchivedAt::factory()->count(3)->create([ 'archived_at' => Date::now()->subDay(), ]); - factory(EntityWithArchivedAt::class, 2)->create([ + EntityWithArchivedAt::factory()->count(2)->create([ 'archived_at' => null, ]); diff --git a/tests/Unit/Scopes/Inverse/ArchivedFlagScopeTest.php b/tests/Unit/Scopes/Inverse/ArchivedFlagScopeTest.php index 699254c..b73a914 100644 --- a/tests/Unit/Scopes/Inverse/ArchivedFlagScopeTest.php +++ b/tests/Unit/Scopes/Inverse/ArchivedFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithArchivedFlag; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithArchivedFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithArchivedFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithArchivedFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithArchivedFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithArchivedFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class ArchivedFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithArchivedFlag::class, 3)->create([ + EntityWithArchivedFlag::factory()->count(3)->create([ 'is_archived' => true, ]); - factory(EntityWithArchivedFlag::class, 2)->create([ + EntityWithArchivedFlag::factory()->count(2)->create([ 'is_archived' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_archived(): void { - factory(EntityWithArchivedFlag::class, 3)->create([ + EntityWithArchivedFlag::factory()->count(3)->create([ 'is_archived' => true, ]); - factory(EntityWithArchivedFlag::class, 2)->create([ + EntityWithArchivedFlag::factory()->count(2)->create([ 'is_archived' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_archived(): void /** @test */ public function it_can_get_with_archived(): void { - factory(EntityWithArchivedFlag::class, 3)->create([ + EntityWithArchivedFlag::factory()->count(3)->create([ 'is_archived' => true, ]); - factory(EntityWithArchivedFlag::class, 2)->create([ + EntityWithArchivedFlag::factory()->count(2)->create([ 'is_archived' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_archived(): void /** @test */ public function it_can_get_only_archived(): void { - factory(EntityWithArchivedFlag::class, 3)->create([ + EntityWithArchivedFlag::factory()->count(3)->create([ 'is_archived' => true, ]); - factory(EntityWithArchivedFlag::class, 2)->create([ + EntityWithArchivedFlag::factory()->count(2)->create([ 'is_archived' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_archived(): void /** @test */ public function it_can_undo_archive_model(): void { - $model = factory(EntityWithArchivedFlag::class)->create([ + $model = EntityWithArchivedFlag::factory()->create([ 'is_archived' => true, ]); @@ -97,7 +97,7 @@ public function it_can_undo_archive_model(): void /** @test */ public function it_can_archive_model(): void { - $model = factory(EntityWithArchivedFlag::class)->create([ + $model = EntityWithArchivedFlag::factory()->create([ 'is_archived' => false, ]); @@ -111,10 +111,10 @@ public function it_can_archive_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithArchivedFlag::class, 3)->create([ + EntityWithArchivedFlag::factory()->count(3)->create([ 'is_archived' => true, ]); - factory(EntityWithArchivedFlag::class, 2)->create([ + EntityWithArchivedFlag::factory()->count(2)->create([ 'is_archived' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithArchivedFlag::class, 3)->create([ + EntityWithArchivedFlag::factory()->count(3)->create([ 'is_archived' => true, ]); - factory(EntityWithArchivedFlag::class, 2)->create([ + EntityWithArchivedFlag::factory()->count(2)->create([ 'is_archived' => false, ]); diff --git a/tests/Unit/Scopes/Inverse/ClosedAtScopeTest.php b/tests/Unit/Scopes/Inverse/ClosedAtScopeTest.php index 192d1c7..6aeecd7 100644 --- a/tests/Unit/Scopes/Inverse/ClosedAtScopeTest.php +++ b/tests/Unit/Scopes/Inverse/ClosedAtScopeTest.php @@ -11,12 +11,12 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithClosedAt; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithClosedAtApplied; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithClosedAtUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithClosedAt; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithClosedAtApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithClosedAtUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class ClosedAtScopeTest extends TestCase @@ -24,10 +24,10 @@ final class ClosedAtScopeTest extends TestCase /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithClosedAt::class, 3)->create([ + EntityWithClosedAt::factory()->count(3)->create([ 'closed_at' => Date::now()->subDay(), ]); - factory(EntityWithClosedAt::class, 2)->create([ + EntityWithClosedAt::factory()->count(2)->create([ 'closed_at' => null, ]); @@ -39,10 +39,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_closed(): void { - factory(EntityWithClosedAt::class, 3)->create([ + EntityWithClosedAt::factory()->count(3)->create([ 'closed_at' => Date::now()->subDay(), ]); - factory(EntityWithClosedAt::class, 2)->create([ + EntityWithClosedAt::factory()->count(2)->create([ 'closed_at' => null, ]); @@ -54,10 +54,10 @@ public function it_can_get_without_closed(): void /** @test */ public function it_can_get_with_closed(): void { - factory(EntityWithClosedAt::class, 3)->create([ + EntityWithClosedAt::factory()->count(3)->create([ 'closed_at' => Date::now()->subDay(), ]); - factory(EntityWithClosedAt::class, 2)->create([ + EntityWithClosedAt::factory()->count(2)->create([ 'closed_at' => null, ]); @@ -69,10 +69,10 @@ public function it_can_get_with_closed(): void /** @test */ public function it_can_get_only_closed(): void { - factory(EntityWithClosedAt::class, 3)->create([ + EntityWithClosedAt::factory()->count(3)->create([ 'closed_at' => Date::now()->subDay(), ]); - factory(EntityWithClosedAt::class, 2)->create([ + EntityWithClosedAt::factory()->count(2)->create([ 'closed_at' => null, ]); @@ -84,7 +84,7 @@ public function it_can_get_only_closed(): void /** @test */ public function it_can_undo_close_model(): void { - $model = factory(EntityWithClosedAt::class)->create([ + $model = EntityWithClosedAt::factory()->create([ 'closed_at' => Date::now()->subDay(), ]); @@ -98,7 +98,7 @@ public function it_can_undo_close_model(): void /** @test */ public function it_can_close_model(): void { - $model = factory(EntityWithClosedAt::class)->create([ + $model = EntityWithClosedAt::factory()->create([ 'closed_at' => null, ]); @@ -112,10 +112,10 @@ public function it_can_close_model(): void /** @test */ public function it_can_skip_auto_apply(): void { - factory(EntityWithClosedAt::class, 3)->create([ + EntityWithClosedAt::factory()->count(3)->create([ 'closed_at' => Date::now()->subDay(), ]); - factory(EntityWithClosedAt::class, 2)->create([ + EntityWithClosedAt::factory()->count(2)->create([ 'closed_at' => null, ]); @@ -127,10 +127,10 @@ public function it_can_skip_auto_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithClosedAt::class, 3)->create([ + EntityWithClosedAt::factory()->count(3)->create([ 'closed_at' => Date::now()->subDay(), ]); - factory(EntityWithClosedAt::class, 2)->create([ + EntityWithClosedAt::factory()->count(2)->create([ 'closed_at' => null, ]); diff --git a/tests/Unit/Scopes/Inverse/ClosedFlagScopeTest.php b/tests/Unit/Scopes/Inverse/ClosedFlagScopeTest.php index cea0783..10ec2d1 100644 --- a/tests/Unit/Scopes/Inverse/ClosedFlagScopeTest.php +++ b/tests/Unit/Scopes/Inverse/ClosedFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithClosedFlag; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithClosedFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithClosedFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithClosedFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithClosedFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithClosedFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class ClosedFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithClosedFlag::class, 3)->create([ + EntityWithClosedFlag::factory()->count(3)->create([ 'is_closed' => true, ]); - factory(EntityWithClosedFlag::class, 2)->create([ + EntityWithClosedFlag::factory()->count(2)->create([ 'is_closed' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_closed(): void { - factory(EntityWithClosedFlag::class, 3)->create([ + EntityWithClosedFlag::factory()->count(3)->create([ 'is_closed' => true, ]); - factory(EntityWithClosedFlag::class, 2)->create([ + EntityWithClosedFlag::factory()->count(2)->create([ 'is_closed' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_closed(): void /** @test */ public function it_can_get_with_closed(): void { - factory(EntityWithClosedFlag::class, 3)->create([ + EntityWithClosedFlag::factory()->count(3)->create([ 'is_closed' => true, ]); - factory(EntityWithClosedFlag::class, 2)->create([ + EntityWithClosedFlag::factory()->count(2)->create([ 'is_closed' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_closed(): void /** @test */ public function it_can_get_only_closed(): void { - factory(EntityWithClosedFlag::class, 3)->create([ + EntityWithClosedFlag::factory()->count(3)->create([ 'is_closed' => true, ]); - factory(EntityWithClosedFlag::class, 2)->create([ + EntityWithClosedFlag::factory()->count(2)->create([ 'is_closed' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_closed(): void /** @test */ public function it_can_undo_close_model(): void { - $model = factory(EntityWithClosedFlag::class)->create([ + $model = EntityWithClosedFlag::factory()->create([ 'is_closed' => true, ]); @@ -97,7 +97,7 @@ public function it_can_undo_close_model(): void /** @test */ public function it_can_close_model(): void { - $model = factory(EntityWithClosedFlag::class)->create([ + $model = EntityWithClosedFlag::factory()->create([ 'is_closed' => false, ]); @@ -111,10 +111,10 @@ public function it_can_close_model(): void /** @test */ public function it_can_skip_auto_apply(): void { - factory(EntityWithClosedFlag::class, 3)->create([ + EntityWithClosedFlag::factory()->count(3)->create([ 'is_closed' => true, ]); - factory(EntityWithClosedFlag::class, 2)->create([ + EntityWithClosedFlag::factory()->count(2)->create([ 'is_closed' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_auto_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithClosedFlag::class, 3)->create([ + EntityWithClosedFlag::factory()->count(3)->create([ 'is_closed' => true, ]); - factory(EntityWithClosedFlag::class, 2)->create([ + EntityWithClosedFlag::factory()->count(2)->create([ 'is_closed' => false, ]); diff --git a/tests/Unit/Scopes/Inverse/DraftedAtScopeTest.php b/tests/Unit/Scopes/Inverse/DraftedAtScopeTest.php index 6d466a3..25e2c07 100644 --- a/tests/Unit/Scopes/Inverse/DraftedAtScopeTest.php +++ b/tests/Unit/Scopes/Inverse/DraftedAtScopeTest.php @@ -11,12 +11,12 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithDraftedAt; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithDraftedAtApplied; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithDraftedAtUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithDraftedAt; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithDraftedAtApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithDraftedAtUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class DraftedAtScopeTest extends TestCase @@ -24,10 +24,10 @@ final class DraftedAtScopeTest extends TestCase /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithDraftedAt::class, 3)->create([ + EntityWithDraftedAt::factory()->count(3)->create([ 'drafted_at' => Date::now()->subDay(), ]); - factory(EntityWithDraftedAt::class, 2)->create([ + EntityWithDraftedAt::factory()->count(2)->create([ 'drafted_at' => null, ]); @@ -39,10 +39,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_drafted(): void { - factory(EntityWithDraftedAt::class, 3)->create([ + EntityWithDraftedAt::factory()->count(3)->create([ 'drafted_at' => Date::now()->subDay(), ]); - factory(EntityWithDraftedAt::class, 2)->create([ + EntityWithDraftedAt::factory()->count(2)->create([ 'drafted_at' => null, ]); @@ -54,10 +54,10 @@ public function it_can_get_without_drafted(): void /** @test */ public function it_can_get_with_drafted(): void { - factory(EntityWithDraftedAt::class, 3)->create([ + EntityWithDraftedAt::factory()->count(3)->create([ 'drafted_at' => Date::now()->subDay(), ]); - factory(EntityWithDraftedAt::class, 2)->create([ + EntityWithDraftedAt::factory()->count(2)->create([ 'drafted_at' => null, ]); @@ -69,10 +69,10 @@ public function it_can_get_with_drafted(): void /** @test */ public function it_can_get_only_drafted(): void { - factory(EntityWithDraftedAt::class, 3)->create([ + EntityWithDraftedAt::factory()->count(3)->create([ 'drafted_at' => Date::now()->subDay(), ]); - factory(EntityWithDraftedAt::class, 2)->create([ + EntityWithDraftedAt::factory()->count(2)->create([ 'drafted_at' => null, ]); @@ -84,7 +84,7 @@ public function it_can_get_only_drafted(): void /** @test */ public function it_can_undo_draft_model(): void { - $model = factory(EntityWithDraftedAt::class)->create([ + $model = EntityWithDraftedAt::factory()->create([ 'drafted_at' => Date::now()->subDay(), ]); @@ -98,7 +98,7 @@ public function it_can_undo_draft_model(): void /** @test */ public function it_can_draft_model(): void { - $model = factory(EntityWithDraftedAt::class)->create([ + $model = EntityWithDraftedAt::factory()->create([ 'drafted_at' => null, ]); @@ -112,10 +112,10 @@ public function it_can_draft_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithDraftedAt::class, 3)->create([ + EntityWithDraftedAt::factory()->count(3)->create([ 'drafted_at' => Date::now()->subDay(), ]); - factory(EntityWithDraftedAt::class, 2)->create([ + EntityWithDraftedAt::factory()->count(2)->create([ 'drafted_at' => null, ]); @@ -127,10 +127,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithDraftedAt::class, 3)->create([ + EntityWithDraftedAt::factory()->count(3)->create([ 'drafted_at' => Date::now()->subDay(), ]); - factory(EntityWithDraftedAt::class, 2)->create([ + EntityWithDraftedAt::factory()->count(2)->create([ 'drafted_at' => null, ]); diff --git a/tests/Unit/Scopes/Inverse/DraftedFlagScopeTest.php b/tests/Unit/Scopes/Inverse/DraftedFlagScopeTest.php index fd617e6..7bbaf0c 100644 --- a/tests/Unit/Scopes/Inverse/DraftedFlagScopeTest.php +++ b/tests/Unit/Scopes/Inverse/DraftedFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithDraftedFlag; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithDraftedFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithDraftedFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithDraftedFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithDraftedFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithDraftedFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class DraftedFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithDraftedFlag::class, 3)->create([ + EntityWithDraftedFlag::factory()->count(3)->create([ 'is_drafted' => true, ]); - factory(EntityWithDraftedFlag::class, 2)->create([ + EntityWithDraftedFlag::factory()->count(2)->create([ 'is_drafted' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_drafted(): void { - factory(EntityWithDraftedFlag::class, 3)->create([ + EntityWithDraftedFlag::factory()->count(3)->create([ 'is_drafted' => true, ]); - factory(EntityWithDraftedFlag::class, 2)->create([ + EntityWithDraftedFlag::factory()->count(2)->create([ 'is_drafted' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_drafted(): void /** @test */ public function it_can_get_with_drafted(): void { - factory(EntityWithDraftedFlag::class, 3)->create([ + EntityWithDraftedFlag::factory()->count(3)->create([ 'is_drafted' => true, ]); - factory(EntityWithDraftedFlag::class, 2)->create([ + EntityWithDraftedFlag::factory()->count(2)->create([ 'is_drafted' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_drafted(): void /** @test */ public function it_can_get_only_drafted(): void { - factory(EntityWithDraftedFlag::class, 3)->create([ + EntityWithDraftedFlag::factory()->count(3)->create([ 'is_drafted' => true, ]); - factory(EntityWithDraftedFlag::class, 2)->create([ + EntityWithDraftedFlag::factory()->count(2)->create([ 'is_drafted' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_drafted(): void /** @test */ public function it_can_undo_draft_model(): void { - $model = factory(EntityWithDraftedFlag::class)->create([ + $model = EntityWithDraftedFlag::factory()->create([ 'is_drafted' => true, ]); @@ -97,7 +97,7 @@ public function it_can_undo_draft_model(): void /** @test */ public function it_can_draft_model(): void { - $model = factory(EntityWithDraftedFlag::class)->create([ + $model = EntityWithDraftedFlag::factory()->create([ 'is_drafted' => false, ]); @@ -111,10 +111,10 @@ public function it_can_draft_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithDraftedFlag::class, 3)->create([ + EntityWithDraftedFlag::factory()->count(3)->create([ 'is_drafted' => true, ]); - factory(EntityWithDraftedFlag::class, 2)->create([ + EntityWithDraftedFlag::factory()->count(2)->create([ 'is_drafted' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithDraftedFlag::class, 3)->create([ + EntityWithDraftedFlag::factory()->count(3)->create([ 'is_drafted' => true, ]); - factory(EntityWithDraftedFlag::class, 2)->create([ + EntityWithDraftedFlag::factory()->count(2)->create([ 'is_drafted' => false, ]); diff --git a/tests/Unit/Scopes/Inverse/EndedAtScopeTest.php b/tests/Unit/Scopes/Inverse/EndedAtScopeTest.php index 373c8ac..c8eb517 100644 --- a/tests/Unit/Scopes/Inverse/EndedAtScopeTest.php +++ b/tests/Unit/Scopes/Inverse/EndedAtScopeTest.php @@ -11,12 +11,12 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithEndedAt; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithEndedAtApplied; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithEndedAtUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithEndedAt; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithEndedAtApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithEndedAtUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class EndedAtScopeTest extends TestCase @@ -24,10 +24,10 @@ final class EndedAtScopeTest extends TestCase /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithEndedAt::class, 3)->create([ + EntityWithEndedAt::factory()->count(3)->create([ 'ended_at' => Date::now()->subDay(), ]); - factory(EntityWithEndedAt::class, 2)->create([ + EntityWithEndedAt::factory()->count(2)->create([ 'ended_at' => null, ]); @@ -39,10 +39,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_ended(): void { - factory(EntityWithEndedAt::class, 3)->create([ + EntityWithEndedAt::factory()->count(3)->create([ 'ended_at' => Date::now()->subDay(), ]); - factory(EntityWithEndedAt::class, 2)->create([ + EntityWithEndedAt::factory()->count(2)->create([ 'ended_at' => null, ]); @@ -54,10 +54,10 @@ public function it_can_get_without_ended(): void /** @test */ public function it_can_get_with_ended(): void { - factory(EntityWithEndedAt::class, 3)->create([ + EntityWithEndedAt::factory()->count(3)->create([ 'ended_at' => Date::now()->subDay(), ]); - factory(EntityWithEndedAt::class, 2)->create([ + EntityWithEndedAt::factory()->count(2)->create([ 'ended_at' => null, ]); @@ -69,10 +69,10 @@ public function it_can_get_with_ended(): void /** @test */ public function it_can_get_only_ended(): void { - factory(EntityWithEndedAt::class, 3)->create([ + EntityWithEndedAt::factory()->count(3)->create([ 'ended_at' => Date::now()->subDay(), ]); - factory(EntityWithEndedAt::class, 2)->create([ + EntityWithEndedAt::factory()->count(2)->create([ 'ended_at' => null, ]); @@ -84,7 +84,7 @@ public function it_can_get_only_ended(): void /** @test */ public function it_can_undo_end_model(): void { - $model = factory(EntityWithEndedAt::class)->create([ + $model = EntityWithEndedAt::factory()->create([ 'ended_at' => Date::now()->subDay(), ]); @@ -98,7 +98,7 @@ public function it_can_undo_end_model(): void /** @test */ public function it_can_end_model(): void { - $model = factory(EntityWithEndedAt::class)->create([ + $model = EntityWithEndedAt::factory()->create([ 'ended_at' => null, ]); @@ -112,10 +112,10 @@ public function it_can_end_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithEndedAt::class, 3)->create([ + EntityWithEndedAt::factory()->count(3)->create([ 'ended_at' => Date::now()->subDay(), ]); - factory(EntityWithEndedAt::class, 2)->create([ + EntityWithEndedAt::factory()->count(2)->create([ 'ended_at' => null, ]); @@ -127,10 +127,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithEndedAt::class, 3)->create([ + EntityWithEndedAt::factory()->count(3)->create([ 'ended_at' => Date::now()->subDay(), ]); - factory(EntityWithEndedAt::class, 2)->create([ + EntityWithEndedAt::factory()->count(2)->create([ 'ended_at' => null, ]); diff --git a/tests/Unit/Scopes/Inverse/EndedFlagScopeTest.php b/tests/Unit/Scopes/Inverse/EndedFlagScopeTest.php index b9a4856..889470d 100644 --- a/tests/Unit/Scopes/Inverse/EndedFlagScopeTest.php +++ b/tests/Unit/Scopes/Inverse/EndedFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithEndedFlag; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithEndedFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithEndedFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithEndedFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithEndedFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithEndedFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class EndedFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithEndedFlag::class, 3)->create([ + EntityWithEndedFlag::factory()->count(3)->create([ 'is_ended' => true, ]); - factory(EntityWithEndedFlag::class, 2)->create([ + EntityWithEndedFlag::factory()->count(2)->create([ 'is_ended' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_ended(): void { - factory(EntityWithEndedFlag::class, 3)->create([ + EntityWithEndedFlag::factory()->count(3)->create([ 'is_ended' => true, ]); - factory(EntityWithEndedFlag::class, 2)->create([ + EntityWithEndedFlag::factory()->count(2)->create([ 'is_ended' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_ended(): void /** @test */ public function it_can_get_with_ended(): void { - factory(EntityWithEndedFlag::class, 3)->create([ + EntityWithEndedFlag::factory()->count(3)->create([ 'is_ended' => true, ]); - factory(EntityWithEndedFlag::class, 2)->create([ + EntityWithEndedFlag::factory()->count(2)->create([ 'is_ended' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_ended(): void /** @test */ public function it_can_get_only_ended(): void { - factory(EntityWithEndedFlag::class, 3)->create([ + EntityWithEndedFlag::factory()->count(3)->create([ 'is_ended' => true, ]); - factory(EntityWithEndedFlag::class, 2)->create([ + EntityWithEndedFlag::factory()->count(2)->create([ 'is_ended' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_ended(): void /** @test */ public function it_can_undo_end_model(): void { - $model = factory(EntityWithEndedFlag::class)->create([ + $model = EntityWithEndedFlag::factory()->create([ 'is_ended' => true, ]); @@ -97,7 +97,7 @@ public function it_can_undo_end_model(): void /** @test */ public function it_can_end_model(): void { - $model = factory(EntityWithEndedFlag::class)->create([ + $model = EntityWithEndedFlag::factory()->create([ 'is_ended' => false, ]); @@ -111,10 +111,10 @@ public function it_can_end_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithEndedFlag::class, 3)->create([ + EntityWithEndedFlag::factory()->count(3)->create([ 'is_ended' => true, ]); - factory(EntityWithEndedFlag::class, 2)->create([ + EntityWithEndedFlag::factory()->count(2)->create([ 'is_ended' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithEndedFlag::class, 3)->create([ + EntityWithEndedFlag::factory()->count(3)->create([ 'is_ended' => true, ]); - factory(EntityWithEndedFlag::class, 2)->create([ + EntityWithEndedFlag::factory()->count(2)->create([ 'is_ended' => false, ]); diff --git a/tests/Unit/Scopes/Inverse/ExpiredAtScopeTest.php b/tests/Unit/Scopes/Inverse/ExpiredAtScopeTest.php index c504845..aa13600 100644 --- a/tests/Unit/Scopes/Inverse/ExpiredAtScopeTest.php +++ b/tests/Unit/Scopes/Inverse/ExpiredAtScopeTest.php @@ -11,12 +11,12 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithExpiredAt; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithExpiredAtApplied; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithExpiredAtUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithExpiredAt; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithExpiredAtApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithExpiredAtUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class ExpiredAtScopeTest extends TestCase @@ -24,10 +24,10 @@ final class ExpiredAtScopeTest extends TestCase /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithExpiredAt::class, 3)->create([ + EntityWithExpiredAt::factory()->count(3)->create([ 'expired_at' => Date::now()->subDay(), ]); - factory(EntityWithExpiredAt::class, 2)->create([ + EntityWithExpiredAt::factory()->count(2)->create([ 'expired_at' => null, ]); @@ -39,10 +39,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_expired(): void { - factory(EntityWithExpiredAt::class, 3)->create([ + EntityWithExpiredAt::factory()->count(3)->create([ 'expired_at' => Date::now()->subDay(), ]); - factory(EntityWithExpiredAt::class, 2)->create([ + EntityWithExpiredAt::factory()->count(2)->create([ 'expired_at' => null, ]); @@ -54,10 +54,10 @@ public function it_can_get_without_expired(): void /** @test */ public function it_can_get_with_expired(): void { - factory(EntityWithExpiredAt::class, 3)->create([ + EntityWithExpiredAt::factory()->count(3)->create([ 'expired_at' => Date::now()->subDay(), ]); - factory(EntityWithExpiredAt::class, 2)->create([ + EntityWithExpiredAt::factory()->count(2)->create([ 'expired_at' => null, ]); @@ -69,10 +69,10 @@ public function it_can_get_with_expired(): void /** @test */ public function it_can_get_only_expired(): void { - factory(EntityWithExpiredAt::class, 3)->create([ + EntityWithExpiredAt::factory()->count(3)->create([ 'expired_at' => Date::now()->subDay(), ]); - factory(EntityWithExpiredAt::class, 2)->create([ + EntityWithExpiredAt::factory()->count(2)->create([ 'expired_at' => null, ]); @@ -84,7 +84,7 @@ public function it_can_get_only_expired(): void /** @test */ public function it_can_undo_expire_model(): void { - $model = factory(EntityWithExpiredAt::class)->create([ + $model = EntityWithExpiredAt::factory()->create([ 'expired_at' => Date::now()->subDay(), ]); @@ -98,7 +98,7 @@ public function it_can_undo_expire_model(): void /** @test */ public function it_can_expire_model(): void { - $model = factory(EntityWithExpiredAt::class)->create([ + $model = EntityWithExpiredAt::factory()->create([ 'expired_at' => null, ]); @@ -112,10 +112,10 @@ public function it_can_expire_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithExpiredAt::class, 3)->create([ + EntityWithExpiredAt::factory()->count(3)->create([ 'expired_at' => Date::now()->subDay(), ]); - factory(EntityWithExpiredAt::class, 2)->create([ + EntityWithExpiredAt::factory()->count(2)->create([ 'expired_at' => null, ]); @@ -127,10 +127,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithExpiredAt::class, 3)->create([ + EntityWithExpiredAt::factory()->count(3)->create([ 'expired_at' => Date::now()->subDay(), ]); - factory(EntityWithExpiredAt::class, 2)->create([ + EntityWithExpiredAt::factory()->count(2)->create([ 'expired_at' => null, ]); diff --git a/tests/Unit/Scopes/Inverse/ExpiredFlagScopeTest.php b/tests/Unit/Scopes/Inverse/ExpiredFlagScopeTest.php index a9f9c67..f958d0e 100644 --- a/tests/Unit/Scopes/Inverse/ExpiredFlagScopeTest.php +++ b/tests/Unit/Scopes/Inverse/ExpiredFlagScopeTest.php @@ -11,22 +11,22 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Scopes\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Scopes\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithExpiredFlag; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithExpiredFlagApplied; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithExpiredFlagUnapplied; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithExpiredFlag; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithExpiredFlagApplied; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithExpiredFlagUnapplied; +use Cog\Tests\Laravel\Flag\TestCase; final class ExpiredFlagScopeTest extends TestCase { /** @test */ public function it_get_without_global_scope_default(): void { - factory(EntityWithExpiredFlag::class, 3)->create([ + EntityWithExpiredFlag::factory()->count(3)->create([ 'is_expired' => true, ]); - factory(EntityWithExpiredFlag::class, 2)->create([ + EntityWithExpiredFlag::factory()->count(2)->create([ 'is_expired' => false, ]); @@ -38,10 +38,10 @@ public function it_get_without_global_scope_default(): void /** @test */ public function it_can_get_without_expired(): void { - factory(EntityWithExpiredFlag::class, 3)->create([ + EntityWithExpiredFlag::factory()->count(3)->create([ 'is_expired' => true, ]); - factory(EntityWithExpiredFlag::class, 2)->create([ + EntityWithExpiredFlag::factory()->count(2)->create([ 'is_expired' => false, ]); @@ -53,10 +53,10 @@ public function it_can_get_without_expired(): void /** @test */ public function it_can_get_with_expired(): void { - factory(EntityWithExpiredFlag::class, 3)->create([ + EntityWithExpiredFlag::factory()->count(3)->create([ 'is_expired' => true, ]); - factory(EntityWithExpiredFlag::class, 2)->create([ + EntityWithExpiredFlag::factory()->count(2)->create([ 'is_expired' => false, ]); @@ -68,10 +68,10 @@ public function it_can_get_with_expired(): void /** @test */ public function it_can_get_only_expired(): void { - factory(EntityWithExpiredFlag::class, 3)->create([ + EntityWithExpiredFlag::factory()->count(3)->create([ 'is_expired' => true, ]); - factory(EntityWithExpiredFlag::class, 2)->create([ + EntityWithExpiredFlag::factory()->count(2)->create([ 'is_expired' => false, ]); @@ -83,7 +83,7 @@ public function it_can_get_only_expired(): void /** @test */ public function it_can_undo_expire_model(): void { - $model = factory(EntityWithExpiredFlag::class)->create([ + $model = EntityWithExpiredFlag::factory()->create([ 'is_expired' => true, ]); @@ -97,7 +97,7 @@ public function it_can_undo_expire_model(): void /** @test */ public function it_can_expire_model(): void { - $model = factory(EntityWithExpiredFlag::class)->create([ + $model = EntityWithExpiredFlag::factory()->create([ 'is_expired' => false, ]); @@ -111,10 +111,10 @@ public function it_can_expire_model(): void /** @test */ public function it_can_skip_apply(): void { - factory(EntityWithExpiredFlag::class, 3)->create([ + EntityWithExpiredFlag::factory()->count(3)->create([ 'is_expired' => true, ]); - factory(EntityWithExpiredFlag::class, 2)->create([ + EntityWithExpiredFlag::factory()->count(2)->create([ 'is_expired' => false, ]); @@ -126,10 +126,10 @@ public function it_can_skip_apply(): void /** @test */ public function it_can_auto_apply(): void { - factory(EntityWithExpiredFlag::class, 3)->create([ + EntityWithExpiredFlag::factory()->count(3)->create([ 'is_expired' => true, ]); - factory(EntityWithExpiredFlag::class, 2)->create([ + EntityWithExpiredFlag::factory()->count(2)->create([ 'is_expired' => false, ]); diff --git a/tests/Unit/Traits/Classic/HasAcceptedAtHelpersTest.php b/tests/Unit/Traits/Classic/HasAcceptedAtHelpersTest.php index 4bc82d3..f7a32ab 100644 --- a/tests/Unit/Traits/Classic/HasAcceptedAtHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasAcceptedAtHelpersTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedAt; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithAcceptedAt; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; @@ -23,7 +23,7 @@ final class HasAcceptedAtHelpersTest extends TestCase /** @test */ public function it_casts_accepted_at_to_datetime(): void { - $entity = factory(EntityWithAcceptedAt::class)->create([ + $entity = EntityWithAcceptedAt::factory()->create([ 'accepted_at' => '1986-03-28 00:00:00', ]); @@ -34,11 +34,11 @@ public function it_casts_accepted_at_to_datetime(): void /** @test */ public function it_can_check_if_entity_is_accepted(): void { - $acceptedEntity = factory(EntityWithAcceptedAt::class)->create([ + $acceptedEntity = EntityWithAcceptedAt::factory()->create([ 'accepted_at' => Date::now(), ]); - $rejectedEntity = factory(EntityWithAcceptedAt::class)->create([ + $rejectedEntity = EntityWithAcceptedAt::factory()->create([ 'accepted_at' => null, ]); @@ -49,11 +49,11 @@ public function it_can_check_if_entity_is_accepted(): void /** @test */ public function it_can_check_if_entity_is_not_accepted(): void { - $acceptedEntity = factory(EntityWithAcceptedAt::class)->create([ + $acceptedEntity = EntityWithAcceptedAt::factory()->create([ 'accepted_at' => Date::now(), ]); - $rejectedEntity = factory(EntityWithAcceptedAt::class)->create([ + $rejectedEntity = EntityWithAcceptedAt::factory()->create([ 'accepted_at' => null, ]); @@ -64,7 +64,7 @@ public function it_can_check_if_entity_is_not_accepted(): void /** @test */ public function it_can_accept(): void { - $entity = factory(EntityWithAcceptedAt::class)->create([ + $entity = EntityWithAcceptedAt::factory()->create([ 'accepted_at' => null, ]); @@ -76,7 +76,7 @@ public function it_can_accept(): void /** @test */ public function it_can_undo_accept(): void { - $entity = factory(EntityWithAcceptedAt::class)->create([ + $entity = EntityWithAcceptedAt::factory()->create([ 'accepted_at' => Date::now(), ]); diff --git a/tests/Unit/Traits/Classic/HasAcceptedFlagHelpersTest.php b/tests/Unit/Traits/Classic/HasAcceptedFlagHelpersTest.php index d8f21b9..d1fb4aa 100644 --- a/tests/Unit/Traits/Classic/HasAcceptedFlagHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasAcceptedFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithAcceptedFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasAcceptedFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_accepted_to_boolean(): void { - $entity = factory(EntityWithAcceptedFlag::class)->create([ + $entity = EntityWithAcceptedFlag::factory()->create([ 'is_accepted' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_accepted_to_boolean(): void /** @test */ public function it_not_casts_is_accepted_to_boolean(): void { - $entity = factory(EntityWithAcceptedFlag::class)->make([ + $entity = EntityWithAcceptedFlag::factory()->make([ 'is_accepted' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_accepted_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_accepted(): void { - $acceptedEntity = factory(EntityWithAcceptedFlag::class)->create([ + $acceptedEntity = EntityWithAcceptedFlag::factory()->create([ 'is_accepted' => true, ]); - $rejectedEntity = factory(EntityWithAcceptedFlag::class)->create([ + $rejectedEntity = EntityWithAcceptedFlag::factory()->create([ 'is_accepted' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_accepted(): void /** @test */ public function it_can_check_if_entity_is_not_accepted(): void { - $acceptedEntity = factory(EntityWithAcceptedFlag::class)->create([ + $acceptedEntity = EntityWithAcceptedFlag::factory()->create([ 'is_accepted' => true, ]); - $rejectedEntity = factory(EntityWithAcceptedFlag::class)->create([ + $rejectedEntity = EntityWithAcceptedFlag::factory()->create([ 'is_accepted' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_accepted(): void /** @test */ public function it_can_accept(): void { - $entity = factory(EntityWithAcceptedFlag::class)->create([ + $entity = EntityWithAcceptedFlag::factory()->create([ 'is_accepted' => false, ]); @@ -83,7 +83,7 @@ public function it_can_accept(): void /** @test */ public function it_can_undo_accept(): void { - $entity = factory(EntityWithAcceptedFlag::class)->create([ + $entity = EntityWithAcceptedFlag::factory()->create([ 'is_accepted' => true, ]); diff --git a/tests/Unit/Traits/Classic/HasActiveFlagHelpersTest.php b/tests/Unit/Traits/Classic/HasActiveFlagHelpersTest.php index 366a715..31eee74 100644 --- a/tests/Unit/Traits/Classic/HasActiveFlagHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasActiveFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithActiveFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithActiveFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasActiveFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_active_to_boolean(): void { - $entity = factory(EntityWithActiveFlag::class)->create([ + $entity = EntityWithActiveFlag::factory()->create([ 'is_active' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_active_to_boolean(): void /** @test */ public function it_not_casts_is_active_to_boolean(): void { - $entity = factory(EntityWithActiveFlag::class)->make([ + $entity = EntityWithActiveFlag::factory()->make([ 'is_active' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_active_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_active(): void { - $activatedEntity = factory(EntityWithActiveFlag::class)->create([ + $activatedEntity = EntityWithActiveFlag::factory()->create([ 'is_active' => true, ]); - $deactivatedEntity = factory(EntityWithActiveFlag::class)->create([ + $deactivatedEntity = EntityWithActiveFlag::factory()->create([ 'is_active' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_active(): void /** @test */ public function it_can_check_if_entity_is_not_activated(): void { - $activatedEntity = factory(EntityWithActiveFlag::class)->create([ + $activatedEntity = EntityWithActiveFlag::factory()->create([ 'is_active' => true, ]); - $deactivatedEntity = factory(EntityWithActiveFlag::class)->create([ + $deactivatedEntity = EntityWithActiveFlag::factory()->create([ 'is_active' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_activated(): void /** @test */ public function it_can_activate(): void { - $entity = factory(EntityWithActiveFlag::class)->create([ + $entity = EntityWithActiveFlag::factory()->create([ 'is_active' => false, ]); @@ -83,7 +83,7 @@ public function it_can_activate(): void /** @test */ public function it_can_undo_activate(): void { - $entity = factory(EntityWithActiveFlag::class)->create([ + $entity = EntityWithActiveFlag::factory()->create([ 'is_active' => true, ]); diff --git a/tests/Unit/Traits/Classic/HasApprovedAtHelpersTest.php b/tests/Unit/Traits/Classic/HasApprovedAtHelpersTest.php index 1dc4a54..90987b8 100644 --- a/tests/Unit/Traits/Classic/HasApprovedAtHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasApprovedAtHelpersTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithApprovedAt; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithApprovedAt; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; @@ -23,7 +23,7 @@ final class HasApprovedAtHelpersTest extends TestCase /** @test */ public function it_casts_approved_at_to_datetime(): void { - $entity = factory(EntityWithApprovedAt::class)->create([ + $entity = EntityWithApprovedAt::factory()->create([ 'approved_at' => '1986-03-28 00:00:00', ]); @@ -34,11 +34,11 @@ public function it_casts_approved_at_to_datetime(): void /** @test */ public function it_can_check_if_entity_is_approved(): void { - $approvedEntity = factory(EntityWithApprovedAt::class)->create([ + $approvedEntity = EntityWithApprovedAt::factory()->create([ 'approved_at' => Date::now(), ]); - $disapprovedEntity = factory(EntityWithApprovedAt::class)->create([ + $disapprovedEntity = EntityWithApprovedAt::factory()->create([ 'approved_at' => null, ]); @@ -49,11 +49,11 @@ public function it_can_check_if_entity_is_approved(): void /** @test */ public function it_can_check_if_entity_is_not_approved(): void { - $approvedEntity = factory(EntityWithApprovedAt::class)->create([ + $approvedEntity = EntityWithApprovedAt::factory()->create([ 'approved_at' => Date::now(), ]); - $disapprovedEntity = factory(EntityWithApprovedAt::class)->create([ + $disapprovedEntity = EntityWithApprovedAt::factory()->create([ 'approved_at' => null, ]); @@ -64,7 +64,7 @@ public function it_can_check_if_entity_is_not_approved(): void /** @test */ public function it_can_approve(): void { - $entity = factory(EntityWithApprovedAt::class)->create([ + $entity = EntityWithApprovedAt::factory()->create([ 'approved_at' => null, ]); @@ -76,7 +76,7 @@ public function it_can_approve(): void /** @test */ public function it_can_undo_approve(): void { - $entity = factory(EntityWithApprovedAt::class)->create([ + $entity = EntityWithApprovedAt::factory()->create([ 'approved_at' => Date::now(), ]); diff --git a/tests/Unit/Traits/Classic/HasApprovedFlagHelpersTest.php b/tests/Unit/Traits/Classic/HasApprovedFlagHelpersTest.php index b9d0546..5e790d1 100644 --- a/tests/Unit/Traits/Classic/HasApprovedFlagHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasApprovedFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithApprovedFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithApprovedFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasApprovedFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_approved_to_boolean(): void { - $entity = factory(EntityWithApprovedFlag::class)->create([ + $entity = EntityWithApprovedFlag::factory()->create([ 'is_approved' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_approved_to_boolean(): void /** @test */ public function it_not_casts_is_approved_to_boolean(): void { - $entity = factory(EntityWithApprovedFlag::class)->make([ + $entity = EntityWithApprovedFlag::factory()->make([ 'is_approved' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_approved_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_approved(): void { - $approvedEntity = factory(EntityWithApprovedFlag::class)->create([ + $approvedEntity = EntityWithApprovedFlag::factory()->create([ 'is_approved' => true, ]); - $disapprovedEntity = factory(EntityWithApprovedFlag::class)->create([ + $disapprovedEntity = EntityWithApprovedFlag::factory()->create([ 'is_approved' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_approved(): void /** @test */ public function it_can_check_if_entity_is_not_approved(): void { - $approvedEntity = factory(EntityWithApprovedFlag::class)->create([ + $approvedEntity = EntityWithApprovedFlag::factory()->create([ 'is_approved' => true, ]); - $disapprovedEntity = factory(EntityWithApprovedFlag::class)->create([ + $disapprovedEntity = EntityWithApprovedFlag::factory()->create([ 'is_approved' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_approved(): void /** @test */ public function it_can_approve(): void { - $entity = factory(EntityWithApprovedFlag::class)->create([ + $entity = EntityWithApprovedFlag::factory()->create([ 'is_approved' => false, ]); @@ -83,7 +83,7 @@ public function it_can_approve(): void /** @test */ public function it_can_undo_approve(): void { - $entity = factory(EntityWithApprovedFlag::class)->create([ + $entity = EntityWithApprovedFlag::factory()->create([ 'is_approved' => true, ]); diff --git a/tests/Unit/Traits/Classic/HasInvitedAtHelpersTest.php b/tests/Unit/Traits/Classic/HasInvitedAtHelpersTest.php index 616bfa7..6e88648 100644 --- a/tests/Unit/Traits/Classic/HasInvitedAtHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasInvitedAtHelpersTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithInvitedAt; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithInvitedAt; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; @@ -23,7 +23,7 @@ final class HasInvitedAtHelpersTest extends TestCase /** @test */ public function it_casts_invited_at_to_datetime(): void { - $entity = factory(EntityWithInvitedAt::class)->create([ + $entity = EntityWithInvitedAt::factory()->create([ 'invited_at' => '1986-03-28 00:00:00', ]); @@ -34,11 +34,11 @@ public function it_casts_invited_at_to_datetime(): void /** @test */ public function it_can_check_if_entity_is_invited(): void { - $invitedEntity = factory(EntityWithInvitedAt::class)->create([ + $invitedEntity = EntityWithInvitedAt::factory()->create([ 'invited_at' => Date::now(), ]); - $uninvitedEntity = factory(EntityWithInvitedAt::class)->create([ + $uninvitedEntity = EntityWithInvitedAt::factory()->create([ 'invited_at' => null, ]); @@ -49,11 +49,11 @@ public function it_can_check_if_entity_is_invited(): void /** @test */ public function it_can_check_if_entity_is_not_invited(): void { - $invitedEntity = factory(EntityWithInvitedAt::class)->create([ + $invitedEntity = EntityWithInvitedAt::factory()->create([ 'invited_at' => Date::now(), ]); - $uninvitedEntity = factory(EntityWithInvitedAt::class)->create([ + $uninvitedEntity = EntityWithInvitedAt::factory()->create([ 'invited_at' => null, ]); @@ -64,7 +64,7 @@ public function it_can_check_if_entity_is_not_invited(): void /** @test */ public function it_can_invite(): void { - $entity = factory(EntityWithInvitedAt::class)->create([ + $entity = EntityWithInvitedAt::factory()->create([ 'invited_at' => null, ]); @@ -76,7 +76,7 @@ public function it_can_invite(): void /** @test */ public function it_can_undo_invite(): void { - $entity = factory(EntityWithInvitedAt::class)->create([ + $entity = EntityWithInvitedAt::factory()->create([ 'invited_at' => Date::now(), ]); diff --git a/tests/Unit/Traits/Classic/HasInvitedFlagHelpersTest.php b/tests/Unit/Traits/Classic/HasInvitedFlagHelpersTest.php index ada8290..4362214 100644 --- a/tests/Unit/Traits/Classic/HasInvitedFlagHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasInvitedFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithInvitedFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithInvitedFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasInvitedFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_invited_to_boolean(): void { - $entity = factory(EntityWithInvitedFlag::class)->create([ + $entity = EntityWithInvitedFlag::factory()->create([ 'is_invited' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_invited_to_boolean(): void /** @test */ public function it_not_casts_is_invited_to_boolean(): void { - $entity = factory(EntityWithInvitedFlag::class)->make([ + $entity = EntityWithInvitedFlag::factory()->make([ 'is_invited' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_invited_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_invited(): void { - $invitedEntity = factory(EntityWithInvitedFlag::class)->create([ + $invitedEntity = EntityWithInvitedFlag::factory()->create([ 'is_invited' => true, ]); - $uninvitedEntity = factory(EntityWithInvitedFlag::class)->create([ + $uninvitedEntity = EntityWithInvitedFlag::factory()->create([ 'is_invited' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_invited(): void /** @test */ public function it_can_check_if_entity_is_not_invited(): void { - $invitedEntity = factory(EntityWithInvitedFlag::class)->create([ + $invitedEntity = EntityWithInvitedFlag::factory()->create([ 'is_invited' => true, ]); - $uninvitedEntity = factory(EntityWithInvitedFlag::class)->create([ + $uninvitedEntity = EntityWithInvitedFlag::factory()->create([ 'is_invited' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_invited(): void /** @test */ public function it_can_invite(): void { - $entity = factory(EntityWithInvitedFlag::class)->create([ + $entity = EntityWithInvitedFlag::factory()->create([ 'is_invited' => false, ]); @@ -83,7 +83,7 @@ public function it_can_invite(): void /** @test */ public function it_can_undo_invite(): void { - $entity = factory(EntityWithInvitedFlag::class)->create([ + $entity = EntityWithInvitedFlag::factory()->create([ 'is_invited' => true, ]); diff --git a/tests/Unit/Traits/Classic/HasKeptFlagBehaviorTest.php b/tests/Unit/Traits/Classic/HasKeptFlagBehaviorTest.php index 62605b1..c2b25e2 100644 --- a/tests/Unit/Traits/Classic/HasKeptFlagBehaviorTest.php +++ b/tests/Unit/Traits/Classic/HasKeptFlagBehaviorTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithKeptFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithKeptFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasKeptFlagBehaviorTest extends TestCase { @@ -32,7 +32,7 @@ public function it_sets_is_kept_false_on_create(): void /** @test */ public function it_sets_is_kept_true_on_any_update(): void { - $entity = factory(EntityWithKeptFlag::class)->create([ + $entity = EntityWithKeptFlag::factory()->create([ 'is_kept' => false, ]); diff --git a/tests/Unit/Traits/Classic/HasKeptFlagHelperTest.php b/tests/Unit/Traits/Classic/HasKeptFlagHelperTest.php index 1699f91..c119626 100644 --- a/tests/Unit/Traits/Classic/HasKeptFlagHelperTest.php +++ b/tests/Unit/Traits/Classic/HasKeptFlagHelperTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithKeptFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithKeptFlag; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Facades\Date; final class HasKeptFlagHelperTest extends TestCase @@ -22,7 +22,7 @@ final class HasKeptFlagHelperTest extends TestCase /** @test */ public function it_casts_is_kept_to_boolean(): void { - $entity = factory(EntityWithKeptFlag::class)->create([ + $entity = EntityWithKeptFlag::factory()->create([ 'is_kept' => 1, ]); @@ -32,7 +32,7 @@ public function it_casts_is_kept_to_boolean(): void /** @test */ public function it_not_casts_is_kept_to_boolean(): void { - $entity = factory(EntityWithKeptFlag::class)->make([ + $entity = EntityWithKeptFlag::factory()->make([ 'is_kept' => null, ]); @@ -42,11 +42,11 @@ public function it_not_casts_is_kept_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_kept(): void { - $keptEntity = factory(EntityWithKeptFlag::class)->create([ + $keptEntity = EntityWithKeptFlag::factory()->create([ 'is_kept' => true, ]); - $unkeptEntity = factory(EntityWithKeptFlag::class)->create([ + $unkeptEntity = EntityWithKeptFlag::factory()->create([ 'is_kept' => false, ]); @@ -57,11 +57,11 @@ public function it_can_check_if_entity_is_kept(): void /** @test */ public function it_can_check_if_entity_is_not_kept(): void { - $keptEntity = factory(EntityWithKeptFlag::class)->create([ + $keptEntity = EntityWithKeptFlag::factory()->create([ 'is_kept' => true, ]); - $unkeptEntity = factory(EntityWithKeptFlag::class)->create([ + $unkeptEntity = EntityWithKeptFlag::factory()->create([ 'is_kept' => false, ]); @@ -72,7 +72,7 @@ public function it_can_check_if_entity_is_not_kept(): void /** @test */ public function it_can_keep(): void { - $entity = factory(EntityWithKeptFlag::class)->create([ + $entity = EntityWithKeptFlag::factory()->create([ 'is_kept' => false, ]); @@ -84,7 +84,7 @@ public function it_can_keep(): void /** @test */ public function it_can_undo_keep(): void { - $entity = factory(EntityWithKeptFlag::class)->create([ + $entity = EntityWithKeptFlag::factory()->create([ 'is_kept' => true, ]); @@ -96,19 +96,19 @@ public function it_can_undo_keep(): void /** @test */ public function it_can_get_unkept_older_than_hours(): void { - factory(EntityWithKeptFlag::class, 3)->create([ + EntityWithKeptFlag::factory()->count(3)->create([ 'is_kept' => true, 'created_at' => Date::now()->subHours(4)->toDateTimeString(), ]); - factory(EntityWithKeptFlag::class, 2)->create([ + EntityWithKeptFlag::factory()->count(2)->create([ 'is_kept' => false, 'created_at' => Date::now()->subHours(4)->toDateTimeString(), ]); - factory(EntityWithKeptFlag::class, 2)->create([ + EntityWithKeptFlag::factory()->count(2)->create([ 'is_kept' => false, 'created_at' => Date::now()->subHours(2)->toDateTimeString(), ]); - factory(EntityWithKeptFlag::class, 2)->create([ + EntityWithKeptFlag::factory()->count(2)->create([ 'is_kept' => false, ]); diff --git a/tests/Unit/Traits/Classic/HasPublishedAtHelpersTest.php b/tests/Unit/Traits/Classic/HasPublishedAtHelpersTest.php index 80efc34..c2434ef 100644 --- a/tests/Unit/Traits/Classic/HasPublishedAtHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasPublishedAtHelpersTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithPublishedAt; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithPublishedAt; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; @@ -23,7 +23,7 @@ final class HasPublishedAtHelpersTest extends TestCase /** @test */ public function it_casts_published_at_to_datetime(): void { - $entity = factory(EntityWithPublishedAt::class)->create([ + $entity = EntityWithPublishedAt::factory()->create([ 'published_at' => '1986-03-28 00:00:00', ]); @@ -34,11 +34,11 @@ public function it_casts_published_at_to_datetime(): void /** @test */ public function it_can_check_if_entity_is_published(): void { - $publishedEntity = factory(EntityWithPublishedAt::class)->create([ + $publishedEntity = EntityWithPublishedAt::factory()->create([ 'published_at' => Date::now(), ]); - $unpublishedEntity = factory(EntityWithPublishedAt::class)->create([ + $unpublishedEntity = EntityWithPublishedAt::factory()->create([ 'published_at' => null, ]); @@ -49,11 +49,11 @@ public function it_can_check_if_entity_is_published(): void /** @test */ public function it_can_check_if_entity_is_not_published(): void { - $publishedEntity = factory(EntityWithPublishedAt::class)->create([ + $publishedEntity = EntityWithPublishedAt::factory()->create([ 'published_at' => Date::now(), ]); - $unpublishedEntity = factory(EntityWithPublishedAt::class)->create([ + $unpublishedEntity = EntityWithPublishedAt::factory()->create([ 'published_at' => null, ]); @@ -64,7 +64,7 @@ public function it_can_check_if_entity_is_not_published(): void /** @test */ public function it_can_publish(): void { - $entity = factory(EntityWithPublishedAt::class)->create([ + $entity = EntityWithPublishedAt::factory()->create([ 'published_at' => null, ]); @@ -76,7 +76,7 @@ public function it_can_publish(): void /** @test */ public function it_can_undo_publish(): void { - $entity = factory(EntityWithPublishedAt::class)->create([ + $entity = EntityWithPublishedAt::factory()->create([ 'published_at' => Date::now(), ]); diff --git a/tests/Unit/Traits/Classic/HasPublishedFlagHelpersTest.php b/tests/Unit/Traits/Classic/HasPublishedFlagHelpersTest.php index cfa5c65..40de426 100644 --- a/tests/Unit/Traits/Classic/HasPublishedFlagHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasPublishedFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithPublishedFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithPublishedFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasPublishedFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_published_to_boolean(): void { - $entity = factory(EntityWithPublishedFlag::class)->create([ + $entity = EntityWithPublishedFlag::factory()->create([ 'is_published' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_published_to_boolean(): void /** @test */ public function it_not_casts_is_published_to_boolean(): void { - $entity = factory(EntityWithPublishedFlag::class)->make([ + $entity = EntityWithPublishedFlag::factory()->make([ 'is_published' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_published_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_published(): void { - $publishedEntity = factory(EntityWithPublishedFlag::class)->create([ + $publishedEntity = EntityWithPublishedFlag::factory()->create([ 'is_published' => true, ]); - $unpublishedEntity = factory(EntityWithPublishedFlag::class)->create([ + $unpublishedEntity = EntityWithPublishedFlag::factory()->create([ 'is_published' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_published(): void /** @test */ public function it_can_check_if_entity_is_not_published(): void { - $publishedEntity = factory(EntityWithPublishedFlag::class)->create([ + $publishedEntity = EntityWithPublishedFlag::factory()->create([ 'is_published' => true, ]); - $unpublishedEntity = factory(EntityWithPublishedFlag::class)->create([ + $unpublishedEntity = EntityWithPublishedFlag::factory()->create([ 'is_published' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_published(): void /** @test */ public function it_can_publish(): void { - $entity = factory(EntityWithPublishedFlag::class)->create([ + $entity = EntityWithPublishedFlag::factory()->create([ 'is_published' => false, ]); @@ -83,7 +83,7 @@ public function it_can_publish(): void /** @test */ public function it_can_undo_publish(): void { - $entity = factory(EntityWithPublishedFlag::class)->create([ + $entity = EntityWithPublishedFlag::factory()->create([ 'is_published' => true, ]); diff --git a/tests/Unit/Traits/Classic/HasVerifiedAtHelpersTest.php b/tests/Unit/Traits/Classic/HasVerifiedAtHelpersTest.php index 96fcf5c..7873e1c 100644 --- a/tests/Unit/Traits/Classic/HasVerifiedAtHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasVerifiedAtHelpersTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithVerifiedAt; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithVerifiedAt; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; @@ -23,7 +23,7 @@ final class HasVerifiedAtHelpersTest extends TestCase /** @test */ public function it_casts_verified_at_to_datetime(): void { - $entity = factory(EntityWithVerifiedAt::class)->create([ + $entity = EntityWithVerifiedAt::factory()->create([ 'verified_at' => '1986-03-28 00:00:00', ]); @@ -34,11 +34,11 @@ public function it_casts_verified_at_to_datetime(): void /** @test */ public function it_can_check_if_entity_is_verified(): void { - $verifiedEntity = factory(EntityWithVerifiedAt::class)->create([ + $verifiedEntity = EntityWithVerifiedAt::factory()->create([ 'verified_at' => Date::now(), ]); - $unverifiedEntity = factory(EntityWithVerifiedAt::class)->create([ + $unverifiedEntity = EntityWithVerifiedAt::factory()->create([ 'verified_at' => null, ]); @@ -49,11 +49,11 @@ public function it_can_check_if_entity_is_verified(): void /** @test */ public function it_can_check_if_entity_is_not_verified(): void { - $verifiedEntity = factory(EntityWithVerifiedAt::class)->create([ + $verifiedEntity = EntityWithVerifiedAt::factory()->create([ 'verified_at' => Date::now(), ]); - $unverifiedEntity = factory(EntityWithVerifiedAt::class)->create([ + $unverifiedEntity = EntityWithVerifiedAt::factory()->create([ 'verified_at' => null, ]); @@ -64,7 +64,7 @@ public function it_can_check_if_entity_is_not_verified(): void /** @test */ public function it_can_verify(): void { - $entity = factory(EntityWithVerifiedAt::class)->create([ + $entity = EntityWithVerifiedAt::factory()->create([ 'verified_at' => null, ]); @@ -76,7 +76,7 @@ public function it_can_verify(): void /** @test */ public function it_can_undo_verify(): void { - $entity = factory(EntityWithVerifiedAt::class)->create([ + $entity = EntityWithVerifiedAt::factory()->create([ 'verified_at' => Date::now(), ]); diff --git a/tests/Unit/Traits/Classic/HasVerifiedFlagHelpersTest.php b/tests/Unit/Traits/Classic/HasVerifiedFlagHelpersTest.php index 9c67923..da7e8f7 100644 --- a/tests/Unit/Traits/Classic/HasVerifiedFlagHelpersTest.php +++ b/tests/Unit/Traits/Classic/HasVerifiedFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Classic; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Classic; -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithVerifiedFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithVerifiedFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasVerifiedFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_verified_to_boolean(): void { - $entity = factory(EntityWithVerifiedFlag::class)->create([ + $entity = EntityWithVerifiedFlag::factory()->create([ 'is_verified' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_verified_to_boolean(): void /** @test */ public function it_not_casts_is_verified_to_boolean(): void { - $entity = factory(EntityWithVerifiedFlag::class)->make([ + $entity = EntityWithVerifiedFlag::factory()->make([ 'is_verified' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_verified_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_verified(): void { - $verifiedEntity = factory(EntityWithVerifiedFlag::class)->create([ + $verifiedEntity = EntityWithVerifiedFlag::factory()->create([ 'is_verified' => true, ]); - $unverifiedEntity = factory(EntityWithVerifiedFlag::class)->create([ + $unverifiedEntity = EntityWithVerifiedFlag::factory()->create([ 'is_verified' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_verified(): void /** @test */ public function it_can_check_if_entity_is_not_verified(): void { - $verifiedEntity = factory(EntityWithVerifiedFlag::class)->create([ + $verifiedEntity = EntityWithVerifiedFlag::factory()->create([ 'is_verified' => true, ]); - $unverifiedEntity = factory(EntityWithVerifiedFlag::class)->create([ + $unverifiedEntity = EntityWithVerifiedFlag::factory()->create([ 'is_verified' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_verified(): void /** @test */ public function it_can_verify(): void { - $entity = factory(EntityWithVerifiedFlag::class)->create([ + $entity = EntityWithVerifiedFlag::factory()->create([ 'is_verified' => false, ]); @@ -83,7 +83,7 @@ public function it_can_verify(): void /** @test */ public function it_can_undo_verify(): void { - $entity = factory(EntityWithVerifiedFlag::class)->create([ + $entity = EntityWithVerifiedFlag::factory()->create([ 'is_verified' => true, ]); diff --git a/tests/Unit/Traits/Inverse/HasArchivedAtHelpersTest.php b/tests/Unit/Traits/Inverse/HasArchivedAtHelpersTest.php index 8255823..027d373 100644 --- a/tests/Unit/Traits/Inverse/HasArchivedAtHelpersTest.php +++ b/tests/Unit/Traits/Inverse/HasArchivedAtHelpersTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithArchivedAt; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithArchivedAt; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; @@ -23,7 +23,7 @@ final class HasArchivedAtHelpersTest extends TestCase /** @test */ public function it_casts_archived_at_to_datetime(): void { - $entity = factory(EntityWithArchivedAt::class)->create([ + $entity = EntityWithArchivedAt::factory()->create([ 'archived_at' => '1986-03-28 00:00:00', ]); @@ -34,11 +34,11 @@ public function it_casts_archived_at_to_datetime(): void /** @test */ public function it_can_check_if_entity_is_archived(): void { - $archivedEntity = factory(EntityWithArchivedAt::class)->create([ + $archivedEntity = EntityWithArchivedAt::factory()->create([ 'archived_at' => Date::now(), ]); - $unarchivedEntity = factory(EntityWithArchivedAt::class)->create([ + $unarchivedEntity = EntityWithArchivedAt::factory()->create([ 'archived_at' => null, ]); @@ -49,11 +49,11 @@ public function it_can_check_if_entity_is_archived(): void /** @test */ public function it_can_check_if_entity_is_not_archived(): void { - $archivedEntity = factory(EntityWithArchivedAt::class)->create([ + $archivedEntity = EntityWithArchivedAt::factory()->create([ 'archived_at' => Date::now(), ]); - $unarchivedEntity = factory(EntityWithArchivedAt::class)->create([ + $unarchivedEntity = EntityWithArchivedAt::factory()->create([ 'archived_at' => null, ]); @@ -64,7 +64,7 @@ public function it_can_check_if_entity_is_not_archived(): void /** @test */ public function it_can_archive(): void { - $entity = factory(EntityWithArchivedAt::class)->create([ + $entity = EntityWithArchivedAt::factory()->create([ 'archived_at' => null, ]); @@ -76,7 +76,7 @@ public function it_can_archive(): void /** @test */ public function it_can_undo_archive(): void { - $entity = factory(EntityWithArchivedAt::class)->create([ + $entity = EntityWithArchivedAt::factory()->create([ 'archived_at' => Date::now(), ]); diff --git a/tests/Unit/Traits/Inverse/HasArchivedFlagHelpersTest.php b/tests/Unit/Traits/Inverse/HasArchivedFlagHelpersTest.php index 8f795d2..034aa7f 100644 --- a/tests/Unit/Traits/Inverse/HasArchivedFlagHelpersTest.php +++ b/tests/Unit/Traits/Inverse/HasArchivedFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithArchivedFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithArchivedFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasArchivedFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_archived_to_boolean(): void { - $entity = factory(EntityWithArchivedFlag::class)->create([ + $entity = EntityWithArchivedFlag::factory()->create([ 'is_archived' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_archived_to_boolean(): void /** @test */ public function it_not_casts_is_archived_to_boolean(): void { - $entity = factory(EntityWithArchivedFlag::class)->make([ + $entity = EntityWithArchivedFlag::factory()->make([ 'is_archived' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_archived_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_archived(): void { - $archivedEntity = factory(EntityWithArchivedFlag::class)->create([ + $archivedEntity = EntityWithArchivedFlag::factory()->create([ 'is_archived' => true, ]); - $unarchivedEntity = factory(EntityWithArchivedFlag::class)->create([ + $unarchivedEntity = EntityWithArchivedFlag::factory()->create([ 'is_archived' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_archived(): void /** @test */ public function it_can_check_if_entity_is_not_archived(): void { - $archivedEntity = factory(EntityWithArchivedFlag::class)->create([ + $archivedEntity = EntityWithArchivedFlag::factory()->create([ 'is_archived' => true, ]); - $unarchivedEntity = factory(EntityWithArchivedFlag::class)->create([ + $unarchivedEntity = EntityWithArchivedFlag::factory()->create([ 'is_archived' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_archived(): void /** @test */ public function it_can_archive(): void { - $entity = factory(EntityWithArchivedFlag::class)->create([ + $entity = EntityWithArchivedFlag::factory()->create([ 'is_archived' => false, ]); @@ -83,7 +83,7 @@ public function it_can_archive(): void /** @test */ public function it_can_undo_archive(): void { - $entity = factory(EntityWithArchivedFlag::class)->create([ + $entity = EntityWithArchivedFlag::factory()->create([ 'is_archived' => true, ]); diff --git a/tests/Unit/Traits/Inverse/HasClosedAtHelpersTest.php b/tests/Unit/Traits/Inverse/HasClosedAtHelpersTest.php index de04bb9..77df7ee 100644 --- a/tests/Unit/Traits/Inverse/HasClosedAtHelpersTest.php +++ b/tests/Unit/Traits/Inverse/HasClosedAtHelpersTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithClosedAt; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithClosedAt; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; @@ -23,7 +23,7 @@ final class HasClosedAtHelpersTest extends TestCase /** @test */ public function it_casts_closed_at_to_datetime(): void { - $entity = factory(EntityWithClosedAt::class)->create([ + $entity = EntityWithClosedAt::factory()->create([ 'closed_at' => '1986-03-28 00:00:00', ]); @@ -34,11 +34,11 @@ public function it_casts_closed_at_to_datetime(): void /** @test */ public function it_can_check_if_entity_is_closed(): void { - $closedEntity = factory(EntityWithClosedAt::class)->create([ + $closedEntity = EntityWithClosedAt::factory()->create([ 'closed_at' => Date::now(), ]); - $openedEntity = factory(EntityWithClosedAt::class)->create([ + $openedEntity = EntityWithClosedAt::factory()->create([ 'closed_at' => null, ]); @@ -49,11 +49,11 @@ public function it_can_check_if_entity_is_closed(): void /** @test */ public function it_can_check_if_entity_is_not_closed(): void { - $closedEntity = factory(EntityWithClosedAt::class)->create([ + $closedEntity = EntityWithClosedAt::factory()->create([ 'closed_at' => Date::now(), ]); - $openedEntity = factory(EntityWithClosedAt::class)->create([ + $openedEntity = EntityWithClosedAt::factory()->create([ 'closed_at' => null, ]); @@ -64,7 +64,7 @@ public function it_can_check_if_entity_is_not_closed(): void /** @test */ public function it_can_close(): void { - $entity = factory(EntityWithClosedAt::class)->create([ + $entity = EntityWithClosedAt::factory()->create([ 'closed_at' => null, ]); @@ -76,7 +76,7 @@ public function it_can_close(): void /** @test */ public function it_can_undo_close(): void { - $entity = factory(EntityWithClosedAt::class)->create([ + $entity = EntityWithClosedAt::factory()->create([ 'closed_at' => Date::now(), ]); diff --git a/tests/Unit/Traits/Inverse/HasClosedFlagHelpersTest.php b/tests/Unit/Traits/Inverse/HasClosedFlagHelpersTest.php index 05ed8e7..3df781c 100644 --- a/tests/Unit/Traits/Inverse/HasClosedFlagHelpersTest.php +++ b/tests/Unit/Traits/Inverse/HasClosedFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithClosedFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithClosedFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasClosedFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_closed_to_boolean(): void { - $entity = factory(EntityWithClosedFlag::class)->create([ + $entity = EntityWithClosedFlag::factory()->create([ 'is_closed' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_closed_to_boolean(): void /** @test */ public function it_not_casts_is_closed_to_boolean(): void { - $entity = factory(EntityWithClosedFlag::class)->make([ + $entity = EntityWithClosedFlag::factory()->make([ 'is_closed' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_closed_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_closed(): void { - $closedEntity = factory(EntityWithClosedFlag::class)->create([ + $closedEntity = EntityWithClosedFlag::factory()->create([ 'is_closed' => true, ]); - $openedEntity = factory(EntityWithClosedFlag::class)->create([ + $openedEntity = EntityWithClosedFlag::factory()->create([ 'is_closed' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_closed(): void /** @test */ public function it_can_check_if_entity_is_not_closed(): void { - $closedEntity = factory(EntityWithClosedFlag::class)->create([ + $closedEntity = EntityWithClosedFlag::factory()->create([ 'is_closed' => true, ]); - $openedEntity = factory(EntityWithClosedFlag::class)->create([ + $openedEntity = EntityWithClosedFlag::factory()->create([ 'is_closed' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_closed(): void /** @test */ public function it_can_close(): void { - $entity = factory(EntityWithClosedFlag::class)->create([ + $entity = EntityWithClosedFlag::factory()->create([ 'is_closed' => false, ]); @@ -83,7 +83,7 @@ public function it_can_close(): void /** @test */ public function it_can_undo_close(): void { - $entity = factory(EntityWithClosedFlag::class)->create([ + $entity = EntityWithClosedFlag::factory()->create([ 'is_closed' => true, ]); diff --git a/tests/Unit/Traits/Inverse/HasDraftedAtHelpersTest.php b/tests/Unit/Traits/Inverse/HasDraftedAtHelpersTest.php index 7c268f5..0ff259b 100644 --- a/tests/Unit/Traits/Inverse/HasDraftedAtHelpersTest.php +++ b/tests/Unit/Traits/Inverse/HasDraftedAtHelpersTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithDraftedAt; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithDraftedAt; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; @@ -23,7 +23,7 @@ final class HasDraftedAtHelpersTest extends TestCase /** @test */ public function it_casts_drafted_at_to_datetime(): void { - $entity = factory(EntityWithDraftedAt::class)->create([ + $entity = EntityWithDraftedAt::factory()->create([ 'drafted_at' => '1986-03-28 00:00:00', ]); @@ -34,11 +34,11 @@ public function it_casts_drafted_at_to_datetime(): void /** @test */ public function it_can_check_if_entity_is_drafted(): void { - $draftedEntity = factory(EntityWithDraftedAt::class)->create([ + $draftedEntity = EntityWithDraftedAt::factory()->create([ 'drafted_at' => Date::now(), ]); - $undraftedEntity = factory(EntityWithDraftedAt::class)->create([ + $undraftedEntity = EntityWithDraftedAt::factory()->create([ 'drafted_at' => null, ]); @@ -49,11 +49,11 @@ public function it_can_check_if_entity_is_drafted(): void /** @test */ public function it_can_check_if_entity_is_not_drafted(): void { - $draftedEntity = factory(EntityWithDraftedAt::class)->create([ + $draftedEntity = EntityWithDraftedAt::factory()->create([ 'drafted_at' => Date::now(), ]); - $undraftedEntity = factory(EntityWithDraftedAt::class)->create([ + $undraftedEntity = EntityWithDraftedAt::factory()->create([ 'drafted_at' => null, ]); @@ -64,7 +64,7 @@ public function it_can_check_if_entity_is_not_drafted(): void /** @test */ public function it_can_draft(): void { - $entity = factory(EntityWithDraftedAt::class)->create([ + $entity = EntityWithDraftedAt::factory()->create([ 'drafted_at' => null, ]); @@ -76,7 +76,7 @@ public function it_can_draft(): void /** @test */ public function it_can_undo_draft(): void { - $entity = factory(EntityWithDraftedAt::class)->create([ + $entity = EntityWithDraftedAt::factory()->create([ 'drafted_at' => Date::now(), ]); diff --git a/tests/Unit/Traits/Inverse/HasDraftedFlagHelpersTest.php b/tests/Unit/Traits/Inverse/HasDraftedFlagHelpersTest.php index 15329be..9ab5569 100644 --- a/tests/Unit/Traits/Inverse/HasDraftedFlagHelpersTest.php +++ b/tests/Unit/Traits/Inverse/HasDraftedFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithDraftedFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithDraftedFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasDraftedFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_drafted_to_boolean(): void { - $entity = factory(EntityWithDraftedFlag::class)->create([ + $entity = EntityWithDraftedFlag::factory()->create([ 'is_drafted' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_drafted_to_boolean(): void /** @test */ public function it_not_casts_is_drafted_to_boolean(): void { - $entity = factory(EntityWithDraftedFlag::class)->make([ + $entity = EntityWithDraftedFlag::factory()->make([ 'is_drafted' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_drafted_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_drafted(): void { - $draftedEntity = factory(EntityWithDraftedFlag::class)->create([ + $draftedEntity = EntityWithDraftedFlag::factory()->create([ 'is_drafted' => true, ]); - $undraftedEntity = factory(EntityWithDraftedFlag::class)->create([ + $undraftedEntity = EntityWithDraftedFlag::factory()->create([ 'is_drafted' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_drafted(): void /** @test */ public function it_can_check_if_entity_is_not_drafted(): void { - $draftedEntity = factory(EntityWithDraftedFlag::class)->create([ + $draftedEntity = EntityWithDraftedFlag::factory()->create([ 'is_drafted' => true, ]); - $undraftedEntity = factory(EntityWithDraftedFlag::class)->create([ + $undraftedEntity = EntityWithDraftedFlag::factory()->create([ 'is_drafted' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_drafted(): void /** @test */ public function it_can_draft(): void { - $entity = factory(EntityWithDraftedFlag::class)->create([ + $entity = EntityWithDraftedFlag::factory()->create([ 'is_drafted' => false, ]); @@ -83,7 +83,7 @@ public function it_can_draft(): void /** @test */ public function it_can_undo_draft(): void { - $entity = factory(EntityWithDraftedFlag::class)->create([ + $entity = EntityWithDraftedFlag::factory()->create([ 'is_drafted' => true, ]); diff --git a/tests/Unit/Traits/Inverse/HasEndedAtHelpersTest.php b/tests/Unit/Traits/Inverse/HasEndedAtHelpersTest.php index 1fad80e..9e976d6 100644 --- a/tests/Unit/Traits/Inverse/HasEndedAtHelpersTest.php +++ b/tests/Unit/Traits/Inverse/HasEndedAtHelpersTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithEndedAt; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithEndedAt; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; @@ -23,7 +23,7 @@ final class HasEndedAtHelpersTest extends TestCase /** @test */ public function it_casts_ended_at_to_datetime(): void { - $entity = factory(EntityWithEndedAt::class)->create([ + $entity = EntityWithEndedAt::factory()->create([ 'ended_at' => '1986-03-28 00:00:00', ]); @@ -34,11 +34,11 @@ public function it_casts_ended_at_to_datetime(): void /** @test */ public function it_can_check_if_entity_is_ended(): void { - $endedEntity = factory(EntityWithEndedAt::class)->create([ + $endedEntity = EntityWithEndedAt::factory()->create([ 'ended_at' => Date::now(), ]); - $unendedEntity = factory(EntityWithEndedAt::class)->create([ + $unendedEntity = EntityWithEndedAt::factory()->create([ 'ended_at' => null, ]); @@ -49,11 +49,11 @@ public function it_can_check_if_entity_is_ended(): void /** @test */ public function it_can_check_if_entity_is_not_ended(): void { - $endedEntity = factory(EntityWithEndedAt::class)->create([ + $endedEntity = EntityWithEndedAt::factory()->create([ 'ended_at' => Date::now(), ]); - $unendedEntity = factory(EntityWithEndedAt::class)->create([ + $unendedEntity = EntityWithEndedAt::factory()->create([ 'ended_at' => null, ]); @@ -64,7 +64,7 @@ public function it_can_check_if_entity_is_not_ended(): void /** @test */ public function it_can_end(): void { - $entity = factory(EntityWithEndedAt::class)->create([ + $entity = EntityWithEndedAt::factory()->create([ 'ended_at' => null, ]); @@ -76,7 +76,7 @@ public function it_can_end(): void /** @test */ public function it_can_undo_end(): void { - $entity = factory(EntityWithEndedAt::class)->create([ + $entity = EntityWithEndedAt::factory()->create([ 'ended_at' => Date::now(), ]); diff --git a/tests/Unit/Traits/Inverse/HasEndedFlagHelpersTest.php b/tests/Unit/Traits/Inverse/HasEndedFlagHelpersTest.php index 795fd41..c9b6e1e 100644 --- a/tests/Unit/Traits/Inverse/HasEndedFlagHelpersTest.php +++ b/tests/Unit/Traits/Inverse/HasEndedFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithEndedFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithEndedFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasEndedFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_ended_to_boolean(): void { - $entity = factory(EntityWithEndedFlag::class)->create([ + $entity = EntityWithEndedFlag::factory()->create([ 'is_ended' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_ended_to_boolean(): void /** @test */ public function it_not_casts_is_ended_to_boolean(): void { - $entity = factory(EntityWithEndedFlag::class)->make([ + $entity = EntityWithEndedFlag::factory()->make([ 'is_ended' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_ended_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_ended(): void { - $endedEntity = factory(EntityWithEndedFlag::class)->create([ + $endedEntity = EntityWithEndedFlag::factory()->create([ 'is_ended' => true, ]); - $unendedEntity = factory(EntityWithEndedFlag::class)->create([ + $unendedEntity = EntityWithEndedFlag::factory()->create([ 'is_ended' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_ended(): void /** @test */ public function it_can_check_if_entity_is_not_ended(): void { - $endedEntity = factory(EntityWithEndedFlag::class)->create([ + $endedEntity = EntityWithEndedFlag::factory()->create([ 'is_ended' => true, ]); - $unendedEntity = factory(EntityWithEndedFlag::class)->create([ + $unendedEntity = EntityWithEndedFlag::factory()->create([ 'is_ended' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_ended(): void /** @test */ public function it_can_end(): void { - $entity = factory(EntityWithEndedFlag::class)->create([ + $entity = EntityWithEndedFlag::factory()->create([ 'is_ended' => false, ]); @@ -83,7 +83,7 @@ public function it_can_end(): void /** @test */ public function it_can_undo_end(): void { - $entity = factory(EntityWithEndedFlag::class)->create([ + $entity = EntityWithEndedFlag::factory()->create([ 'is_ended' => true, ]); diff --git a/tests/Unit/Traits/Inverse/HasExpiredAtHelpersTest.php b/tests/Unit/Traits/Inverse/HasExpiredAtHelpersTest.php index 9d1659f..9e54419 100644 --- a/tests/Unit/Traits/Inverse/HasExpiredAtHelpersTest.php +++ b/tests/Unit/Traits/Inverse/HasExpiredAtHelpersTest.php @@ -11,10 +11,10 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithExpiredAt; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithExpiredAt; +use Cog\Tests\Laravel\Flag\TestCase; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Date; @@ -23,7 +23,7 @@ final class HasExpiredAtHelpersTest extends TestCase /** @test */ public function it_casts_expired_at_to_datetime(): void { - $entity = factory(EntityWithExpiredAt::class)->create([ + $entity = EntityWithExpiredAt::factory()->create([ 'expired_at' => '1986-03-28 00:00:00', ]); @@ -34,11 +34,11 @@ public function it_casts_expired_at_to_datetime(): void /** @test */ public function it_can_check_if_entity_is_expired(): void { - $expiredEntity = factory(EntityWithExpiredAt::class)->create([ + $expiredEntity = EntityWithExpiredAt::factory()->create([ 'expired_at' => Date::now(), ]); - $unexpiredEntity = factory(EntityWithExpiredAt::class)->create([ + $unexpiredEntity = EntityWithExpiredAt::factory()->create([ 'expired_at' => null, ]); @@ -49,11 +49,11 @@ public function it_can_check_if_entity_is_expired(): void /** @test */ public function it_can_check_if_entity_is_not_expired(): void { - $expiredEntity = factory(EntityWithExpiredAt::class)->create([ + $expiredEntity = EntityWithExpiredAt::factory()->create([ 'expired_at' => Date::now(), ]); - $unexpiredEntity = factory(EntityWithExpiredAt::class)->create([ + $unexpiredEntity = EntityWithExpiredAt::factory()->create([ 'expired_at' => null, ]); @@ -64,7 +64,7 @@ public function it_can_check_if_entity_is_not_expired(): void /** @test */ public function it_can_expire(): void { - $entity = factory(EntityWithExpiredAt::class)->create([ + $entity = EntityWithExpiredAt::factory()->create([ 'expired_at' => null, ]); @@ -76,7 +76,7 @@ public function it_can_expire(): void /** @test */ public function it_can_undo_expire(): void { - $entity = factory(EntityWithExpiredAt::class)->create([ + $entity = EntityWithExpiredAt::factory()->create([ 'expired_at' => Date::now(), ]); diff --git a/tests/Unit/Traits/Inverse/HasExpiredFlagHelpersTest.php b/tests/Unit/Traits/Inverse/HasExpiredFlagHelpersTest.php index 6a0e911..fc56348 100644 --- a/tests/Unit/Traits/Inverse/HasExpiredFlagHelpersTest.php +++ b/tests/Unit/Traits/Inverse/HasExpiredFlagHelpersTest.php @@ -11,17 +11,17 @@ declare(strict_types=1); -namespace Cog\Tests\Flag\Unit\Traits\Inverse; +namespace Cog\Tests\Laravel\Flag\Unit\Traits\Inverse; -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithExpiredFlag; -use Cog\Tests\Flag\TestCase; +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithExpiredFlag; +use Cog\Tests\Laravel\Flag\TestCase; final class HasExpiredFlagHelpersTest extends TestCase { /** @test */ public function it_casts_is_expired_to_boolean(): void { - $entity = factory(EntityWithExpiredFlag::class)->create([ + $entity = EntityWithExpiredFlag::factory()->create([ 'is_expired' => 1, ]); @@ -31,7 +31,7 @@ public function it_casts_is_expired_to_boolean(): void /** @test */ public function it_not_casts_is_expired_to_boolean(): void { - $entity = factory(EntityWithExpiredFlag::class)->make([ + $entity = EntityWithExpiredFlag::factory()->make([ 'is_expired' => null, ]); @@ -41,11 +41,11 @@ public function it_not_casts_is_expired_to_boolean(): void /** @test */ public function it_can_check_if_entity_is_expired(): void { - $expiredEntity = factory(EntityWithExpiredFlag::class)->create([ + $expiredEntity = EntityWithExpiredFlag::factory()->create([ 'is_expired' => true, ]); - $unexpiredEntity = factory(EntityWithExpiredFlag::class)->create([ + $unexpiredEntity = EntityWithExpiredFlag::factory()->create([ 'is_expired' => false, ]); @@ -56,11 +56,11 @@ public function it_can_check_if_entity_is_expired(): void /** @test */ public function it_can_check_if_entity_is_not_expired(): void { - $expiredEntity = factory(EntityWithExpiredFlag::class)->create([ + $expiredEntity = EntityWithExpiredFlag::factory()->create([ 'is_expired' => true, ]); - $unexpiredEntity = factory(EntityWithExpiredFlag::class)->create([ + $unexpiredEntity = EntityWithExpiredFlag::factory()->create([ 'is_expired' => false, ]); @@ -71,7 +71,7 @@ public function it_can_check_if_entity_is_not_expired(): void /** @test */ public function it_can_expire(): void { - $entity = factory(EntityWithExpiredFlag::class)->create([ + $entity = EntityWithExpiredFlag::factory()->create([ 'is_expired' => false, ]); @@ -83,7 +83,7 @@ public function it_can_expire(): void /** @test */ public function it_can_undo_expire(): void { - $entity = factory(EntityWithExpiredFlag::class)->create([ + $entity = EntityWithExpiredFlag::factory()->create([ 'is_expired' => true, ]); diff --git a/tests/database/factories/EntityWithAcceptedAtFactory.php b/tests/database/factories/EntityWithAcceptedAtFactory.php index a1a9d40..edf5c84 100644 --- a/tests/database/factories/EntityWithAcceptedAtFactory.php +++ b/tests/database/factories/EntityWithAcceptedAtFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedAt; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithAcceptedAt::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'accepted_at' => null, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithAcceptedAt; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithAcceptedAtFactory extends Factory +{ + protected $model = EntityWithAcceptedAt::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'accepted_at' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithAcceptedFlagFactory.php b/tests/database/factories/EntityWithAcceptedFlagFactory.php index cfd2d55..0ed59f0 100644 --- a/tests/database/factories/EntityWithAcceptedFlagFactory.php +++ b/tests/database/factories/EntityWithAcceptedFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithAcceptedFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithAcceptedFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_accepted' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithAcceptedFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithAcceptedFlagFactory extends Factory +{ + protected $model = EntityWithAcceptedFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_accepted' => false, + ]; + } +} diff --git a/tests/database/factories/EntityWithActiveFlagFactory.php b/tests/database/factories/EntityWithActiveFlagFactory.php index d5e0e7d..fb86d18 100644 --- a/tests/database/factories/EntityWithActiveFlagFactory.php +++ b/tests/database/factories/EntityWithActiveFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithActiveFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithActiveFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_active' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithActiveFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithActiveFlagFactory extends Factory +{ + protected $model = EntityWithActiveFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_active' => false, + ]; + } +} diff --git a/tests/database/factories/EntityWithApprovedAtFactory.php b/tests/database/factories/EntityWithApprovedAtFactory.php index 34f3b42..6782d08 100644 --- a/tests/database/factories/EntityWithApprovedAtFactory.php +++ b/tests/database/factories/EntityWithApprovedAtFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithApprovedAt; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithApprovedAt::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'approved_at' => null, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithApprovedAt; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithApprovedAtFactory extends Factory +{ + protected $model = EntityWithApprovedAt::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'approved_at' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithApprovedFlagFactory.php b/tests/database/factories/EntityWithApprovedFlagFactory.php index 5bc62a6..f681bb3 100644 --- a/tests/database/factories/EntityWithApprovedFlagFactory.php +++ b/tests/database/factories/EntityWithApprovedFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithApprovedFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithApprovedFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_approved' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithApprovedFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithApprovedFlagFactory extends Factory +{ + protected $model = EntityWithApprovedFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_approved' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithArchivedAtFactory.php b/tests/database/factories/EntityWithArchivedAtFactory.php index b69d130..0493462 100644 --- a/tests/database/factories/EntityWithArchivedAtFactory.php +++ b/tests/database/factories/EntityWithArchivedAtFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithArchivedAt; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithArchivedAt::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'archived_at' => null, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithArchivedAt; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithArchivedAtFactory extends Factory +{ + protected $model = EntityWithArchivedAt::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'archived_at' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithArchivedFlagFactory.php b/tests/database/factories/EntityWithArchivedFlagFactory.php index 5dd58f8..766f20b 100644 --- a/tests/database/factories/EntityWithArchivedFlagFactory.php +++ b/tests/database/factories/EntityWithArchivedFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithArchivedFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithArchivedFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_archived' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithArchivedFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithArchivedFlagFactory extends Factory +{ + protected $model = EntityWithArchivedFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_archived' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithClosedAtFactory.php b/tests/database/factories/EntityWithClosedAtFactory.php index e096fd7..a359f7b 100644 --- a/tests/database/factories/EntityWithClosedAtFactory.php +++ b/tests/database/factories/EntityWithClosedAtFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithClosedAt; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithClosedAt::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'closed_at' => null, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithClosedAt; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithClosedAtFactory extends Factory +{ + protected $model = EntityWithClosedAt::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'closed_at' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithClosedFlagFactory.php b/tests/database/factories/EntityWithClosedFlagFactory.php index d77d25d..461e069 100644 --- a/tests/database/factories/EntityWithClosedFlagFactory.php +++ b/tests/database/factories/EntityWithClosedFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithClosedFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithClosedFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_closed' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithClosedFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithClosedFlagFactory extends Factory +{ + protected $model = EntityWithClosedFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_closed' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithDraftedAtFactory.php b/tests/database/factories/EntityWithDraftedAtFactory.php index d3fb23b..829fd81 100644 --- a/tests/database/factories/EntityWithDraftedAtFactory.php +++ b/tests/database/factories/EntityWithDraftedAtFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithDraftedAt; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithDraftedAt::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'drafted_at' => null, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithDraftedAt; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithDraftedAtFactory extends Factory +{ + protected $model = EntityWithDraftedAt::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'drafted_at' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithDraftedFlagFactory.php b/tests/database/factories/EntityWithDraftedFlagFactory.php index bcb85e1..fda8096 100644 --- a/tests/database/factories/EntityWithDraftedFlagFactory.php +++ b/tests/database/factories/EntityWithDraftedFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithDraftedFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithDraftedFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_drafted' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithDraftedFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithDraftedFlagFactory extends Factory +{ + protected $model = EntityWithDraftedFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_drafted' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithEndedAtFactory.php b/tests/database/factories/EntityWithEndedAtFactory.php index 9b9b147..60c7fcd 100644 --- a/tests/database/factories/EntityWithEndedAtFactory.php +++ b/tests/database/factories/EntityWithEndedAtFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithEndedAt; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithEndedAt::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'ended_at' => null, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithEndedAt; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithEndedAtFactory extends Factory +{ + protected $model = EntityWithEndedAt::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'ended_at' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithEndedFlagFactory.php b/tests/database/factories/EntityWithEndedFlagFactory.php index e7ddca3..f47dc34 100644 --- a/tests/database/factories/EntityWithEndedFlagFactory.php +++ b/tests/database/factories/EntityWithEndedFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithEndedFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithEndedFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_ended' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithEndedFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithEndedFlagFactory extends Factory +{ + protected $model = EntityWithEndedFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_ended' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithExpiredAtFactory.php b/tests/database/factories/EntityWithExpiredAtFactory.php index 48c0acf..14c3296 100644 --- a/tests/database/factories/EntityWithExpiredAtFactory.php +++ b/tests/database/factories/EntityWithExpiredAtFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithExpiredAt; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithExpiredAt::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'expired_at' => null, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithExpiredAt; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithExpiredAtFactory extends Factory +{ + protected $model = EntityWithExpiredAt::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'expired_at' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithExpiredFlagFactory.php b/tests/database/factories/EntityWithExpiredFlagFactory.php index b4d4dd1..cbce4a7 100644 --- a/tests/database/factories/EntityWithExpiredFlagFactory.php +++ b/tests/database/factories/EntityWithExpiredFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Inverse\EntityWithExpiredFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithExpiredFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_expired' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Inverse\EntityWithExpiredFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithExpiredFlagFactory extends Factory +{ + protected $model = EntityWithExpiredFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_expired' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithInvitedAtFactory.php b/tests/database/factories/EntityWithInvitedAtFactory.php index 10559c4..98c7033 100644 --- a/tests/database/factories/EntityWithInvitedAtFactory.php +++ b/tests/database/factories/EntityWithInvitedAtFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithInvitedAt; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithInvitedAt::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'invited_at' => null, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithInvitedAt; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithInvitedAtFactory extends Factory +{ + protected $model = EntityWithInvitedAt::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'invited_at' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithInvitedFlagFactory.php b/tests/database/factories/EntityWithInvitedFlagFactory.php index dcf7b13..96f7c45 100644 --- a/tests/database/factories/EntityWithInvitedFlagFactory.php +++ b/tests/database/factories/EntityWithInvitedFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithInvitedFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithInvitedFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_invited' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithInvitedFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithInvitedFlagFactory extends Factory +{ + protected $model = EntityWithInvitedFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_invited' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithKeptFlagFactory.php b/tests/database/factories/EntityWithKeptFlagFactory.php index 2b8fa05..44a3489 100644 --- a/tests/database/factories/EntityWithKeptFlagFactory.php +++ b/tests/database/factories/EntityWithKeptFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithKeptFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithKeptFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_kept' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithKeptFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithKeptFlagFactory extends Factory +{ + protected $model = EntityWithKeptFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_kept' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithPublishedAtFactory.php b/tests/database/factories/EntityWithPublishedAtFactory.php index db27606..087c4ca 100644 --- a/tests/database/factories/EntityWithPublishedAtFactory.php +++ b/tests/database/factories/EntityWithPublishedAtFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithPublishedAt; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithPublishedAt::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'published_at' => null, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithPublishedAt; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithPublishedAtFactory extends Factory +{ + protected $model = EntityWithPublishedAt::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'published_at' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithPublishedFlagFactory.php b/tests/database/factories/EntityWithPublishedFlagFactory.php index 6fdcd48..14ae7ba 100644 --- a/tests/database/factories/EntityWithPublishedFlagFactory.php +++ b/tests/database/factories/EntityWithPublishedFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithPublishedFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithPublishedFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_published' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithPublishedFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithPublishedFlagFactory extends Factory +{ + protected $model = EntityWithPublishedFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_published' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithVerifiedAtFactory.php b/tests/database/factories/EntityWithVerifiedAtFactory.php index 967c9d1..43e0fea 100644 --- a/tests/database/factories/EntityWithVerifiedAtFactory.php +++ b/tests/database/factories/EntityWithVerifiedAtFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithVerifiedAt; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithVerifiedAt::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'verified_at' => null, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithVerifiedAt; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithVerifiedAtFactory extends Factory +{ + protected $model = EntityWithVerifiedAt::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'verified_at' => null, + ]; + } +} diff --git a/tests/database/factories/EntityWithVerifiedFlagFactory.php b/tests/database/factories/EntityWithVerifiedFlagFactory.php index 4eefef8..7a54f99 100644 --- a/tests/database/factories/EntityWithVerifiedFlagFactory.php +++ b/tests/database/factories/EntityWithVerifiedFlagFactory.php @@ -1,7 +1,7 @@ * @@ -11,13 +11,25 @@ declare(strict_types=1); -use Cog\Tests\Flag\Stubs\Models\Classic\EntityWithVerifiedFlag; -use Faker\Generator as Faker; +namespace Cog\Tests\Laravel\Flag\Database\Factories; -/* @var \Illuminate\Database\Eloquent\Factory $factory */ -$factory->define(EntityWithVerifiedFlag::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - 'is_verified' => false, - ]; -}); +use Cog\Tests\Laravel\Flag\Stubs\Models\Classic\EntityWithVerifiedFlag; +use Illuminate\Database\Eloquent\Factories\Factory; + +final class EntityWithVerifiedFlagFactory extends Factory +{ + protected $model = EntityWithVerifiedFlag::class; + + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->word(), + 'is_verified' => null, + ]; + } +}