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 ( 936777...562b59 )
by Eric
06:38
created

MapHelperTest::testRenderJavascript()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map bundle package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMapBundle\Tests\Templating;
13
14
use Ivory\GoogleMap\Helper\MapHelper as BaseMapHelper;
15
use Ivory\GoogleMap\Map;
16
use Ivory\GoogleMapBundle\Templating\MapHelper;
17
18
/**
19
 * @author GeLo <[email protected]>
20
 */
21
class MapHelperTest extends \PHPUnit_Framework_TestCase
22
{
23
    /**
24
     * @var MapHelper
25
     */
26
    private $mapHelper;
27
28
    /**
29
     * @var BaseMapHelper|\PHPUnit_Framework_MockObject_MockObject
30
     */
31
    private $innerMapHelper;
32
33
    /**
34
     * {@inheritdoc}
35
     */
36
    protected function setUp()
37
    {
38
        $this->innerMapHelper = $this->createMapHelperMock();
39
        $this->mapHelper = new MapHelper($this->innerMapHelper);
40
    }
41
42
    public function testRender()
43
    {
44
        $this->innerMapHelper
45
            ->expects($this->once())
46
            ->method('render')
47
            ->with($this->identicalTo($map = $this->createMapMock()))
48
            ->will($this->returnValue($result = 'result'));
49
50
        $this->assertSame($result, $this->mapHelper->render($map));
51
    }
52
53
    public function testRenderHtml()
54
    {
55
        $this->innerMapHelper
56
            ->expects($this->once())
57
            ->method('renderHtml')
58
            ->with($this->identicalTo($map = $this->createMapMock()))
59
            ->will($this->returnValue($result = 'result'));
60
61
        $this->assertSame($result, $this->mapHelper->renderHtml($map));
62
    }
63
64
    public function testRenderStylesheet()
65
    {
66
        $this->innerMapHelper
67
            ->expects($this->once())
68
            ->method('renderStylesheet')
69
            ->with($this->identicalTo($map = $this->createMapMock()))
70
            ->will($this->returnValue($result = 'result'));
71
72
        $this->assertSame($result, $this->mapHelper->renderStylesheet($map));
73
    }
74
75
    public function testRenderJavascript()
76
    {
77
        $this->innerMapHelper
78
            ->expects($this->once())
79
            ->method('renderJavascript')
80
            ->with($this->identicalTo($map = $this->createMapMock()))
81
            ->will($this->returnValue($result = 'result'));
82
83
        $this->assertSame($result, $this->mapHelper->renderJavascript($map));
84
    }
85
86
    public function testName()
87
    {
88
        $this->assertSame('ivory_google_map', $this->mapHelper->getName());
89
    }
90
91
    /**
92
     * @return \PHPUnit_Framework_MockObject_MockObject|BaseMapHelper
93
     */
94
    private function createMapHelperMock()
95
    {
96
        return $this->createMock(BaseMapHelper::class);
97
    }
98
99
    /**
100
     * @return \PHPUnit_Framework_MockObject_MockObject|Map
101
     */
102
    private function createMapMock()
103
    {
104
        return $this->createMock(Map::class);
105
    }
106
}
107