mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
test: Allow ErrorHandlerTest to run even if CakeLog configs (stdout and stderr) are not configured.
When ErrorHandlerTest is run with CakeTestRunner (TestShell) (or run with ShellTest, etc.), these configs are provided in the initialization process of the Shell class, but are not needed in many test cases.
This commit is contained in:
parent
b46b6c758f
commit
76d1673958
1 changed files with 13 additions and 4 deletions
|
@ -66,9 +66,13 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
Router::setRequestInfo($request);
|
||||
Configure::write('debug', 2);
|
||||
|
||||
if (CakeLog::stream('stdout') !== false) {
|
||||
CakeLog::disable('stdout');
|
||||
}
|
||||
if (CakeLog::stream('stderr') !== false) {
|
||||
CakeLog::disable('stderr');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* tearDown
|
||||
|
@ -80,9 +84,14 @@ class ErrorHandlerTest extends CakeTestCase {
|
|||
if ($this->_restoreError) {
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
if (CakeLog::stream('stdout') !== false) {
|
||||
CakeLog::enable('stdout');
|
||||
}
|
||||
if (CakeLog::stream('stderr') !== false) {
|
||||
CakeLog::enable('stderr');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* test error handling when debug is on, an error should be printed from Debugger.
|
||||
|
|
Loading…
Reference in a new issue