From 0692cdc36a1150223783109c573927308fcc1d62 Mon Sep 17 00:00:00 2001 From: Abrar Ahmad Date: Wed, 29 Jun 2022 18:38:15 +0500 Subject: [PATCH] fixed `TestSeeder` class not resolved --- tests/DatabasePreparationTest.php | 18 +----------------- tests/Etc/TestSeeder.php | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 tests/Etc/TestSeeder.php diff --git a/tests/DatabasePreparationTest.php b/tests/DatabasePreparationTest.php index 66bd49b4..fa27a1c9 100644 --- a/tests/DatabasePreparationTest.php +++ b/tests/DatabasePreparationTest.php @@ -14,6 +14,7 @@ use Stancl\Tenancy\Jobs\SeedDatabase; use Stancl\Tenancy\TenantDatabaseManagers\MySQLDatabaseManager; use Stancl\Tenancy\Tests\Etc\Tenant; use Illuminate\Foundation\Auth\User as Authenticable; +use Stancl\Tenancy\Tests\Etc\TestSeeder; uses(Stancl\Tenancy\Tests\TestCase::class); @@ -93,23 +94,6 @@ class User extends Authenticable protected $guarded = []; } -class TestSeeder extends Seeder -{ - /** - * Run the database seeds. - * - * @return void - */ - public function run() - { - DB::table('users')->insert([ - 'name' => 'Seeded User', - 'email' => 'seeded@user', - 'password' => bcrypt('password'), - ]); - } -} - class CreateSuperuser { protected $tenant; diff --git a/tests/Etc/TestSeeder.php b/tests/Etc/TestSeeder.php new file mode 100644 index 00000000..55f1bc71 --- /dev/null +++ b/tests/Etc/TestSeeder.php @@ -0,0 +1,23 @@ +insert([ + 'name' => 'Seeded User', + 'email' => 'seeded@user', + 'password' => bcrypt('password'), + ]); + } +} \ No newline at end of file