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.

HighchartTest::testSetGet()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace Ob\HighchartsBundle\Tests\Highcharts;
4
5
use Ob\HighchartsBundle\Highcharts\Highchart;
6
use PHPUnit\Framework\TestCase;
7
8
/**
9
 * This class hold Unit tests for the Highchart Class
10
 */
11
class HighchartTest extends TestCase
12
{
13
    /**
14
     * Render chart using jQuery
15
     */
16
    public function testJquery()
17
    {
18
        $chart = new Highchart();
19
        $this->assertRegExp(
20
            '/\$\(function\s?\(\)\s?\{\n?\r?\s*var chart = new Highcharts.Chart\(\{\n?\r?\s*\}\);\n?\r?\s*\}\);/',
21
            $chart->render()
22
        );
23
    }
24
25
    /**
26
     * Render chart without library wrapper
27
     */
28
    public function testNoEngine()
29
    {
30
        $chart = new Highchart();
31
        $this->assertRegExp(
32
            '/var chart = new Highcharts.Chart\(\{\n?\r?\s*\}\);/',
33
            $chart->render(null)
34
        );
35
    }
36
37
    /**
38
     * Render chart using Mootools
39
     */
40
    public function testMooTools()
41
    {
42
        $chart = new Highchart();
43
        $this->assertRegExp(
44
            '/window.addEvent\(\'domready\', function\s?\(\)\s?\{\r?\n?\s*var chart = new Highcharts.Chart\(\{\n?\r?\s*\}\);\n?\r?\s*\}\);/',
45
            $chart->render('mootools')
46
        );
47
    }
48
49
    /**
50
     * Magic getters and setters
51
     */
52
    public function testSetGet()
53
    {
54
        $chart = new Highchart();
55
56
        $chart->credits->enabled(false);
57
        $this->assertTrue($chart->credits->enabled == false);
58
59
        $chart->credits->enabled(true);
60
        $this->assertTrue($chart->credits->enabled == true);
61
    }
62
63
    /**
64
     * Look for that mean trailing comma
65
     */
66
    public function testIeFriendliness()
67
    {
68
        $chart = new Highchart();
69
70
        $chart->chart->setTitle('Am I IE friendly yet?');
71
        $this->assertRegExp(
72
            '/\}(?<!,)\n?\r?\s*\}\);\n?\r?\s*\}\);/',
73
            $chart->render()
74
        );
75
    }
76
}
77