/** * Create an Application object with 2 routes, a GET and a POST * using Application::get() and Application::post() * * @param string $adapter * @param string $getName * @param string $postName * @return Application */ private function createApplicationWithGetPost($adapter, $getName = null, $postName = null) { $app = new Application(new $adapter()); $app->get('/foo', function ($req, $res, $next) { $res->getBody()->write('Middleware GET'); return $res; }, $getName); $app->post('/foo', function ($req, $res, $next) { $res->getBody()->write('Middleware POST'); return $res; }, $postName); return $app; }