Mocking callables in an Expressive app
This blog post was published more than one year ago and might be outdated!
· 2 min read
While working with Zend Expressive, a PSR-7 middleware microframework, I wanted to apply some unit testing with a nice coverage to my middlewares. Middlewares are called by the __invoke method if you provide them as an object and not as a closure. The signature of the __invoke method looks like this: