Completed
Push — master ( 0d1509...999927 )
by Danny
02:43
created

RabbitMqSupervisorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 33
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace MyOnlineStore\Bundle\RabbitMqManagerBundle\Tests\Command;
4
5
use MyOnlineStore\Bundle\RabbitMqManagerBundle\Services\RabbitMqSupervisor;
6
use MyOnlineStore\Bundle\RabbitMqManagerBundle\Services\Supervisor;
7
use Symfony\Component\Templating\EngineInterface;
8
9
class RabbitMqSupervisorTest extends \PHPUnit_Framework_TestCase
10
{
11
    /**
12
     * @var \PHPUnit_Framework_MockObject_MockObject|Supervisor
13
     */
14
    private $supervisor;
15
16
    /**
17
     * @var \PHPUnit_Framework_MockObject_MockObject|EngineInterface
18
     */
19
    private $templating;
20
21
    protected function setUp()
22
    {
23
        $this->supervisor = $this->getMockBuilder(Supervisor::class)->disableOriginalConstructor()->getMock();
24
        $this->templating = $this->getMock(EngineInterface::class);
25
    }
26
27
    public function testExecute()
28
    {
29
        $this->supervisor->expects(self::once())->method('run');
30
        $this->supervisor->expects(self::once())->method('reloadAndUpdate');
31
32
        $service = new RabbitMqSupervisor(
33
            $this->supervisor,
34
            $this->templating,
35
            [],
36
            []
37
        );
38
39
        $service->start();
40
    }
41
}
42