Completed
Push — master ( c2e487...7ac6a5 )
by Wachter
07:39
created

RunCommandTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 3
dl 0
loc 23
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConfigure() 0 7 1
A testRun() 0 12 1
1
<?php
2
3
namespace Unit\Command;
4
5
use Symfony\Component\Console\Input\InputInterface;
6
use Symfony\Component\Console\Output\OutputInterface;
7
use Task\SchedulerInterface;
8
use Task\TaskBundle\Command\RunCommand;
9
10
class RunCommandTest extends \PHPUnit_Framework_TestCase
11
{
12
    public function testConfigure()
13
    {
14
        $scheduler = $this->prophesize(SchedulerInterface::class);
15
        $command = new RunCommand($scheduler->reveal());
16
17
        $this->assertEquals('task:run', $command->getName());
18
    }
19
20
    public function testRun()
21
    {
22
        $input = $this->prophesize(InputInterface::class);
23
        $output = $this->prophesize(OutputInterface::class);
24
25
        $scheduler = $this->prophesize(SchedulerInterface::class);
26
        $command = new RunCommand($scheduler->reveal());
27
28
        $command->run($input->reveal(), $output->reveal());
29
30
        $scheduler->run()->shouldBeCalledTimes(1);
31
    }
32
}
33