Adding a test case for #1651

This commit is contained in:
mark_story 2011-04-16 15:15:53 -04:00
parent 9f51c4ccfc
commit bc5edebee6

View file

@ -450,6 +450,21 @@ class CookieComponentTest extends CakeTestCase {
$this->assertNull($this->Controller->Cookie->read('value'));
}
/**
* test that deleting a top level keys kills the child elements too.
*
* @return void
*/
function testDeleteRemovesChildren() {
$_COOKIE['CakeTestCookie'] = array('User' => array('email' => 'example@example.com', 'name' => 'mark'));
$this->Controller->Cookie->startup();
$this->assertEqual('mark', $this->Controller->Cookie->read('User.name'));
$this->Controller->Cookie->delete('User');
$this->assertFalse($this->Controller->Cookie->read('User.email'));
$this->Controller->Cookie->destroy();
}
/**
* encrypt method
*