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 ( cd261d...1a4b18 )
by Bruno
41:57
created

YumlControllerTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 53
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
B testIndexAction() 0 25 1
A createController() 0 10 1
1
<?php
2
3
namespace OnurbTest\Bundle\YumlBundle\Controller;
4
5
use Onurb\Bundle\YumlBundle\Controller\YumlController;
6
7
use Symfony\Component\DependencyInjection\ContainerInterface;
8
use Symfony\Component\HttpFoundation\RedirectResponse;
9
10
class YumlControllerTest extends \PHPUnit_Framework_TestCase
11
{
12
13
    /**
14
     * @var ContainerInterface
15
     */
16
    protected $container;
17
18
    /**
19
     * @var string
20
     */
21
    protected $controllerName = 'Onurb\\Bundle\\YumlBundle\\Controller\\YumlController';
22
23
    /**
24
     * @covers \Onurb\Bundle\YumlBundle\Controller\YumlController
25
     */
26
    public function testIndexAction()
27
    {
28
        $yumlClient = $this->getMock('Onurb\\Bundle\\YumlBundle\\Yuml\\YumlClientInterface');
29
30
        $yumlClient->expects($this->once())
31
            ->method('makeDslText')
32
            ->will($this->returnValue('[Simple.Entity|+a;b;c]'));
33
34
        $yumlClient->expects($this->once())
35
            ->method('getGraphUrl')
36
            ->will($this->returnValue('http://yuml.me/15a98c92.png'));
37
38
        $this->container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
39
40
        $this->container->expects($this->once())->method('get')
41
            ->with($this->matches('onurb.doctrine_yuml.client'))
42
            ->will($this->returnValue($yumlClient));
43
44
        $controller = $this->createController();
45
46
        $response = $controller->indexAction();
47
48
        //On teste si la r�ponse est bien une redirection.
49
        $this->assertTrue($response instanceof RedirectResponse);
50
    }
51
52
    protected function createController()
53
    {
54
        /**
55
         * @var \Onurb\Bundle\YumlBundle\Controller\YumlController $controller
56
         */
57
        $controller = new $this->controllerName;
58
        $controller->setContainer($this->container);
59
60
        return($controller);
61
    }
62
}
63