Permalink
Browse files

Fix failing tests.

Two buffers are needed now that handleFatalError() is blowing one up.
Related to pull request #1158
  • Loading branch information...
markstory committed Feb 25, 2013
1 parent b24af5c commit 3d0920a40581f397ae6c6640f79c596e4753bf94
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/Cake/Test/Case/Error/ErrorHandlerTest.php
@@ -252,14 +252,16 @@ public function testLoadPluginHandler() {
/**
* test handleFatalError generating a page.
*
* These tests start two buffers as handleFatalError blows the outer one up.
*
* @return void
*/
public function testHandleFatalErrorPage() {
$this->skipIf(file_exists(APP . 'app_error.php'), 'App error exists cannot run.');
$originalDebugLevel = Configure::read('debug');
$line = __LINE__;
ob_start();
ob_start();
Configure::write('debug', 1);
ErrorHandler::handleFatalError(E_ERROR, 'Something wrong', __FILE__, $line);
@@ -268,15 +270,14 @@ public function testHandleFatalErrorPage() {
$this->assertContains(__FILE__, $result, 'filename missing.');
$this->assertContains((string)$line, $result, 'line missing.');
ob_start();
ob_start();
Configure::write('debug', 0);
ErrorHandler::handleFatalError(E_ERROR, 'Something wrong', __FILE__, $line);
$result = ob_get_clean();
$this->assertNotContains('Something wrong', $result, 'message must not appear.');
$this->assertNotContains(__FILE__, $result, 'filename must not appear.');
$this->assertContains('An Internal Error Has Occurred', $result);
Configure::write('debug', $originalDebugLevel);
}
/**

0 comments on commit 3d0920a

Please sign in to comment.