mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
52 lines
1.1 KiB
PHP
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)
|
|
{
|
|
|
|
}
|
|
}
|