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

[9.x] Allow assertions against pushed string based pushed jobs #42676

Merged
merged 1 commit into from
Jun 6, 2022

Conversation

timacdonald
Copy link
Member

This PR allows developers to make assertions against pushed queued job data, when the job is queued in the following manner...

Queue::push(MyJob::class, ['job' => 'data'], 'redis');

rather than pushing a job instance to the queue. The following test can now be created...

// setup...
Queue::fake();

// implementation...
Queue::push(MyJob::class, ['job' => 'data'], 'redis');

// assertions...
Queue::assertPushed(MyJob::class, function ($class, $queue, $data) {
    return $data === ['job' => 'data'];
});

@taylorotwell taylorotwell merged commit a7d1814 into laravel:9.x Jun 6, 2022
@timacdonald timacdonald deleted the assert-against-queue-data branch June 13, 2022 02:31
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.

2 participants