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.

CreditsTest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A testEnabled() 0 10 1
A setUp() 0 5 1
A testHref() 0 7 1
A testPosition() 0 13 1
A testStyle() 0 12 1
A testText() 0 7 1
1
<?php
2
3
namespace Ob\HighchartsBundle\Tests\Highstock;
4
5
use Ob\HighchartsBundle\Highcharts\Highstock;
6
use PHPUnit\Framework\TestCase;
7
8
class CreditsTest extends TestCase
9
{
10
    protected $chart;
11
    protected $credits;
12
13
    protected function setUp()
14
    {
15
        $this->chart = new Highstock();
16
        $this->credits = $this->chart->credits;
17
    }
18
19
    public function testEnabled()
20
    {
21
        $this->credits->enabled(true);
22
        $this->assertTrue($this->credits->enabled);
23
        $this->assertRegExp('/"enabled":true/', $this->chart->render());
24
25
        $this->credits->enabled(false);
26
        $this->assertFalse($this->credits->enabled);
27
        $this->assertRegExp('/"enabled":false/', $this->chart->render());
28
    }
29
30
    public function testHref()
31
    {
32
        $link = "http://www.highcharts.com";
33
        $this->credits->href($link);
34
        $this->assertEquals($link, $this->credits->href);
35
//        $this->assertRegExp('/"href":"http:\/\/www\.highcharts\.com"/', $this->chart->render());
36
    }
37
38
    public function testPosition()
39
    {
40
        $position = array(
41
            'align' => 'right',
42
            'x' => -10,
43
            'verticalAlign' => 'bottom',
44
            'y' => -5
45
        );
46
47
        $this->credits->position($position);
48
        $this->assertEquals($this->credits->position, $position);
49
        $this->assertRegExp('/"position":{"align":"right","x":-10,"verticalAlign":"bottom","y":-5}/', $this->chart->render());
50
    }
51
52
    public function testStyle()
53
    {
54
        $style = array(
55
            'cursor' => 'pointer',
56
            'color' => '#909090',
57
            'fontSize' => '10px'
58
        );
59
60
        $this->credits->style($style);
61
        $this->assertEquals($style, $this->credits->style);
62
        $this->assertRegExp('/"style":{"cursor":"pointer","color":"#909090","fontSize":"10px"}/', $this->chart->render());
63
    }
64
65
    public function testText()
66
    {
67
        $text = "Highcharts.com";
68
        $this->credits->text($text);
69
        $this->assertEquals($text, $this->credits->text);
70
        $this->assertRegExp('/"text":"Highcharts.com"/', $this->chart->render());
71
    }
72
}
73