From 00f8df98f9acd7f591be4e59e64c897dcf2b8493 Mon Sep 17 00:00:00 2001 From: iamgergo Date: Sat, 30 Jan 2021 22:05:08 +0100 Subject: [PATCH] fix test --- src/Console/Commands/InstallCommand.php | 2 +- tests/Feature/CommandsTest.php | 3 +++ tests/TestCase.php | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Console/Commands/InstallCommand.php b/src/Console/Commands/InstallCommand.php index 83a15e1e..bb77e3f2 100644 --- a/src/Console/Commands/InstallCommand.php +++ b/src/Console/Commands/InstallCommand.php @@ -31,7 +31,7 @@ public function handle(): int { $status = $this->call('migrate'); - if ($this->option('seed') && $this->laravel->environment('local')) { + if ($this->option('seed') && $this->laravel->environment(['local', 'testing'])) { $status = $this->call('db:seed', ['--class' => BazarSeeder::class]); } diff --git a/tests/Feature/CommandsTest.php b/tests/Feature/CommandsTest.php index 68af3184..1a873cc0 100644 --- a/tests/Feature/CommandsTest.php +++ b/tests/Feature/CommandsTest.php @@ -6,6 +6,7 @@ use Illuminate\Console\Command; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\App; +use Illuminate\Support\Facades\Queue; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Str; @@ -39,6 +40,8 @@ public function it_can_clear_chunks() /** @test */ public function it_can_install_bazar() { + Queue::fake(); + $this->artisan('bazar:install') ->assertExitCode(Command::SUCCESS); diff --git a/tests/TestCase.php b/tests/TestCase.php index 159ca5ac..40fbcad9 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -30,12 +30,12 @@ public function setUp(): void $this->registerPolicies(); $this->app['config']->set('auth.providers.users.model', User::class); - $this->app['config']->set('bazar.admins', ['admin@bazar.test']); + $this->app['config']->set('bazar.admins', ['test@bazar.test']); Storage::fake('local'); Storage::fake('public'); - $this->admin = UserFactory::new()->create(['email' => 'admin@bazar.test']); + $this->admin = UserFactory::new()->create(['email' => 'test@bazar.test']); $this->user = UserFactory::new()->create(); }