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.

TwigTest::testTwigExtension()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 25
rs 8.8571
cc 1
eloc 13
nc 1
nop 0
1
<?php
2
3
namespace Ob\HighchartsBundle\Tests\Highcharts;
4
5
use Ob\HighchartsBundle\Highcharts\Highchart;
6
use Ob\HighchartsBundle\Twig\HighchartsExtension;
7
use PHPUnit\Framework\TestCase;
8
9
/**
10
 * This class hold Unit tests for the Twig extension
11
 */
12
class TwigTest extends TestCase
13
{
14
    /**
15
     * Chart rendering using the twig extension
16
     */
17
    public function testTwigExtension()
18
    {
19
        $chart = new Highchart();
20
        $extension = new HighchartsExtension();
21
22
        $this->assertEquals('highcharts_extension', $extension->getName());
23
24
        // render with jquery
25
        $this->assertRegExp(
26
            '/\$\(function\s?\(\)\s?\{\n?\r?\s*var chart = new Highcharts.Chart\(\{\n?\r?\s*\}\);\n?\r?\s*\}\);/',
27
            $extension->chart($chart)
28
        );
29
30
        // render with jquery explicitly
31
        $this->assertRegExp(
32
            '/\$\(function\s?\(\)\s?\{\n?\r?\s*var chart = new Highcharts.Chart\(\{\n?\r?\s*\}\);\n?\r?\s*\}\);/',
33
            $extension->chart($chart, 'jquery')
34
        );
35
36
        // render with mootools
37
        $this->assertRegExp(
38
            '/window.addEvent\(\'domready\', function\s?\(\)\s?\{\r?\n?\s*var chart = new Highcharts.Chart\(\{\n?\r?\s*\}\);\n?\r?\s*\}\);/',
39
            $extension->chart($chart, 'mootools')
40
        );
41
    }
42
}
43