SyncCommandFactoryTest::testInvoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 21
c 2
b 0
f 0
dl 0
loc 28
rs 9.584
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace TogglJiraTest\Command;
5
6
use Psr\Log\LoggerInterface;
7
use TogglJira\Command\SyncCommand;
8
use TogglJira\Command\SyncCommandFactory;
9
use TogglJira\Options\SyncOptions;
10
use TogglJira\Service\SyncService;
11
use TogglJiraTest\BaseContainerTest;
12
13
class SyncCommandFactoryTest extends BaseContainerTest
14
{
15
    public function testInvoke()
16
    {
17
        $syncOptionMock = \Mockery::mock(SyncOptions::class);
18
        $syncServiceMock = \Mockery::mock(SyncService::class);
19
        $loggerMock = \Mockery::mock(LoggerInterface::class);
20
21
        $this->getContainer()
22
            ->shouldReceive('get')
23
            ->once()
24
            ->withArgs([SyncOptions::class])
25
            ->andReturn($syncOptionMock);
26
27
        $this->getContainer()
28
            ->shouldReceive('get')
29
            ->once()
30
            ->withArgs([SyncService::class])
31
            ->andReturn($syncServiceMock);
32
33
        $this->getContainer()
34
            ->shouldReceive('get')
35
            ->once()
36
            ->withArgs(['Logger'])
37
            ->andReturn($loggerMock);
38
39
        $factory = new SyncCommandFactory();
40
        $instance = $factory->__invoke($this->getContainer(), SyncCommand::class);
41
42
        $this->assertInstanceOf(SyncCommand::class, $instance);
43
    }
44
}
45