Skip to content

Commit

Permalink
Added case for unknown type. Fixes #3966
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrang committed Aug 7, 2013
1 parent c01aacf commit 2150e8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Cake/Test/Case/Utility/DebuggerTest.php
Expand Up @@ -408,6 +408,11 @@ public function testExportVar() {
false false
TEXT; TEXT;
$this->assertTextEquals($expected, $result); $this->assertTextEquals($expected, $result);

$file = fopen('php://output', 'w');
fclose($file);
$result = Debugger::exportVar($file);
$this->assertTextEquals('unknown', $result);
} }


/** /**
Expand Down
2 changes: 2 additions & 0 deletions lib/Cake/Utility/Debugger.php
Expand Up @@ -500,6 +500,8 @@ protected static function _export($var, $depth, $indent) {
return strtolower(gettype($var)); return strtolower(gettype($var));
case 'null': case 'null':
return 'null'; return 'null';
case 'unknown':
return 'unknown';
default: default:
return self::_object($var, $depth - 1, $indent + 1); return self::_object($var, $depth - 1, $indent + 1);
} }
Expand Down

0 comments on commit 2150e8d

Please sign in to comment.