diff --git a/cake/tests/cases/libs/controller/components/cookie.test.php b/cake/tests/cases/libs/controller/components/cookie.test.php index 5e3751f8b..a9385a2c2 100644 --- a/cake/tests/cases/libs/controller/components/cookie.test.php +++ b/cake/tests/cases/libs/controller/components/cookie.test.php @@ -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 *