Best way to test Event Listeners

Posted 3 years ago by NickGlenn

Hey guys,

I feel the title says it all, but regardless... I'm trying to figure out the best way to go about testing Event Listeners.

Using events has made integration testing a breeze since I can focus on only testing the actions that take place in the, well, controller action. However, I still want to ensure that I have complete test coverage against all aspects of my codebase, especially since several of these listeners are responsible for triggering billing systems and such.

My guess is likely just writing standard unit tests in PHPUnit, though I feel like this may look somewhat awkward as PHPUnit is also running my integration tests using the new syntax that was brought in from the Laracast "Integrated" package.

Thoughts?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.