Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsteinsland committed Jan 15, 2015
1 parent e513498 commit a5e1be7
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions lib/Cake/Test/Case/Error/ErrorHandlerTest.php
Expand Up @@ -340,25 +340,45 @@ public function testHandleFatalErrorLog() {
/**
* testExceptionRendererNestingDebug method
*
* @expectedException FatalErrorException
* @return void
*/
public function testExceptionRendererNestingDebug() {
Configure::write('debug', 2);
Configure::write('Exception.renderer', 'FaultyExceptionRenderer');
ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__, __LINE__);

$result = false;
try {
ob_start();
ob_start();
ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__, __LINE__);
} catch (Exception $e) {
$result = $e instanceof FatalErrorException;
}

restore_error_handler();
$this->assertTrue($result);
}

/**
* testExceptionRendererNestingProduction method
*
* @expectedException InternalErrorException
* @return void
*/
public function testExceptionRendererNestingProduction() {
Configure::write('debug', 0);
Configure::write('Exception.renderer', 'FaultyExceptionRenderer');
ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__, __LINE__);

$result = false;
try {
ob_start();
ob_start();
ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__, __LINE__);
} catch (Exception $e) {
$result = $e instanceof InternalErrorException;
}

restore_error_handler();
$this->assertTrue($result);
}

}

0 comments on commit a5e1be7

Please sign in to comment.