Skip to content

Commit

Permalink
Remove legacy factories (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkomarev authored Feb 25, 2023
1 parent 2720f08 commit e40a5d6
Show file tree
Hide file tree
Showing 136 changed files with 1,260 additions and 951 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">tests/</directory>
<exclude>tests/database/factories/</exclude>
</testsuite>
</testsuites>
<php>
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithAcceptedAt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/Models/Classic/EntityWithAcceptedAtApplied.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithAcceptedFlag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithActiveFlag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/Models/Classic/EntityWithActiveFlagApplied.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithApprovedAt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/Models/Classic/EntityWithApprovedAtApplied.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithApprovedFlag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithInvitedAt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/Models/Classic/EntityWithInvitedAtApplied.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithInvitedFlag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithKeptFlag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/Models/Classic/EntityWithKeptFlagApplied.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/Models/Classic/EntityWithKeptFlagUnapplied.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithPublishedAt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithPublishedFlag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion tests/Stubs/Models/Classic/EntityWithVerifiedAt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
Loading

0 comments on commit e40a5d6

Please sign in to comment.