createServerRequest("GET", "https://example.com/"); $default = function(RequestInterface $request) { $response = (new ResponseFactory)->createResponse(); $response->getBody()->write("Success"); return $response; }; $collection = new MiddlewareCollection([ new WhoopsMiddleware() ]); $response = $collection->dispatch($request, $default); $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals("Success", $response->getBody()); } }