Fix CS in unit tests + remove unused unit tests

This commit is contained in:
Romain Neutron
2012-05-10 17:08:01 +02:00
parent 21c2d15754
commit 17cd58f5e1
224 changed files with 16423 additions and 22543 deletions

View File

@@ -3,39 +3,34 @@
require_once __DIR__ . '/../../PhraseanetWebTestCaseAuthenticatedAbstract.class.inc';
use Symfony\Component\Console\Tester\CommandTester;
use \Symfony\Component\Console\Application;
use Symfony\Component\Console\Application;
class module_console_tasklistTest extends PHPUnit_Framework_TestCase
{
/**
* @covers module_console_tasklist::execute
*/
public function testExecute()
{
// mock the Kernel or create one depending on your needs
$application = new Application();
$application->add(new module_console_tasklist('task:list'));
$command = $application->find('task:list');
$commandTester = new CommandTester($command);
$commandTester->execute(array('command' => $command->getName()));
$task_manager = new task_manager(appbox::get_instance(\bootstrap::getCore()));
$lines = explode("\n", trim($commandTester->getDisplay()));
if(count($task_manager->get_tasks()) > 0)
/**
* @covers module_console_tasklist::execute
*/
public function testExecute()
{
$this->assertEquals(count($task_manager->get_tasks()), count($lines));
foreach($task_manager->get_tasks() as $task)
{
$this->assertTrue(strpos($commandTester->getDisplay(), $task->get_title()) !== false);
}
}
else
{
$this->assertEquals(1, $n_lines);
}
}
// mock the Kernel or create one depending on your needs
$application = new Application();
$application->add(new module_console_tasklist('task:list'));
$command = $application->find('task:list');
$commandTester = new CommandTester($command);
$commandTester->execute(array('command' => $command->getName()));
$task_manager = new task_manager(appbox::get_instance(\bootstrap::getCore()));
$lines = explode("\n", trim($commandTester->getDisplay()));
if (count($task_manager->get_tasks()) > 0) {
$this->assertEquals(count($task_manager->get_tasks()), count($lines));
foreach ($task_manager->get_tasks() as $task) {
$this->assertTrue(strpos($commandTester->getDisplay(), $task->get_title()) !== false);
}
} else {
$this->assertEquals(1, $n_lines);
}
}
}