Permalink
Browse files

Merge pull request #899 from dereuromark/2.3-more-tests

default value null makes more sense. add test cases for false.
  • Loading branch information...
2 parents 61dd109 + 17be6d0 commit 7ea3ee466d1c558c86e6dd60f9d259ecf4f280fe @markstory markstory committed Oct 14, 2012
Showing with 20 additions and 1 deletion.
  1. +12 −0 lib/Cake/Test/Case/BasicsTest.php
  2. +7 −0 lib/Cake/Test/Case/Utility/DebuggerTest.php
  3. +1 −1 lib/Cake/basics.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);
}
/**
@@ -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
@@ -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, $showHtml = null, $showFrom = true) {
if (Configure::read('debug') > 0) {
App::uses('Debugger', 'Utility');
$file = '';

0 comments on commit 7ea3ee4

Please sign in to comment.