Failed Conditions
Branch master (135283)
by Michel
07:28
created

CommandHandlerFactoryTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testInvoke() 0 12 1
1
<?php
2
declare(strict_types=1);
3
4
namespace TogglJiraTest\Handler;
5
6
use Psr\Log\LoggerInterface;
7
use TogglJira\Handler\CommandHandler;
8
use TogglJira\Handler\CommandHandlerFactory;
9
use TogglJiraTest\BaseContainerTestCase;
10
11
class CommandHandlerFactoryTest extends BaseContainerTestCase
12
{
13
    public function testInvoke()
14
    {
15
        $factory = new CommandHandlerFactory();
16
17
        $loggerMock = \Mockery::mock(LoggerInterface::class);
1 ignored issue
show
Bug introduced by
Psr\Log\LoggerInterface::class of type string is incompatible with the type array expected by parameter $args of Mockery::mock(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

17
        $loggerMock = \Mockery::mock(/** @scrutinizer ignore-type */ LoggerInterface::class);
Loading history...
18
        $this->getContainer()
19
            ->shouldReceive('get')
1 ignored issue
show
Bug introduced by
'get' of type string is incompatible with the type array expected by parameter $methodNames of Mockery\MockInterface::shouldReceive(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
            ->shouldReceive(/** @scrutinizer ignore-type */ 'get')
Loading history...
20
            ->once()
21
            ->withArgs(['Logger'])
22
            ->andReturn($loggerMock);
2 ignored issues
show
Bug introduced by
$loggerMock of type Mockery\MockInterface is incompatible with the type array<mixed,mixed> expected by parameter $args of Mockery\Expectation::andReturn(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

22
            ->andReturn(/** @scrutinizer ignore-type */ $loggerMock);
Loading history...
Bug introduced by
$loggerMock of type Mockery\MockInterface is incompatible with the type array expected by parameter $args of Mockery\ExpectationInterface::andReturn(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

22
            ->andReturn(/** @scrutinizer ignore-type */ $loggerMock);
Loading history...
23
24
        $this->assertInstanceOf(CommandHandler::class, $factory($this->getContainer(), ''));
25
    }
26
}
27