|
|
@ -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 |
|
|
|
*/ |
|
|
|