public function testJsonOutputIsJsonEncoded() { $content = ['one' => true]; $this->expectOutputString(json_encode($content)); $this->res->setContentType(Response::JSON); $this->res->setContent($content); $this->res->sendContent(); }
/** * get a static file * @param array $route * @param Response $res * @return boolean, action found and called */ private function runFileRequest(array $route, Response $res) { $file = $route['file']; $base = $route['base']; $frmt = $route['format']; $path = $base . DIRECTORY_SEPARATOR . $file . ($frmt ? ".{$frmt}" : ''); $res->setContent($this->renderer->render($this, $path)); return true; }