Browse Source

Test logging from CliController

master^2
Anton Terekhov 12 years ago
parent
commit
f7b6837b91
  1. 18
      tests/app/CliControllerTest.php

18
tests/app/CliControllerTest.php

@ -17,6 +17,8 @@ require_once __DIR__ . '/../../app/CliController.php';
require_once __DIR__ . '/../../Registry.php';
require_once __DIR__ . '/../../Config.php';
require_once __DIR__ . '/../../app/iCli.php';
require_once __DIR__ . '/../../logger/Logger.php';
require_once __DIR__ . '/../../logger/CliLogger.php';
/**
* @desc CliController tests
@ -55,6 +57,22 @@ class CliControllerTest extends PHPUnit_Framework_TestCase
$this->assertContains('Elapsed time:', $output);
}
public function testExecuteWithLogger()
{
ob_start();
Config::set('PROFILER', true);
Config::set('LOGGING', true);
Config::set('Logger', array('logger' => 'CliLogger'));
$cli_class = $this->getMockForAbstractClass('iCli', array(), '', '', '', '', array('run'));
$cli_class->expects($this->once())
->method('run')
->with();
CliController::getInstance()->execute($cli_class);
$output = ob_get_clean();
$this->assertContains('Elapsed time:', $output);
}
/**
* @runInSeparateProcess
*/

Loading…
Cancel
Save