public function request($method, $path, $options = array()) { // Capture STDOUT ob_start(); // Prepare a mock environment \Slim\Environment::mock(array_merge(array('REQUEST_METHOD' => $method, 'PATH_INFO' => $path, 'SERVER_NAME' => 'local.dev'), $options)); // Establish some useful references to the slim app properties $this->request = $this->app->request(); $this->response = $this->app->response(); // Execute our app $this->app->run(); // Return the application output. Also available in `response->body()` return ob_get_clean(); }