logging: fix failing tests when called via webrunner

This commit is contained in:
Rachman Chavik 2012-05-25 23:27:40 +07:00
parent 3f6593311b
commit 907b3221ed
6 changed files with 16 additions and 2 deletions

View file

@ -597,12 +597,16 @@ class BasicsTest extends CakeTestCase {
@unlink(LOGS . 'error.log'); @unlink(LOGS . 'error.log');
// disable stderr output for this test // disable stderr output for this test
CakeLog::disable('stderr'); if (CakeLog::stream('stderr')) {
CakeLog::disable('stderr');
}
LogError('Testing LogError() basic function'); LogError('Testing LogError() basic function');
LogError("Testing with\nmulti-line\nstring"); LogError("Testing with\nmulti-line\nstring");
CakeLog::enable('stderr'); if (CakeLog::stream('stderr')) {
CakeLog::enable('stderr');
}
$result = file_get_contents(LOGS . 'error.log'); $result = file_get_contents(LOGS . 'error.log');
$this->assertRegExp('/Error: Testing LogError\(\) basic function/', $result); $this->assertRegExp('/Error: Testing LogError\(\) basic function/', $result);

View file

@ -17,6 +17,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
App::uses('ShellDispatcher', 'Console'); App::uses('ShellDispatcher', 'Console');
App::uses('Shell', 'Console'); App::uses('Shell', 'Console');
App::uses('AclShell', 'Console/Command'); App::uses('AclShell', 'Console/Command');

View file

@ -17,6 +17,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
App::uses('ShellDispatcher', 'Console'); App::uses('ShellDispatcher', 'Console');
App::uses('Shell', 'Console'); App::uses('Shell', 'Console');
App::uses('ApiShell', 'Console/Command'); App::uses('ApiShell', 'Console/Command');

View file

@ -18,6 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
App::uses('ShellDispatcher', 'Console'); App::uses('ShellDispatcher', 'Console');
App::uses('Shell', 'Console'); App::uses('Shell', 'Console');
App::uses('BakeShell', 'Console/Command'); App::uses('BakeShell', 'Console/Command');

View file

@ -17,6 +17,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
App::uses('ShellDispatcher', 'Console'); App::uses('ShellDispatcher', 'Console');
App::uses('Shell', 'Console'); App::uses('Shell', 'Console');
App::uses('CakeSchema', 'Model'); App::uses('CakeSchema', 'Model');

View file

@ -20,6 +20,8 @@
*/ */
App::uses('Folder', 'Utility'); App::uses('Folder', 'Utility');
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
App::uses('ShellDispatcher', 'Console'); App::uses('ShellDispatcher', 'Console');
App::uses('Shell', 'Console'); App::uses('Shell', 'Console');
App::uses('ExtractTask', 'Console/Command/Task'); App::uses('ExtractTask', 'Console/Command/Task');