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

Added methods to QueueFake to work with listeners #54056

Conversation

jeanlucnguyen
Copy link

This is a fix linked to this discussion: #47871

@crynobone
Copy link
Member

Mark as draft since test are failing

@crynobone crynobone marked this pull request as draft January 2, 2025 09:19
@jeanlucnguyen jeanlucnguyen force-pushed the bugfix/queue-fake-callqueuedlistener branch 5 times, most recently from c30b25e to 02ec4bb Compare January 3, 2025 07:03
@jeanlucnguyen
Copy link
Author

Eventually, I went another route, adding new methods to work with listener jobs.

QueueFake::assertListenerPushedTimes()
QueueFake::assertListenerPushedOn()
QueueFake::assertListenerNotPushed()
QueueFake::listenersPushed()
QueueFake::hasListenerPushed()

as I had some issues keeping backward compatibility when using closures.

@jeanlucnguyen jeanlucnguyen changed the title Fix QueueFake not working properly because listeners are wrapped in CallQueuedListener Added methods to QueueFake to work with listeners Jan 3, 2025
@jeanlucnguyen jeanlucnguyen marked this pull request as ready for review January 3, 2025 09:44
@jeanlucnguyen jeanlucnguyen force-pushed the bugfix/queue-fake-callqueuedlistener branch from 02ec4bb to fce015d Compare January 3, 2025 10:19
@taylorotwell
Copy link
Member

I feel like testing if a listener was pushed to the queue is like writing tests for the framework itself. If the interface is on the listener, it was pushed to the queue.

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.

3 participants