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 ( bb8806...1a2c53 )
by Marc
10s
created

ScrollbarTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

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