Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.x] ShouldBeUnique Does Not Universally Prevent Duplicates #51833

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove Unnecessary Test testUniqueJobsAreNotDispatched()
  • Loading branch information
Keller Martin committed Jun 18, 2024
commit 20f2993539e2ec66579e21dec6ef32f1d502f496
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