From f1f4afacbd20a423692d9ecbbbe7be7fa33c7d4d Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 2 Sep 2011 14:18:33 +0100 Subject: [PATCH] Fixing duplication of classes. cake-debug was used for debug and error messages. --- lib/Cake/Test/Case/Utility/DebuggerTest.php | 9 +++++++-- lib/Cake/Utility/Debugger.php | 10 +++++----- 2 files changed, 12 insertions(+), 7 deletions(-) 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 

{:trace}

', - 'context' => '
Context 

{:context}

' + 'trace' => '
Trace 

{:trace}

', + 'context' => '
Context 

{: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 = '
';
+		$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}

'; }