'http://www.example.com/foo/bar',
['foo_nothing', 'foo_path', 'foo_domain'
]],
['http://www4.example.com/',
['foo_nothing', 'foo_domain', 'foo_strict_domain'
]],
];
} public function testEncodedValues() { $cookieJar =
new CookieJar();
$cookieJar->
set($cookie =
new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true
));
$this->
assertEquals(['foo' => 'bar=baz'
],
$cookieJar->
allValues('/'
));
$this->
assertEquals(['foo' => 'bar%3Dbaz'
],
$cookieJar->
allRawValues('/'
));
} public function testCookieExpireWithSameNameButDifferentPaths() { $cookieJar =
new CookieJar();
$cookieJar->
set($cookie1 =
new Cookie('foo', 'bar1', null, '/foo'
));
$cookieJar->
set($cookie2 =
new Cookie('foo', 'bar2', null, '/bar'
));
$cookieJar->
expire('foo', '/foo'
);
$this->
assertNull($cookieJar->
get('foo'
), '->get() returns null if the cookie is expired'
);
$this->
assertEquals([],
array_keys($cookieJar->
allValues('http://example.com/'
)));