Skip to content
Browse files

Fixing duplication of classes. cake-debug was used for debug and erro…

…r messages.
  • Loading branch information...
1 parent 8c75488 commit f1f4afacbd20a423692d9ecbbbe7be7fa33c7d4d @markstory markstory committed
Showing with 12 additions and 7 deletions.
  1. +7 −2 lib/Cake/Test/Case/Utility/DebuggerTest.php
  2. +5 −5 lib/Cake/Utility/Debugger.php
View
9 lib/Cake/Test/Case/Utility/DebuggerTest.php
@@ -128,7 +128,7 @@ public function testOutput() {
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 @@ public function testOutput() {
$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 @@ public function testAddFormat() {
$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;
View
10 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 @@ public function __construct() {
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 @@ public function __construct() {
$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>';
}

0 comments on commit f1f4afa

Please sign in to comment.
Something went wrong with that request. Please try again.