GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Branch master (bd52da)
by Andrey
04:54 queued 01:45
created

ContainerHandlerMapperTest::testGet()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 34
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 34
c 0
b 0
f 0
rs 8.8571
cc 2
eloc 20
nc 2
nop 2
1
<?php
2
/**
3
 * (c) itmedia.by <[email protected]>
4
 */
5
6
namespace Itmedia\CommandBusBundle\Tests\Handler;
7
8
use Itmedia\CommandBusBundle\Exception\HandlerNotFoundException;
9
use Itmedia\CommandBusBundle\Handler\ContainerCommandHandlerMapper;
10
use PHPUnit\Framework\TestCase;
11
use Symfony\Component\DependencyInjection\ContainerInterface;
12
13
class ContainerHandlerMapperTest extends TestCase
14
{
15
16
17
    /**
18
     * @dataProvider messages
19
     */
20
    public function testGet($messageName, $success)
21
    {
22
        $callableService = $this->getMockBuilder('CallableService')
23
            ->setMethods(['execute', 'getMethod']);
24
25
26
        $container = $this->createMock(ContainerInterface::class);
27
        $container->expects($this->any())
28
            ->method('get')
29
            ->will($this->returnValue($callableService));
30
31
32
        $mapper = new ContainerCommandHandlerMapper($container, [
33
            'message1' => [
34
                'service' => 'service1',
35
                'method' => 'getMethod'
36
            ],
37
            'message2' => [
38
                'service' => 'service1',
39
                'method' => null
40
            ],
41
            'message3' => [
42
                'service' => 'service1',
43
                'method' => 'hui'
44
            ],
45
        ]);
46
47
48
        if (!$success) {
49
            $this->expectException(HandlerNotFoundException::class);
50
        }
51
52
        $mapper->get($messageName);
53
    }
54
55
56
    public function messages()
57
    {
58
        return [
59
            ['message1', true],
60
            ['message2', true],
61
            ['message_fail', false],
62
        ];
63
    }
64
}
65