Skip to content

Commit

Permalink
Update test case Log folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed May 26, 2012
1 parent 34b85cd commit 540922a
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 128 deletions.
26 changes: 15 additions & 11 deletions lib/Cake/Test/TestCase/Log/Engine/ConsoleLogTest.php
Expand Up @@ -16,13 +16,17 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('ConsoleLog', 'Log/Engine');

namespace Cake\Test\TestCase\Log\Engine;
use Cake\TestSuite\TestCase;
use Cake\Log\Engine\ConsoleLog;
use Cake\Log\Log;

class TestConsoleLog extends ConsoleLog {

}

class TestCakeLog extends CakeLog {
class TestCakeLog extends Log {

public static function replace($key, &$engine) {
self::$_Collection->{$key} = $engine;
Expand All @@ -35,17 +39,17 @@ public static function replace($key, &$engine) {
*
* @package Cake.Test.Case.Log.Engine
*/
class ConsoleLogTest extends CakeTestCase {
class ConsoleLogTest extends TestCase {

public function setUp() {
parent::setUp();
CakeLog::config('debug', array(
'engine' => 'FileLog',
Log::config('debug', array(
'engine' => 'Cake\Log\Engine\FileLog',
'types' => array('notice', 'info', 'debug'),
'file' => 'debug',
));
CakeLog::config('error', array(
'engine' => 'FileLog',
Log::config('error', array(
'engine' => 'Cake\Log\Engine\FileLog',
'types' => array('error', 'warning'),
'file' => 'error',
));
Expand All @@ -66,10 +70,10 @@ public function tearDown() {
*/
public function testConsoleOutputWrites() {
TestCakeLog::config('test_console_log', array(
'engine' => 'TestConsoleLog',
'engine' => __NAMESPACE__ . '\TestConsoleLog',
));

$mock = $this->getMock('TestConsoleLog', array('write'), array(
$mock = $this->getMock(__NAMESPACE__ . '\TestConsoleLog', array('write'), array(
array('types' => 'error'),
));
TestCakeLog::replace('test_console_log', $mock);
Expand All @@ -85,9 +89,9 @@ public function testConsoleOutputWrites() {
*/
public function testCombinedLogWriting() {
TestCakeLog::config('test_console_log', array(
'engine' => 'TestConsoleLog',
'engine' => __NAMESPACE__ . '\TestConsoleLog',
));
$mock = $this->getMock('TestConsoleLog', array('write'), array(
$mock = $this->getMock(__NAMESPACE__ . '\TestConsoleLog', array('write'), array(
array('types' => 'error'),
));
TestCakeLog::replace('test_console_log', $mock);
Expand Down
6 changes: 4 additions & 2 deletions lib/Cake/Test/TestCase/Log/Engine/FileLogTest.php
Expand Up @@ -16,14 +16,16 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::uses('FileLog', 'Log/Engine');
namespace Cake\Test\TestCase\Log\Engine;
use Cake\TestSuite\TestCase,
Cake\Log\Engine\FileLog;

/**
* CakeLogTest class
*
* @package Cake.Test.Case.Log.Engine
*/
class FileLogTest extends CakeTestCase {
class FileLogTest extends TestCase {

/**
* testLogFileWriting method
Expand Down

0 comments on commit 540922a

Please sign in to comment.