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

[6.x] Add assertion for empty job chain #31332

Merged
merged 1 commit into from
Feb 3, 2020
Merged

[6.x] Add assertion for empty job chain #31332

merged 1 commit into from
Feb 3, 2020

Conversation

iamgergo
Copy link
Contributor

@iamgergo iamgergo commented Feb 3, 2020

This PR introduces the assertPushedWithEmptyChain assertion.


I found myself to implement conditional job chaining:

MoveFile::withChain(
    $medium->isImage ? [new GenerateImages($medium)] : [],
)->dispatch($medium);

It's possible to pass an empty chain, but right now there is no way to test it.

The assertPushedWithChain does not accept an empty array for the expected chain and the assertPushed can't tell whether the chain is empty or not.


I'm not sure, this is the cleanest approach, I'm up to any idea.

@taylorotwell taylorotwell merged commit 6f8b87e into laravel:6.x Feb 3, 2020
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