public function testOnFactoryResponseTypes() { $htmlInstace = Factory::response(ResponseType::HTML); $this->assertInstanceOf("MyFrameWork\\Response\\HtmlResponse", $htmlInstace); $emtyInstace = Factory::response(ResponseType::EMPT); $this->assertInstanceOf("MyFrameWork\\Response\\EmptyResponse", $emtyInstace); }
public function testResponse() { $this->assertNotNull(Factory::response('Html')); $this->assertEquals(Factory::response('Html'), Factory::response('html')); $this->assertNotEquals(Factory::response('Empty'), Factory::response('html')); $this->assertNotNull(Factory::response('json')); $this->assertNotEquals(Factory::response('Empty'), Factory::response('Json')); $this->assertNotNull(Factory::response('auxua')); $this->assertEquals(Factory::response('Empty'), Factory::response('auxua')); }
/** * Renderiza a página exibindo o seu resultado no navegador */ protected function render() { $response = Factory::response($this->responseType); $response->setHeader(); $response->renderContent($this->getPagedata(), $this->getFilename()); }