Browse Source

Fixing duplication of classes. cake-debug was used for debug and error messages.

mark_story 14 years ago
parent
commit
f1f4afacbd
2 changed files with 12 additions and 7 deletions
  1. 7 2
      lib/Cake/Test/Case/Utility/DebuggerTest.php
  2. 5 5
      lib/Cake/Utility/Debugger.php

+ 7 - 2
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 class="cake-debug">.+<\/pre>/', $result);
+		$this->assertPattern('/<pre class="cake-error">.+<\/pre>/', $result);
 		$this->assertPattern('/<b>Notice<\/b>/', $result);
 		$this->assertPattern('/variable:\s+wrong/', $result);
 
@@ -137,7 +137,7 @@ class DebuggerTest extends CakeTestCase {
 		$buzz .= '';
 		$result = explode('</a>', 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;

+ 5 - 5
lib/Cake/Utility/Debugger.php

@@ -77,8 +77,8 @@ class Debugger {
 			'links' => array()
 		),
 		'html' => array(
-			'trace' => '<pre class="cake-debug trace"><b>Trace</b> <p>{:trace}</p></pre>',
-			'context' => '<pre class="cake-debug context"><b>Context</b> <p>{:context}</p></pre>'
+			'trace' => '<pre class="cake-error trace"><b>Trace</b> <p>{:trace}</p></pre>',
+			'context' => '<pre class="cake-error context"><b>Context</b> <p>{:context}</p></pre>'
 		),
 		'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 = '<pre class="cake-debug">';
+		$e = '<pre class="cake-error">';
 		$e .= '<a href="javascript:void(0);" onclick="document.getElementById(\'{:id}-trace\')';
 		$e .= '.style.display = (document.getElementById(\'{:id}-trace\').style.display == ';
 		$e .= '\'none\' ? \'\' : \'none\');"><b>{:error}</b> ({:code})</a>: {:description} ';
@@ -149,11 +149,11 @@ class Debugger {
 		$this->_templates['js']['code'] = '<pre id="{:id}-code" class="cake-code-dump" ';
 		$this->_templates['js']['code'] .= 'style="display: none;">{:code}</pre>';
 
-		$e = '<pre class="cake-debug"><b>{:error}</b> ({:code}) : {:description} ';
+		$e = '<pre class="cake-error"><b>{:error}</b> ({:code}) : {:description} ';
 		$e .= '[<b>{:path}</b>, line <b>{:line}]</b></pre>';
 		$this->_templates['html']['error'] = $e;
 
-		$this->_templates['html']['context'] = '<pre class="cake-debug context"><b>Context</b> ';
+		$this->_templates['html']['context'] = '<pre class="cake-context"><b>Context</b> ';
 		$this->_templates['html']['context'] .= '<p>{:context}</p></pre>';
 	}