$cookie =
new Cookie('foo', 'bar'
);
$this->
assertEquals('bar',
$cookie->
getValue(), '->getValue() returns the cookie value'
);
$cookie =
new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true
); // raw value
$this->
assertEquals('bar=baz',
$cookie->
getValue(), '->getValue() returns the urldecoded cookie value'
);
} public function testGetRawValue() { $cookie =
new Cookie('foo', 'bar=baz'
); // decoded value
$this->
assertEquals('bar%3Dbaz',
$cookie->
getRawValue(), '->getRawValue() returns the urlencoded cookie value'
);
$cookie =
new Cookie('foo', 'bar%3Dbaz', null, '/', '', false, true, true
); // raw value
$this->
assertEquals('bar%3Dbaz',
$cookie->
getRawValue(), '->getRawValue() returns the non-urldecoded cookie value'
);
} public function testGetPath() { $cookie =
new Cookie('foo', 'bar', 0
);
$this->
assertEquals('/',
$cookie->
getPath(), '->getPath() returns / is no path is defined'
);
$cookie =
new Cookie('foo', 'bar', 0, '/foo'
);
$this->
assertEquals('/foo',
$cookie->
getPath(), '->getPath() returns the cookie path'
);
}