21 'ASIHTTPRequestTestCookie=This+is+the+value; expires=Sat, 26-Jul-2008 17:00:42 GMT; path=/tests; domain=allseeing-i.com; PHPSESSID=6c951590e7a9359bcedde25cda73e43c; path=/";',
23 'domain' =>
'allseeing-i.com',
26 'PHPSESSID' =>
'6c951590e7a9359bcedde25cda73e43c'
29 'expires' =>
'Sat, 26-Jul-2008 17:00:42 GMT',
35 'ASIHTTPRequestTestCookie' =>
'This+is+the+value'
38 'comment_url' =>
null,
46 'foo=',
'foo =',
'foo =;',
'foo= ;',
'foo =',
'foo= '),
61 'comment_url' =>
null,
67 'foo=1',
'foo =1',
'foo =1;',
'foo=1 ;',
'foo =1',
'foo= 1',
'foo = 1 ;',
'foo="1"',
'foo="1";',
'foo= "1";'),
82 'comment_url' =>
null,
88 'foo=1; bar=2;',
'foo =1; bar = "2"',
'foo=1; bar=2'),
104 'comment_url' =>
null,
110 'foo=1; port="80,8081"; httponly',
'foo=1; port="80,8081"; domain=www.test.com; HttpOnly;',
'foo=1; ; domain=www.test.com; path=/path; port="80,8081"; HttpOnly;'),
117 'domain' =>
'www.test.com',
121 'port' => array(
'80',
'8081'),
125 'comment_url' =>
null,
128 'http://www.test.com/path/'
132 'justacookie=foo; domain=example.com',
135 'justacookie' =>
'foo'
137 'domain' =>
'example.com',
147 'comment_url' =>
null,
152 'expires=tomorrow; secure; path=/Space Out/; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=.example.com',
155 'expires' =>
'tomorrow'
157 'domain' =>
'.example.com',
158 'path' =>
'/Space Out/',
159 'expires' =>
'Tue, 21-Nov-2006 08:33:44 GMT',
167 'comment_url' =>
null,
172 'domain=unittests; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=example.com; path=/some value/',
175 'domain' =>
'unittests'
177 'domain' =>
'example.com',
178 'path' =>
'/some value/',
179 'expires' =>
'Tue, 21-Nov-2006 08:33:44 GMT',
187 'comment_url' =>
null,
192 'path=indexAction; path=/; domain=.foo.com; expires=Tue, 21-Nov-2006 08:33:44 GMT',
195 'path' =>
'indexAction'
197 'domain' =>
'.foo.com',
199 'expires' =>
'Tue, 21-Nov-2006 08:33:44 GMT',
207 'comment_url' =>
null,
212 'secure=sha1; secure; SECURE; domain=some.really.deep.domain.com; version=1; Max-Age=86400',
217 'domain' =>
'some.really.deep.domain.com',
222 'expires' => time() + 86400,
227 'comment_url' =>
null,
232 'PHPSESSID=123456789+abcd%2Cef; secure; discard; domain=.localdomain; path=/foo/baz; expires=Tue, 21-Nov-2006 08:33:44 GMT;',
235 'PHPSESSID' =>
'123456789+abcd%2Cef'
237 'domain' =>
'.localdomain',
238 'path' =>
'/foo/baz',
239 'expires' =>
'Tue, 21-Nov-2006 08:33:44 GMT',
247 'comment_url' =>
null,
258 'domain' =>
'example.com',
263 'path' =>
'/some/path',
268 'comment_url' =>
null,
271 'http://example.com/some/path/test.html'
279 'domain' =>
'example.com',
289 'comment_url' =>
null,
292 'http://example.com/test.html'
300 'domain' =>
'example.com',
310 'comment_url' =>
null,
313 'http://example.com?query=here'
316 'test=noSlashPath; path=someString',
319 'test' =>
'noSlashPath'
321 'domain' =>
'example.com',
326 'path' =>
'/real/path',
331 'comment_url' =>
null,
334 'http://example.com/real/path/'
344 $c = $this->cookieParserClass;
350 $host = $url->getHost();
351 $path = $url->getPath();
357 foreach ((array) $cookie as $c) {
358 $p = $parser->parseCookie($c, $host, $path);
361 if ($p[
'expires'] != $parsed[
'expires']) {
362 if (abs($p[
'expires'] - $parsed[
'expires']) < 300) {
363 unset($p[
'expires']);
364 unset($parsed[
'expires']);
368 if (is_array($parsed)) {
369 foreach ($parsed as $key => $value) {
370 $this->assertEquals($parsed[$key], $p[$key],
'Comparing ' . $key .
' ' . var_export($value,
true) .
' : ' . var_export($parsed,
true) .
' | ' . var_export($p,
true));
373 foreach ($p as $key => $value) {
374 $this->assertEquals($p[$key], $parsed[$key],
'Comparing ' . $key .
' ' . var_export($value,
true) .
' : ' . var_export($parsed,
true) .
' | ' . var_export($p,
true));
377 $this->assertEquals($parsed, $p);