Esempio n. 1
0
 function testCacheHitWithSameModificationTime()
 {
     $this->response->setHeader("Last-Modified", "Sun, 25 Aug 2013 18:33:31 GMT");
     $this->request->mock(array("HTTP_IF_MODIFIED_SINCE" => "Sun, 25 Aug 2013 18:33:31 GMT"));
     $this->send();
     $this->assertEquals(304, $this->response->getStatus());
 }
Esempio n. 2
0
 function testHtml()
 {
     $response = new Response();
     $response->html("ABC");
     $this->assertEquals(200, $response->getStatus());
     $this->assertEquals("ABC", $response->getBody());
     $this->assertEquals("text/html", $response->getHeader("Content-Type"));
     $response->html("DEF", 404, array("Content-Type" => "text/xhtml"));
     $this->assertEquals(404, $response->getStatus());
     $this->assertEquals("DEF", $response->getBody());
     $this->assertEquals("text/xhtml", $response->getHeader("Content-Type"));
 }
Esempio n. 3
0
 function testMethodNotAllowedDispatch()
 {
     $this->request->mock(array("REQUEST_URI" => "/route-1", "REQUEST_METHOD" => "POST"));
     $this->assertEmpty($this->dispatch());
     $this->assertEquals(405, $this->response->getStatus());
 }