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

[11.x] Inverse Fake Queue Interactions: assertNotDeleted, assertNotFailed, and assertNotReleased #52320

Merged

Conversation

gdebrauwer
Copy link
Contributor

You can easily assert that a job has been deleted, failed, or released back onto the queue:

public function test_job_is_released(): void
{
    $job = (new TestJob)->withFakeQueueInteractions();

    $job->handle();

    $job->assertReleased();

    // $job->assertDeleted();
    // $job->assertFailed();
}

but there is currently no easy way to assert that the job was not deleted, failed, or released back onto the queue. This PR fixes that by adding extra methods for those assertions:

public function test_job_is_not_released(): void
{
    $job = (new TestJob)->withFakeQueueInteractions();

    $job->handle();

    $job->assertNotReleased();

    // $job->assertNotDeleted();
    // $job->assertNotFailed();
}

@taylorotwell taylorotwell merged commit 0ca8ad0 into laravel:11.x Aug 1, 2024
21 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants