|
|
@@ -291,21 +291,30 @@ class DebuggerTest extends TestCase
|
|
|
*/
|
|
|
public function testExportVar(): void
|
|
|
{
|
|
|
+ $std = new stdClass();
|
|
|
+ $std->int = 2;
|
|
|
+ $std->float = 1.333;
|
|
|
+ $std->string = ' ';
|
|
|
+
|
|
|
+ $result = Debugger::exportVar($std);
|
|
|
+ $expected = <<<TEXT
|
|
|
+object(stdClass) id:0 {
|
|
|
+ int => (int) 2
|
|
|
+ float => (float) 1.333
|
|
|
+ string => ' '
|
|
|
+}
|
|
|
+TEXT;
|
|
|
+ $this->assertTextEquals($expected, $result);
|
|
|
+
|
|
|
$Controller = new Controller();
|
|
|
$Controller->viewBuilder()->setHelpers(['Html', 'Form'], false);
|
|
|
$View = $Controller->createView();
|
|
|
- $View->int = 2;
|
|
|
- $View->float = 1.333;
|
|
|
- $View->string = ' ';
|
|
|
|
|
|
$result = Debugger::exportVar($View);
|
|
|
$expected = <<<TEXT
|
|
|
object(Cake\View\View) id:0 {
|
|
|
Html => object(Cake\View\Helper\HtmlHelper) id:1 {}
|
|
|
Form => object(Cake\View\Helper\FormHelper) id:2 {}
|
|
|
- int => (int) 2
|
|
|
- float => (float) 1.333
|
|
|
- string => ' '
|
|
|
[protected] _helpers => object(Cake\View\HelperRegistry) id:3 {}
|
|
|
[protected] Blocks => object(Cake\View\ViewBlock) id:4 {}
|
|
|
[protected] plugin => null
|