mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
parent
735517ade1
commit
7008b812be
2 changed files with 27 additions and 1 deletions
|
@ -408,6 +408,32 @@ TEXT;
|
|||
$this->assertTextEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test exporting various kinds of false.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testExportVarZero() {
|
||||
$data = array(
|
||||
'nothing' => '',
|
||||
'null' => null,
|
||||
'false' => false,
|
||||
'szero' => '0',
|
||||
'zero' => 0
|
||||
);;
|
||||
$result = Debugger::exportVar($data);
|
||||
$expected = <<<TEXT
|
||||
array(
|
||||
'nothing' => '',
|
||||
'null' => null,
|
||||
'false' => false,
|
||||
'szero' => '0',
|
||||
'zero' => (int) 0
|
||||
)
|
||||
TEXT;
|
||||
$this->assertTextEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* testLog method
|
||||
*
|
||||
|
|
|
@ -489,7 +489,7 @@ class Debugger {
|
|||
case 'float':
|
||||
return '(float) ' . $var;
|
||||
case 'string':
|
||||
if (!trim($var)) {
|
||||
if (trim($var) === '') {
|
||||
return "''";
|
||||
}
|
||||
return "'" . $var . "'";
|
||||
|
|
Loading…
Add table
Reference in a new issue