Skip to content

Commit

Permalink
Fixing formatting, and updating test to better reflect what would nor…
Browse files Browse the repository at this point in the history
…mally happen.
  • Loading branch information
markstory committed Apr 16, 2011
1 parent 13c64f1 commit 4395e8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cake/libs/controller/components/cookie.php
Expand Up @@ -281,8 +281,8 @@ function delete($key) {
$this->read();
}
if (strpos($key, '.') === false) {
if(isset($this->__values[$key]) && is_array($this->__values[$key])) {
foreach($this->__values[$key] as $idx => $val) {
if (isset($this->__values[$key]) && is_array($this->__values[$key])) {
foreach ($this->__values[$key] as $idx => $val) {
$this->__delete("[$key][$idx]");
}
} else {
Expand Down
5 changes: 4 additions & 1 deletion cake/tests/cases/libs/controller/components/cookie.test.php
Expand Up @@ -456,7 +456,10 @@ function testNoErrorOnNonArrayData() {
* @return void
*/
function testDeleteRemovesChildren() {
$_COOKIE['CakeTestCookie'] = array('User' => array('email' => 'example@example.com', 'name' => 'mark'));
$_COOKIE['CakeTestCookie'] = array(
'User' => array('email' => 'example@example.com', 'name' => 'mark'),
'other' => 'value'
);
$this->Controller->Cookie->startup();
$this->assertEqual('mark', $this->Controller->Cookie->read('User.name'));

Expand Down

0 comments on commit 4395e8a

Please sign in to comment.