Adding test for CookieComponent::write() and writing an array of unencrypted key/value pairs, disproves #4997

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7289 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2008-06-27 06:52:36 +00:00
parent 06869fd4b3
commit 7bad69a2d0

View file

@ -95,6 +95,18 @@ class CookieComponentTest extends CakeTestCase {
$this->assertEqual($data, $expected);
}
function testWritePlainCookieArray() {
$this->Controller->Cookie->write(array('name' => 'CakePHP', 'version' => '1.2.0.x', 'tag' => 'CakePHP Rocks!'), false);
$this->assertEqual($this->Controller->Cookie->read('name'), 'CakePHP');
$this->assertEqual($this->Controller->Cookie->read('version'), '1.2.0.x');
$this->assertEqual($this->Controller->Cookie->read('tag'), 'CakePHP Rocks!');
$this->Controller->Cookie->del('name');
$this->Controller->Cookie->del('version');
$this->Controller->Cookie->del('tag');
}
function testReadingCookieValue() {
$data = $this->Controller->Cookie->read();
$expected = array(