Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

default value null makes more sense. add test cases for false.

  • Loading branch information...
commit 7bf08fdcc724ef203df8a5fb92bc495e72ee4d65 1 parent 57681ff
@dereuromark dereuromark authored
View
12 lib/Cake/Test/Case/BasicsTest.php
@@ -828,6 +828,18 @@ public function testDebug() {
EXPECTED;
$expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 8);
$this->assertEquals($expected, $result);
+
+ ob_start();
+ debug(false, false, false);
+ $result = ob_get_clean();
+ $expected = <<<EXPECTED
+
+########## DEBUG ##########
+false
+###########################
+EXPECTED;
+ $expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 8);
+ $this->assertEquals($expected, $result);
}
/**
View
7 lib/Cake/Test/Case/Utility/DebuggerTest.php
@@ -393,6 +393,13 @@ public function testExportVar() {
)
TEXT;
$this->assertTextEquals($expected, $result);
+
+ $data = false;
+ $result = Debugger::exportVar($data);
+ $expected = <<<TEXT
+false
+TEXT;
+ $this->assertTextEquals($expected, $result);
}
/**
View
2  lib/Cake/basics.php
@@ -75,7 +75,7 @@ function config() {
* @link http://book.cakephp.org/2.0/en/development/debugging.html#basic-debugging
* @link http://book.cakephp.org/2.0/en/core-libraries/global-constants-and-functions.html#debug
*/
- function debug($var = false, $showHtml = null, $showFrom = true) {
+ function debug($var = null, $showHtml = null, $showFrom = true) {
if (Configure::read('debug') > 0) {
App::uses('Debugger', 'Utility');
$file = '';
Please sign in to comment.
Something went wrong with that request. Please try again.