diff --git a/lib/Cake/Test/Case/Utility/DebuggerTest.php b/lib/Cake/Test/Case/Utility/DebuggerTest.php index 806664b40..7603a1f9b 100644 --- a/lib/Cake/Test/Case/Utility/DebuggerTest.php +++ b/lib/Cake/Test/Case/Utility/DebuggerTest.php @@ -128,7 +128,7 @@ class DebuggerTest extends CakeTestCase { Debugger::output('html'); $wrong .= ''; $result = ob_get_clean(); - $this->assertPattern('/
.+<\/pre>/', $result); + $this->assertPattern('/.+<\/pre>/', $result); $this->assertPattern('/Notice<\/b>/', $result); $this->assertPattern('/variable:\s+wrong/', $result); @@ -137,7 +137,7 @@ class DebuggerTest extends CakeTestCase { $buzz .= ''; $result = explode('', ob_get_clean()); $this->assertTags($result[0], array( - 'pre' => array('class' => 'cake-debug'), + 'pre' => array('class' => 'cake-error'), 'a' => array( 'href' => "javascript:void(0);", 'onclick' => "preg:/document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display = " . @@ -250,6 +250,11 @@ class DebuggerTest extends CakeTestCase { $this->assertTags($result, $data, true); } +/** + * Test adding a format that is handled by a callback. + * + * @return void + */ public function testAddFormatCallback() { set_error_handler('Debugger::showError'); $this->_restoreError = true; diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index d7f0cc5ea..5ad790f6d 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -77,8 +77,8 @@ class Debugger { 'links' => array() ), 'html' => array( - 'trace' => 'Trace', - 'context' => '{:trace}
Context' + 'trace' => '{:context}
Trace', + 'context' => '{:trace}
Context' ), 'txt' => array( 'error' => "{:error}: {:code} :: {:description} on line {:line} of {:path}\n{:info}", @@ -114,7 +114,7 @@ class Debugger { define('E_RECOVERABLE_ERROR', 4096); } - $e = '{:context}
'; + $e = ''; $e .= '{:error} ({:code}): {:description} '; @@ -149,11 +149,11 @@ class Debugger { $this->_templates['js']['code'] = '_templates['js']['code'] .= 'style="display: none;">{:code}'; - $e = '{:error} ({:code}) : {:description} '; + $e = '{:error} ({:code}) : {:description} '; $e .= '[{:path}, line {:line}]'; $this->_templates['html']['error'] = $e; - $this->_templates['html']['context'] = 'Context '; + $this->_templates['html']['context'] = 'Context '; $this->_templates['html']['context'] .= ''; }{:context}