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,8 +66,12 @@ class ErrorHandlerTest extends CakeTestCase {
|
||||||
Router::setRequestInfo($request);
|
Router::setRequestInfo($request);
|
||||||
Configure::write('debug', 2);
|
Configure::write('debug', 2);
|
||||||
|
|
||||||
CakeLog::disable('stdout');
|
if (CakeLog::stream('stdout') !== false) {
|
||||||
CakeLog::disable('stderr');
|
CakeLog::disable('stdout');
|
||||||
|
}
|
||||||
|
if (CakeLog::stream('stderr') !== false) {
|
||||||
|
CakeLog::disable('stderr');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,8 +84,13 @@ class ErrorHandlerTest extends CakeTestCase {
|
||||||
if ($this->_restoreError) {
|
if ($this->_restoreError) {
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
}
|
}
|
||||||
CakeLog::enable('stdout');
|
|
||||||
CakeLog::enable('stderr');
|
if (CakeLog::stream('stdout') !== false) {
|
||||||
|
CakeLog::enable('stdout');
|
||||||
|
}
|
||||||
|
if (CakeLog::stream('stderr') !== false) {
|
||||||
|
CakeLog::enable('stderr');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue