Completed
Push — master ( f4b85b...244823 )
by Alexandre
02:30
created

QueueFlushCommandTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 5
Metric Value
wmc 1
lcom 1
cbo 5
dl 14
loc 14
rs 10

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
use Symfony\Component\Console\Tester\CommandTester;
4
use Symfony\Bundle\FrameworkBundle\Console\Application;
5
use Heri\Bundle\JobQueueBundle\Tests\TestCase;
6
use Heri\Bundle\JobQueueBundle\Command\QueueFlushCommand;
7
8
class QueueFlushCommandTest extends TestCase
9
{
10
    public function testExecute()
11
    {
12
        $application = new Application($this->kernel);
13
        $application->add(new QueueFlushCommand());
14
15
        $command = $application->find('jobqueue:flush');
16
        $commandTester = new CommandTester($command);
17
        $commandTester->execute(array('command' => $command->getName()));
18
19
        $this->assertRegExp('/Cleaned exceptions/', $commandTester->getDisplay());
20
    }
21
}
22