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

Event assertListeners fails with dynamically registered invokable listeners #46652

Closed
calebdw opened this issue Mar 31, 2023 · 3 comments
Closed

Comments

@calebdw
Copy link
Contributor

calebdw commented Mar 31, 2023

  • Laravel Version: 9.52.4
  • PHP Version: 8.1.x
  • Database Driver & Version: Postgres 14

Description:

Hello!

I have turned on auto event/listener discovery and the actual code works fine. However, the tests fail when using assertListeners with dynamically registered invokable listeners, it appears they are expected to only have the handle method whereas both the handle and __invoke methods are supported by the autodiscovery.

E.g.,

    Event::assertListening(
        StationAssistanceRequested::class,
        CreateDemandWorkOrder::class, // has __invoke() method
    );
@github-actions
Copy link

github-actions bot commented Apr 3, 2023

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@cosmastech
Copy link
Contributor

@driesvints should this be marked as closed?

@driesvints
Copy link
Member

Yup, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants