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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 18 1
A testConfig() 0 16 3
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