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

RangeSelectorTest   A

Complexity

Total Complexity 16

Size/Duplication

Total Lines 132
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 16
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 132
rs 10

16 Methods

Rating   Name   Duplication   Size   Complexity  
A testButtonTheme() 0 4 1
A testInputDateParser() 0 4 1
A testInputStyle() 0 4 1
A testLabelStyle() 0 4 1
A setUp() 0 5 1
A testButtonSpacing() 0 7 1
A testButtons() 0 12 1
A testEnabled() 0 10 1
A testInputBoxBorderColor() 0 7 1
A testInputBoxHeight() 0 7 1
A testInputBoxWidth() 0 7 1
A testInputDateFormat() 0 7 1
A testInputEditDateFormat() 0 7 1
A testinputEnabled() 0 10 1
A testInputPosition() 0 9 1
A testSelected() 0 7 1
1
<?php
2
3
namespace Ob\HighchartsBundle\Tests\Highstock;
4
5
use Ob\HighchartsBundle\Highcharts\Highstock;
6
7
class RangeSelectorTest extends \PHPUnit_Framework_TestCase
8
{
9
    protected $chart;
10
    protected $range;
11
12
    protected function setUp()
13
    {
14
        $this->chart = new Highstock();
15
        $this->range = $this->chart->rangeSelector;
16
    }
17
18
    public function testButtonSpacing()
19
    {
20
        $spacing = 0;
21
        $this->range->buttonSpacing($spacing);
22
        $this->assertEquals($spacing, $this->range->buttonSpacing);
23
        $this->assertRegExp('/"buttonSpacing":0/', $this->chart->render());
24
    }
25
26
    public function testButtonTheme()
27
    {
28
        $this->markTestIncomplete();
29
    }
30
31
    public function testButtons()
32
    {
33
        $buttons = array(array(
34
            'type' => 'month',
35
                'count' => 3,
36
                'text' => '3m'
37
        ));
38
39
        $this->range->buttons($buttons);
40
        $this->assertEquals($buttons, $this->range->buttons);
41
        $this->assertRegExp('/"buttons":\[{"type":"month","count":3,"text":"3m"}\]/', $this->chart->render());
42
    }
43
44
    public function testEnabled()
45
    {
46
        $this->range->enabled(true);
47
        $this->assertTrue($this->range->enabled);
48
        $this->assertRegExp('/"enabled":true/', $this->chart->render());
49
50
        $this->range->enabled(false);
51
        $this->assertFalse($this->range->enabled);
52
        $this->assertRegExp('/"enabled":false/', $this->chart->render());
53
    }
54
55
    public function testInputBoxBorderColor()
56
    {
57
        $color = 'silver';
58
        $this->range->inputBoxBorderColor($color);
59
        $this->assertEquals($color, $this->range->inputBoxBorderColor);
60
        $this->assertRegExp('/"inputBoxBorderColor":"silver"/', $this->chart->render());
61
    }
62
63
    public function testInputBoxHeight()
64
    {
65
        $height = 16;
66
        $this->range->inputBoxHeight($height);
67
        $this->assertEquals($height, $this->range->inputBoxHeight);
68
        $this->assertRegExp('/"inputBoxHeight":16/', $this->chart->render());
69
    }
70
71
    public function testInputBoxWidth()
72
    {
73
        $width = 16;
74
        $this->range->inputBoxWidth($width);
75
        $this->assertEquals($width, $this->range->inputBoxWidth);
76
        $this->assertRegExp('/"inputBoxWidth":16/', $this->chart->render());
77
    }
78
79
    public function testInputDateFormat()
80
    {
81
        $format = '%b %e, %Y';
82
        $this->range->inputDateFormat($format);
83
        $this->assertEquals($format, $this->range->inputDateFormat);
84
        $this->assertRegExp('/"inputDateFormat":"%b %e, %Y"/', $this->chart->render());
85
    }
86
87
    public function testInputDateParser()
88
    {
89
        $this->markTestIncomplete();
90
    }
91
92
    public function testInputEditDateFormat()
93
    {
94
        $format = '%b %e, %Y';
95
        $this->range->inputEditDateFormat($format);
96
        $this->assertEquals($format, $this->range->inputEditDateFormat);
97
        $this->assertRegExp('/"inputEditDateFormat":"%b %e, %Y"/', $this->chart->render());
98
    }
99
100
    public function testinputEnabled()
101
    {
102
        $this->range->inputEnabled(true);
103
        $this->assertTrue($this->range->inputEnabled);
104
        $this->assertRegExp('/"inputEnabled":true/', $this->chart->render());
105
106
        $this->range->inputEnabled(false);
107
        $this->assertFalse($this->range->inputEnabled);
108
        $this->assertRegExp('/"inputEnabled":false/', $this->chart->render());
109
    }
110
111
    public function testInputPosition()
112
    {
113
        $position= array(
114
            'align' => 'right'
115
        );
116
        $this->range->position($position);
117
        $this->assertEquals($position, $this->range->position);
118
        $this->assertRegExp('/"position":{"align":"right"}/', $this->chart->render());
119
    }
120
121
    public function testInputStyle()
122
    {
123
        $this->markTestIncomplete();
124
    }
125
126
    public function testLabelStyle()
127
    {
128
        $this->markTestIncomplete();
129
    }
130
131
    public function testSelected()
132
    {
133
        $index = 3;
134
        $this->range->selected($index);
135
        $this->assertEquals($index, $this->range->selected);
136
        $this->assertRegExp('/"selected":3/', $this->chart->render());
137
    }
138
}
139