Skip to content

Commit

Permalink
Adding a test case for #1651
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Apr 16, 2011
1 parent 9f51c4c commit bc5edeb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cake/tests/cases/libs/controller/components/cookie.test.php
Expand Up @@ -450,6 +450,21 @@ function testNoErrorOnNonArrayData() {
$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
*
Expand Down

0 comments on commit bc5edeb

Please sign in to comment.