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

MapExtensionTest::createExtension()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
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\Twig;
13
14
use Ivory\GoogleMap\Helper\MapHelper;
15
use Ivory\GoogleMap\Map;
16
use Ivory\GoogleMapBundle\Twig\MapExtension;
17
18
/**
19
 * @author GeLo <[email protected]>
20
 */
21
class MapExtensionTest extends AbstractExtensionTest
22
{
23
    /**
24
     * @var MapHelper|\PHPUnit_Framework_MockObject_MockObject
25
     */
26
    private $mapHelper;
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    protected function createExtension()
32
    {
33
        $this->mapHelper = $this->createMapHelperMock();
34
35
        return new MapExtension($this->mapHelper);
36
    }
37
38
    public function testRender()
39
    {
40
        $template = $this->getTwig()->createTemplate('{{ ivory_google_map(map) }}');
41
42
        $this->mapHelper
43
            ->expects($this->once())
44
            ->method('render')
45
            ->with($this->identicalTo($map = $this->createMapMock()))
46
            ->will($this->returnValue($result = 'result'));
47
48
        $this->assertSame($result, $template->render(['map' => $map]));
49
    }
50
51
    public function testRenderHtml()
52
    {
53
        $template = $this->getTwig()->createTemplate('{{ ivory_google_map_container(map) }}');
54
55
        $this->mapHelper
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, $template->render(['map' => $map]));
62
    }
63
64
    public function testRenderStylesheet()
65
    {
66
        $template = $this->getTwig()->createTemplate('{{ ivory_google_map_css(map) }}');
67
68
        $this->mapHelper
69
            ->expects($this->once())
70
            ->method('renderStylesheet')
71
            ->with($this->identicalTo($map = $this->createMapMock()))
72
            ->will($this->returnValue($result = 'result'));
73
74
        $this->assertSame($result, $template->render(['map' => $map]));
75
    }
76
77
    public function testRenderJavascript()
78
    {
79
        $template = $this->getTwig()->createTemplate('{{ ivory_google_map_js(map) }}');
80
81
        $this->mapHelper
82
            ->expects($this->once())
83
            ->method('renderJavascript')
84
            ->with($this->identicalTo($map = $this->createMapMock()))
85
            ->will($this->returnValue($result = 'result'));
86
87
        $this->assertSame($result, $template->render(['map' => $map]));
88
    }
89
90
    /**
91
     * @return \PHPUnit_Framework_MockObject_MockObject|MapHelper
92
     */
93
    private function createMapHelperMock()
94
    {
95
        return $this->createMock(MapHelper::class);
96
    }
97
98
    /**
99
     * @return \PHPUnit_Framework_MockObject_MockObject|Map
100
     */
101
    private function createMapMock()
102
    {
103
        return $this->createMock(Map::class);
104
    }
105
}
106