mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 20:46:24 +00:00
Merge pull request #899 from dereuromark/2.3-more-tests
default value null makes more sense. add test cases for false.
This commit is contained in:
commit
7ea3ee466d
3 changed files with 20 additions and 1 deletions
|
@ -825,6 +825,18 @@ EXPECTED;
|
||||||
########## DEBUG ##########
|
########## DEBUG ##########
|
||||||
'<div>this-is-a-test</div>'
|
'<div>this-is-a-test</div>'
|
||||||
###########################
|
###########################
|
||||||
|
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;
|
||||||
$expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 8);
|
$expected = sprintf($expected, str_replace(CAKE_CORE_INCLUDE_PATH, '', __FILE__), __LINE__ - 8);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
|
|
@ -391,6 +391,13 @@ array(
|
||||||
[maximum depth reached]
|
[maximum depth reached]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
TEXT;
|
||||||
|
$this->assertTextEquals($expected, $result);
|
||||||
|
|
||||||
|
$data = false;
|
||||||
|
$result = Debugger::exportVar($data);
|
||||||
|
$expected = <<<TEXT
|
||||||
|
false
|
||||||
TEXT;
|
TEXT;
|
||||||
$this->assertTextEquals($expected, $result);
|
$this->assertTextEquals($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ if (!function_exists('debug')) {
|
||||||
* @link http://book.cakephp.org/2.0/en/development/debugging.html#basic-debugging
|
* @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
|
* @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) {
|
if (Configure::read('debug') > 0) {
|
||||||
App::uses('Debugger', 'Utility');
|
App::uses('Debugger', 'Utility');
|
||||||
$file = '';
|
$file = '';
|
||||||
|
|
Loading…
Add table
Reference in a new issue