Files
Phraseanet/lib/unitTest/module/console/module_console_systemTemplateGeneratorTest.php
Romain Neutron 4c5b7eb658 V 3.5 RC 1
2011-12-05 00:23:28 +01:00

34 lines
1.2 KiB
PHP

<?php
require_once dirname(__FILE__) . '/../../PhraseanetWebTestCaseAuthenticatedAbstract.class.inc';
use Symfony\Component\Console\Tester\CommandTester;
use \Symfony\Component\Console\Application;
/**
* Test class for module_console_systemTemplateGenerator.
* Generated by PHPUnit on 2011-11-03 at 16:11:08.
*/
class module_console_systemTemplateGeneratorTest extends PHPUnit_Framework_TestCase
{
public function testExecute()
{
// mock the Kernel or create one depending on your needs
$application = new Application();
$application->add(new module_console_systemTemplateGenerator('system:templateGenerator'));
$command = $application->find('system:templateGenerator');
$commandTester = new CommandTester($command);
$commandTester->execute(array('command' => $command->getName()));
$lines = explode("\n", trim($commandTester->getDisplay()));
$last_line = array_pop(explode("\n", trim($commandTester->getDisplay())));
$this->assertTrue(strpos($last_line, 'templates failed') === false, 'Some templates failed');
$this->assertTrue(strpos($last_line, 'templates generated') !== true, 'Some templates have been generated');
}
}
?>