Skip to content

Commit

Permalink
Remove Unnecessary Test testUniqueJobsAreNotDispatched()
Browse files Browse the repository at this point in the history
  • Loading branch information
Keller Martin committed Jun 18, 2024
1 parent d47ca8e commit 20f2993
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions tests/Integration/Queue/UniqueJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Bus;
use Orchestra\Testbench\Attributes\WithMigration;

#[WithMigration]
Expand All @@ -25,28 +24,6 @@ protected function defineEnvironment($app)
$app['config']->set('cache.default', 'database');
}

public function testUniqueJobsAreNotDispatched()
{
Bus::fake();

UniqueTestJob::dispatch();
$this->runQueueWorkerCommand(['--once' => true]);
Bus::assertDispatched(UniqueTestJob::class);

$this->assertFalse(
$this->app->get(Cache::class)->lock($this->getLockKey(UniqueTestJob::class), 10)->get()
);

Bus::assertDispatchedTimes(UniqueTestJob::class);
UniqueTestJob::dispatch();
$this->runQueueWorkerCommand(['--once' => true]);
Bus::assertDispatchedTimes(UniqueTestJob::class);

$this->assertFalse(
$this->app->get(Cache::class)->lock($this->getLockKey(UniqueTestJob::class), 10)->get()
);
}

public function testLockIsReleasedForSuccessfulJobs()
{
UniqueTestJob::$handled = false;
Expand Down

0 comments on commit 20f2993

Please sign in to comment.