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.

ScrollbarTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 18
rs 9.4285
cc 1
eloc 15
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 series option
10
 */
11
class ScrollbarTest extends TestCase
12
{
13
    /**
14
     * @var array
15
     */
16
    private $scrollbar;
17
18
    /*
19
     * @var array
20
     */
21
    private $usedOptions = array();
22
23
    /**
24
     * Initialises the data
25
     */
26
    public function setUp()
27
    {
28
        $this->scrollbar = array(
29
            'enabled' => true,
30
            'barBackgroundColor' => 'gray',
31
            'barBorderRadius' => 7,
32
            'barBorderWidth' => 0,
33
            'buttonBackgroundColor' => 'gray',
34
            'buttonBorderWidth' => 0,
35
            'buttonArrowColor' => 'yellow',
36
            'buttonBorderRadius' => 7,
37
            'rifleColor' => 'yellow',
38
            'trackBackgroundColor' => 'white',
39
            'trackBorderWidth' => 1,
40
            'trackBorderColor' => 'silver',
41
            'trackBorderRadius' => 7
42
        );
43
    }
44
45
    /**
46
     * Scrollbar config output
47
     */
48
    public function testConfig()
49
    {
50
        $chart = new Highchart();
51
        foreach ($this->scrollbar as $key => $value) {
52
            // Config randomization
53
            if(mt_rand(0, 5) === 0) continue;
54
55
            $this->usedOptions[$key] = $value;
56
            $chart->scrollbar->$key($value);
57
        }
58
59
        preg_match('|scrollbar: (\{[^\}]+\})+|', $chart->render(), $matches);
60
        $options = json_decode($matches[1], true);
61
62
        $this->assertEquals(count($this->usedOptions), count(array_intersect($this->usedOptions, $options)));
63
    }
64
}
65