From 7bf08fdcc724ef203df8a5fb92bc495e72ee4d65 Mon Sep 17 00:00:00 2001 From: euromark Date: Fri, 12 Oct 2012 16:03:05 +0200 Subject: [PATCH] default value null makes more sense. add test cases for false. --- lib/Cake/Test/Case/BasicsTest.php | 12 ++++++++++++ lib/Cake/Test/Case/Utility/DebuggerTest.php | 7 +++++++ lib/Cake/basics.php | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/BasicsTest.php b/lib/Cake/Test/Case/BasicsTest.php index 0c12fed6fab..97557e85d3d 100644 --- a/lib/Cake/Test/Case/BasicsTest.php +++ b/lib/Cake/Test/Case/BasicsTest.php @@ -825,6 +825,18 @@ public function testDebug() { ########## DEBUG ########## '
this-is-a-test
' ########################### +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 = <<assertEquals($expected, $result); diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php index 155cd1c2da7..bb1416f7884 100644 --- a/lib/Cake/Test/Case/Utility/DebuggerTest.php +++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php @@ -391,6 +391,13 @@ public function testExportVar() { [maximum depth reached] ) ) +TEXT; + $this->assertTextEquals($expected, $result); + + $data = false; + $result = Debugger::exportVar($data); + $expected = <<assertTextEquals($expected, $result); } diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index 434629562fe..acbb4469636 100644 --- a/lib/Cake/basics.php +++ b/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 = '';