Files
Phraseanet/tests/module/console/module_console_aboutLicenseTest.php
Romain Neutron 26aca64645 Upgrade tests
2012-07-27 18:30:18 +02:00

34 lines
982 B
PHP

<?php
require_once __DIR__ . '/../../PhraseanetWebTestCaseAuthenticatedAbstract.class.inc';
use Alchemy\Phrasea\CLI;
use Symfony\Component\Console\Tester\CommandTester;
class module_console_aboutLicenseTest extends PHPUnit_Framework_TestCase
{
/**
* @var module_console_aboutLicense
*/
protected $object;
/**
* @covers module_console_aboutAuthors::execute
*/
public function testExecute()
{
// mock the Kernel or create one depending on your needs
$application = new CLI('test');
$application->command(new module_console_aboutLicense('about:license'));
$command = $application['console']->find('about:license');
$commandTester = new CommandTester($command);
$commandTester->execute(array('command' => $command->getName()));
$this->assertEquals(
trim(file_get_contents(__DIR__ . '/../../../LICENSE'))
, trim($commandTester->getDisplay())
);
}
}