Permalink
Browse files

Adding a test case for #1651

  • Loading branch information...
1 parent 9f51c4c commit bc5edebee6ec679152d8c03eca373c9e853c4ca1 @markstory markstory committed Apr 16, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 cake/tests/cases/libs/controller/components/cookie.test.php
@@ -451,6 +451,21 @@ function testNoErrorOnNonArrayData() {
}
/**
+ * 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
*
* @param mixed $value

0 comments on commit bc5edeb

Please sign in to comment.