Skip to content
Permalink
Browse files

Rename Debugger::print() to Debugger::printVar()

Can't use method name print() in PHP 5.x
  • Loading branch information...
ADmad committed Jan 8, 2017
1 parent 230d494 commit 4db4a1e05927339737d27ed73f536460be24f7d5
Showing with 15 additions and 15 deletions.
  1. +1 −1 src/Error/Debugger.php
  2. +2 −2 src/basics.php
  3. +12 −12 tests/TestCase/Error/DebuggerTest.php
@@ -801,7 +801,7 @@ public static function getType($var)
* data in a browser-friendly way.
* @return void
*/
public static function print($var, $location = [], $showHtml = null)
public static function printVar($var, $location = [], $showHtml = null)
{
$location += ['file' => null, 'line' => null];
$file = $location['file'];
@@ -55,7 +55,7 @@ function debug($var, $showHtml = null, $showFrom = true)
];
}
Debugger::print($var, $location, $showHtml);
Debugger::printVar($var, $location, $showHtml);
return $var;
}
@@ -136,7 +136,7 @@ function dd($var, $showHtml = null)
'file' => $trace[0]['file']
];
Debugger::print($var, $location);
Debugger::printVar($var, $location);
die(1);
}
}
@@ -587,14 +587,14 @@ public function testDebugInfo()
}
/**
* test testPrint()
* test testPrintVar()
*
* @return void
*/
public function testPrint()
public function testPrintVar()
{
ob_start();
Debugger::print('this-is-a-test', ['file' => __FILE__, 'line' => __LINE__], false);
Debugger::printVar('this-is-a-test', ['file' => __FILE__, 'line' => __LINE__], false);
$result = ob_get_clean();
$expectedText = <<<EXPECTED
%s (line %d)
@@ -609,7 +609,7 @@ public function testPrint()
ob_start();
$value = '<div>this-is-a-test</div>';
Debugger::print($value, ['file' => __FILE__, 'line' => __LINE__], true);
Debugger::printVar($value, ['file' => __FILE__, 'line' => __LINE__], true);
$result = ob_get_clean();
$expectedHtml = <<<EXPECTED
<div class="cake-debug-output">
@@ -623,7 +623,7 @@ public function testPrint()
$this->assertEquals($expected, $result);
ob_start();
Debugger::print('<div>this-is-a-test</div>', ['file' => __FILE__, 'line' => __LINE__], true);
Debugger::printVar('<div>this-is-a-test</div>', ['file' => __FILE__, 'line' => __LINE__], true);
$result = ob_get_clean();
$expected = <<<EXPECTED
<div class="cake-debug-output">
@@ -637,7 +637,7 @@ public function testPrint()
$this->assertEquals($expected, $result);
ob_start();
Debugger::print('<div>this-is-a-test</div>', [], true);
Debugger::printVar('<div>this-is-a-test</div>', [], true);
$result = ob_get_clean();
$expected = <<<EXPECTED
<div class="cake-debug-output">
@@ -651,7 +651,7 @@ public function testPrint()
$this->assertEquals($expected, $result);
ob_start();
Debugger::print('<div>this-is-a-test</div>', ['file' => __FILE__, 'line' => __LINE__]);
Debugger::printVar('<div>this-is-a-test</div>', ['file' => __FILE__, 'line' => __LINE__]);
$result = ob_get_clean();
$expectedHtml = <<<EXPECTED
<div class="cake-debug-output">
@@ -676,7 +676,7 @@ public function testPrint()
$this->assertEquals($expected, $result);
ob_start();
Debugger::print('<div>this-is-a-test</div>');
Debugger::printVar('<div>this-is-a-test</div>');
$result = ob_get_clean();
$expectedHtml = <<<EXPECTED
<div class="cake-debug-output">
@@ -701,7 +701,7 @@ public function testPrint()
$this->assertEquals($expected, $result);
ob_start();
Debugger::print('<div>this-is-a-test</div>', ['file' => __FILE__, 'line' => __LINE__], false);
Debugger::printVar('<div>this-is-a-test</div>', ['file' => __FILE__, 'line' => __LINE__], false);
$result = ob_get_clean();
$expected = <<<EXPECTED
%s (line %d)
@@ -714,7 +714,7 @@ public function testPrint()
$this->assertEquals($expected, $result);
ob_start();
Debugger::print('<div>this-is-a-test</div>', ['file' => __FILE__, 'line' => __LINE__], false);
Debugger::printVar('<div>this-is-a-test</div>', ['file' => __FILE__, 'line' => __LINE__], false);
$result = ob_get_clean();
$expected = <<<EXPECTED
%s (line %d)
@@ -727,7 +727,7 @@ public function testPrint()
$this->assertEquals($expected, $result);
ob_start();
Debugger::print('<div>this-is-a-test</div>', [], false);
Debugger::printVar('<div>this-is-a-test</div>', [], false);
$result = ob_get_clean();
$expected = <<<EXPECTED
@@ -740,7 +740,7 @@ public function testPrint()
$this->assertEquals($expected, $result);
ob_start();
Debugger::print(false, [], false);
Debugger::printVar(false, [], false);
$result = ob_get_clean();
$expected = <<<EXPECTED

0 comments on commit 4db4a1e

Please sign in to comment.
You can’t perform that action at this time.