Files
Phraseanet/tests/Alchemy/Phrasea/Command/CommandTest.php
Romain Neutron f3e2bb03e2 Update tests
2012-10-04 15:43:15 +02:00

52 lines
1.1 KiB
PHP

<?php
namespace Alchemy\Phrasea\Command;
use Alchemy\Phrasea\Application;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class CommandTest extends \PHPUnit_Framework_TestCase
{
/**
* @var Command
*/
protected $object;
protected function setUp()
{
$this->object = new AbstractCommandTester('name');
}
/**
* @covers Alchemy\Phrasea\Command\Command::checkSetup
*/
public function testCheckSetup()
{
$this->object->setContainer(self::$application);
$this->object->checkSetup();
}
/**
* @covers Alchemy\Phrasea\Command\Command::getFormattedDuration
*/
public function testGetFormattedDuration()
{
$this->assertRegExp('/50 \w+/', $this->object->getFormattedDuration(50));
$this->assertRegExp('/1(\.|,)2 \w+/', $this->object->getFormattedDuration(70));
}
}
class AbstractCommandTester extends Command
{
public function requireSetup()
{
return true;
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
}
}