예제 #1
0
 function testSendCookies()
 {
     $cookie = new Cookie("name", "value");
     $this->response->addCookie($cookie);
     $this->request->mock();
     $this->send();
     $expected = array("HTTP/1.1 200 OK", "Date: " . $this->response->getHeader("Date"), "Content-Length: 0", "Set-Cookie: " . $cookie);
     $this->assertEquals($expected, HeaderStack::stack());
 }
예제 #2
0
 function testNoCacheControlWhenEmpty()
 {
     $this->cacheControl->makeCacheHeaders();
     $this->assertNull($this->response->getHeader("Cache-Control"));
 }
예제 #3
0
 function testCacheMissedHandling()
 {
     $response = new Response();
     $response->whenCacheMissed(function () use($response) {
         $response->json(array(1, 2, 3));
     });
     $response->cacheMissed();
     $this->assertEquals("application/json", $response->getHeader("Content-Type"));
 }