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.
Completed
Push — master ( c87318...99f3de )
by Bruno
30:58
created

YumlControllerTest::testIndexAction()   C

Complexity

Conditions 8
Paths 1

Size

Total Lines 49
Code Lines 35

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 49
rs 6.1403
cc 8
eloc 35
nc 1
nop 0
1
<?php
2
3
namespace OnurbTest\Bundle\YumlBundle\Controller;
4
5
use Onurb\Bundle\YumlBundle\Controller\YumlController;
6
use PHPUnit\Framework\TestCase;
7
use Symfony\Component\DependencyInjection\ContainerInterface;
8
use Symfony\Component\HttpFoundation\RedirectResponse;
9
10
class YumlControllerTest extends TestCase
11
{
12
    /**
13
     * @var ContainerInterface
14
     */
15
    protected $container;
16
17
    /**
18
     * @var string
19
     */
20
    protected $controllerName = 'Onurb\\Bundle\\YumlBundle\\Controller\\YumlController';
21
22
    /**
23
     * @covers \Onurb\Bundle\YumlBundle\Controller\YumlController
24
     */
25
    public function testIndexAction()
26
    {
27
        $yumlClient = $this->createMock('Onurb\\Bundle\\YumlBundle\\Yuml\\YumlClientInterface');
28
29
        $yumlClient->expects($this->once())
30
            ->method('makeDslText')
31
            ->will($this->returnValue('[Simple.Entity|+a;b;c]'));
32
33
        $yumlClient->expects($this->once())
34
            ->method('getGraphUrl')
35
            ->will($this->returnValue('https://yuml.me/15a98c92.png'));
36
37
        $this->container = $this->createMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
0 ignored issues
show
Documentation Bug introduced by HERON
It seems like $this->createMock('Symfo...n\\ContainerInterface') of type object<PHPUnit\Framework\MockObject\MockObject> is incompatible with the declared type object<Symfony\Component...ion\ContainerInterface> of property $container.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
38
39
        $this->container->expects($this->once())->method('get')
40
            ->with($this->matches('onurb_yuml.client'))
41
            ->will($this->returnValue($yumlClient));
42
43
        $this->container->expects($this->any())->method('getParameter')
44
            ->will(
45
                $this->returnCallback(
46
                    function ($arg) {
47
                        switch ($arg) {
48
                            case 'onurb_yuml.show_fields_description':
49
                                return false;
50
                            case 'onurb_yuml.colors':
51
                            case 'onurb_yuml.notes':
52
                                return array();
53
                            case 'onurb_yuml.extension':
54
                                return 'png';
55
                            case 'onurb_yuml.style':
56
                                return 'plain';
57
                            case 'onurb_yuml.direction':
58
                                return 'TB';
59
                            case 'onurb_yuml.scale':
60
                                return 'normal';
61
                            default:
62
                                return false;
63
                        }
64
                    }
65
                )
66
            );
67
68
        $controller = $this->createController();
69
70
        $response = $controller->indexAction();
71
72
        $this->assertTrue($response instanceof RedirectResponse);
73
    }
74
75
    protected function createController()
76
    {
77
        /**
78
         * @var YumlController $controller
79
         */
80
        $controller = new $this->controllerName;
81
        $controller->setContainer($this->container);
82
83
        return($controller);
84
    }
85
}
86