diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php index 2eaab04f6..6d7d9eca9 100644 --- a/lib/Cake/Test/Case/Utility/DebuggerTest.php +++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php @@ -343,6 +343,21 @@ array( (int) 1 => 'Index one', (int) 5 => 'Index five' ) +TEXT; + $this->assertTextEquals($expected, $result); + + $data = array( + 'key' => array( + 'value' + ) + ); + $result = Debugger::exportVar($data, 1); + $expected = << array( + [maximum depth reached] + ) +) TEXT; $this->assertTextEquals($expected, $result); } @@ -398,8 +413,14 @@ TEXT;
array(
 	'People' => array(
 		(int) 0 => array(
+			'name' => 'joeseph',
+			'coat' => 'technicolor',
+			'hair_color' => 'brown'
 		),
 		(int) 1 => array(
+			'name' => 'Shaft',
+			'coat' => 'black',
+			'hair' => 'black'
 		)
 	)
 )
diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index 2a9fc9c23..f60960b5b 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -544,8 +544,10 @@ class Debugger { foreach ($var as $key => $val) { $vars[] = $break . self::exportVar($key) . ' => ' . - self::_export($val, $depth - 1, $indent); + self::_export($val, $depth, $indent); } + } else { + $vars[] = $break . '[maximum depth reached]'; } return $out . implode(',', $vars) . $end . ')'; }