39 $expire = time() + 100;
50 $this->
assertEquals(
null, $this->response->getCookie(
'xkey' ),
'Non-existing cookie' );
51 $this->response->setCookie(
'key',
'val', $expire, [
58 $this->
assertEquals(
'val', $this->response->getCookie(
'xkey' ),
'Existing cookie' );
59 $this->
assertEquals( $cookie, $this->response->getCookieData(
'xkey' ),
60 'Existing cookie (data)' );
61 $this->
assertEquals( [
'xkey' => $cookie ], $this->response->getCookies(),
70 $this->
assertEquals(
null, $this->response->getHeader(
'Location' ),
'Non-existing header' );
72 $this->response->header(
'Location: http://localhost/' );
75 $this->response->getHeader(
'Location' ),
79 $this->response->header(
'Location: http://127.0.0.1/' );
82 $this->response->getHeader(
'Location' ),
86 $this->response->header(
'Location: http://127.0.0.2/',
false );
89 $this->response->getHeader(
'Location' ),
90 'Same header with override disabled'
93 $this->response->header(
'Location: http://localhost/' );
96 $this->response->getHeader(
'LOCATION' ),
97 'Get header case insensitive'
105 $this->response->header(
'HTTP/1.1 200' );
106 $this->
assertEquals( 200, $this->response->getStatusCode(),
'Header with no message' );
108 $this->response->header(
'HTTP/1.x 201' );
111 $this->response->getStatusCode(),
112 'Header with no message and protocol 1.x'
115 $this->response->header(
'HTTP/1.1 202 OK' );
116 $this->
assertEquals( 202, $this->response->getStatusCode(),
'Normal header' );
118 $this->response->header(
'HTTP/1.x 203 OK' );
121 $this->response->getStatusCode(),
122 'Normal header with no message and protocol 1.x'
125 $this->response->header(
'HTTP/1.x 204 OK',
false, 205 );
128 $this->response->getStatusCode(),
129 'Third parameter overrides the HTTP/... header'
132 $this->response->statusHeader( 210 );
135 $this->response->getStatusCode(),
136 'Handle statusHeader method'
139 $this->response->header(
'Location: http://localhost/',
false, 206 );
142 $this->response->getStatusCode(),
143 'Third parameter with another header'