1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ob\HighchartsBundle\Tests\Highstock; |
4
|
|
|
|
5
|
|
|
use Ob\HighchartsBundle\Highcharts\Highstock; |
6
|
|
|
use PHPUnit\Framework\TestCase; |
7
|
|
|
|
8
|
|
|
class ChartTest extends TestCase |
9
|
|
|
{ |
10
|
|
|
protected $chart; |
11
|
|
|
|
12
|
|
|
protected function setUp() |
13
|
|
|
{ |
14
|
|
|
$this->chart = new Highstock(); |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
public function testAlignTicks() |
18
|
|
|
{ |
19
|
|
|
$this->chart->chart->alignTicks(true); |
20
|
|
|
$this->assertTrue($this->chart->chart->alignTicks); |
21
|
|
|
$this->assertRegExp('/"alignTicks":true/', $this->chart->render()); |
22
|
|
|
|
23
|
|
|
$this->chart->chart->alignTicks(false); |
24
|
|
|
$this->assertFalse($this->chart->chart->alignTicks); |
25
|
|
|
$this->assertRegExp('/"alignTicks":false/', $this->chart->render()); |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public function testAnimation() |
29
|
|
|
{ |
30
|
|
|
$this->chart->chart->animation(true); |
31
|
|
|
$this->assertTrue($this->chart->chart->animation); |
32
|
|
|
$this->assertRegExp('/"animation":true/', $this->chart->render()); |
33
|
|
|
|
34
|
|
|
$this->chart->chart->animation(false); |
35
|
|
|
$this->assertFalse($this->chart->chart->animation); |
36
|
|
|
$this->assertRegExp('/"animation":false/', $this->chart->render()); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public function testBackgroundColor() |
40
|
|
|
{ |
41
|
|
|
$color = '#ffffff'; |
42
|
|
|
$this->chart->chart->backgroundColor($color); |
43
|
|
|
$this->assertEquals($color, $this->chart->chart->backgroundColor); |
44
|
|
|
$this->assertRegExp('/"backgroundColor":"#ffffff"/', $this->chart->render()); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
public function testBorderColor() |
48
|
|
|
{ |
49
|
|
|
$color = '#4572a7'; |
50
|
|
|
$this->chart->chart->borderColor($color); |
51
|
|
|
$this->assertEquals($color, $this->chart->chart->borderColor); |
52
|
|
|
$this->assertRegExp('/"borderColor":"#4572a7"/', $this->chart->render()); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function testBorderRadius() |
56
|
|
|
{ |
57
|
|
|
$radius = 5; |
58
|
|
|
$this->chart->chart->borderRadius($radius); |
59
|
|
|
$this->assertEquals($radius, $this->chart->chart->borderRadius); |
60
|
|
|
$this->assertRegExp('/"borderRadius":5/', $this->chart->render()); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function testBorderWidth() |
64
|
|
|
{ |
65
|
|
|
$width = 0; |
66
|
|
|
$this->chart->chart->borderWidth($width); |
67
|
|
|
$this->assertEquals($width, $this->chart->chart->borderWidth); |
68
|
|
|
$this->assertRegExp('/"borderWidth":0/', $this->chart->render()); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function testClassName() |
72
|
|
|
{ |
73
|
|
|
$class = 'extraClass'; |
74
|
|
|
$this->chart->chart->className($class); |
75
|
|
|
$this->assertEquals($class, $this->chart->chart->className); |
76
|
|
|
$this->assertRegExp('/"className":"extraClass"/', $this->chart->render()); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function testEvents() |
80
|
|
|
{ |
81
|
|
|
$this->markTestIncomplete(); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function testHeight() |
85
|
|
|
{ |
86
|
|
|
$height = '300px'; |
87
|
|
|
$this->chart->chart->height($height); |
88
|
|
|
$this->assertEquals($height, $this->chart->chart->height); |
89
|
|
|
$this->assertRegExp('/"height":"300px"/', $this->chart->render()); |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
public function testIgnoreHiddenSeries() |
93
|
|
|
{ |
94
|
|
|
$this->chart->chart->ignoreHiddenSeries(true); |
95
|
|
|
$this->assertTrue($this->chart->chart->ignoreHiddenSeries); |
96
|
|
|
$this->assertRegExp('/"ignoreHiddenSeries":true/', $this->chart->render()); |
97
|
|
|
|
98
|
|
|
$this->chart->chart->ignoreHiddenSeries(false); |
99
|
|
|
$this->assertFalse($this->chart->chart->ignoreHiddenSeries); |
100
|
|
|
$this->assertRegExp('/"ignoreHiddenSeries":false/', $this->chart->render()); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
public function testMargin() |
104
|
|
|
{ |
105
|
|
|
$this->markTestIncomplete(); |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
public function testMarginBottom() |
109
|
|
|
{ |
110
|
|
|
$margin = '150px'; |
111
|
|
|
$this->chart->chart->marginBottom($margin); |
112
|
|
|
$this->assertEquals($margin, $this->chart->chart->marginBottom); |
113
|
|
|
$this->assertRegExp('/"marginBottom":"150px"/', $this->chart->render()); |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
public function testMarginLeft() |
117
|
|
|
{ |
118
|
|
|
$margin = '150px'; |
119
|
|
|
$this->chart->chart->marginLeft($margin); |
120
|
|
|
$this->assertEquals($margin, $this->chart->chart->marginLeft); |
121
|
|
|
$this->assertRegExp('/"marginLeft":"150px"/', $this->chart->render()); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
public function testMarginRight() |
125
|
|
|
{ |
126
|
|
|
$margin = '150px'; |
127
|
|
|
$this->chart->chart->marginRight($margin); |
128
|
|
|
$this->assertEquals($margin, $this->chart->chart->marginRight); |
129
|
|
|
$this->assertRegExp('/"marginRight":"150px"/', $this->chart->render()); |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
public function testMarginTop() |
133
|
|
|
{ |
134
|
|
|
$margin = '150px'; |
135
|
|
|
$this->chart->chart->marginTop($margin); |
136
|
|
|
$this->assertEquals($margin, $this->chart->chart->marginTop); |
137
|
|
|
$this->assertRegExp('/"marginTop":"150px"/', $this->chart->render()); |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
public function testPanning() |
141
|
|
|
{ |
142
|
|
|
$this->chart->chart->panning(true); |
143
|
|
|
$this->assertTrue($this->chart->chart->panning); |
144
|
|
|
$this->assertRegExp('/"panning":true/', $this->chart->render()); |
145
|
|
|
|
146
|
|
|
$this->chart->chart->panning(false); |
147
|
|
|
$this->assertFalse($this->chart->chart->panning); |
148
|
|
|
$this->assertRegExp('/"panning":false/', $this->chart->render()); |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
public function testPlotBackgroundColor() |
152
|
|
|
{ |
153
|
|
|
$this->markTestIncomplete(); |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
public function testPlotBackgroundImage() |
157
|
|
|
{ |
158
|
|
|
$this->markTestIncomplete(); |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
public function testPlotBorderColor() |
162
|
|
|
{ |
163
|
|
|
$this->markTestIncomplete(); |
164
|
|
|
} |
165
|
|
|
|
166
|
|
|
public function testPlotBorderWidth() |
167
|
|
|
{ |
168
|
|
|
$this->markTestIncomplete(); |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
public function testPlotShadow() |
172
|
|
|
{ |
173
|
|
|
$this->markTestIncomplete(); |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
public function testReflow() |
177
|
|
|
{ |
178
|
|
|
$this->markTestIncomplete(); |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
public function testRenderTo() |
182
|
|
|
{ |
183
|
|
|
$this->markTestIncomplete(); |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
public function testSelectionMarkerFIll() |
187
|
|
|
{ |
188
|
|
|
$this->markTestIncomplete(); |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
public function testShadow() |
192
|
|
|
{ |
193
|
|
|
$this->markTestIncomplete(); |
194
|
|
|
} |
195
|
|
|
|
196
|
|
|
public function testSpacing() |
197
|
|
|
{ |
198
|
|
|
$this->markTestIncomplete(); |
199
|
|
|
} |
200
|
|
|
|
201
|
|
|
public function testSpacingBottom() |
202
|
|
|
{ |
203
|
|
|
$spacing = 15; |
204
|
|
|
$this->chart->chart->spacingBottom($spacing); |
205
|
|
|
$this->assertEquals($spacing, $this->chart->chart->spacingBottom); |
206
|
|
|
$this->assertRegExp('/"spacingBottom":15/', $this->chart->render()); |
207
|
|
|
} |
208
|
|
|
|
209
|
|
|
public function testSpacingLeft() |
210
|
|
|
{ |
211
|
|
|
$spacing = 10; |
212
|
|
|
$this->chart->chart->spacingLeft($spacing); |
213
|
|
|
$this->assertEquals($spacing, $this->chart->chart->spacingLeft); |
214
|
|
|
$this->assertRegExp('/"spacingLeft":10/', $this->chart->render()); |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
public function testSpacingRight() |
218
|
|
|
{ |
219
|
|
|
$spacing = 10; |
220
|
|
|
$this->chart->chart->spacingRight($spacing); |
221
|
|
|
$this->assertEquals($spacing, $this->chart->chart->spacingRight); |
222
|
|
|
$this->assertRegExp('/"spacingRight":10/', $this->chart->render()); |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
public function testSpacingTop() |
226
|
|
|
{ |
227
|
|
|
$spacing = 10; |
228
|
|
|
$this->chart->chart->spacingTop($spacing); |
229
|
|
|
$this->assertEquals($spacing, $this->chart->chart->spacingTop); |
230
|
|
|
$this->assertRegExp('/"spacingTop":10/', $this->chart->render()); |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
public function testStyle() |
234
|
|
|
{ |
235
|
|
|
$this->markTestIncomplete(); |
236
|
|
|
} |
237
|
|
|
|
238
|
|
|
public function testType() |
239
|
|
|
{ |
240
|
|
|
$this->markTestIncomplete(); |
241
|
|
|
} |
242
|
|
|
|
243
|
|
|
public function testWidth() |
244
|
|
|
{ |
245
|
|
|
$width = '800px'; |
246
|
|
|
$this->chart->chart->width($width); |
247
|
|
|
$this->assertEquals($width, $this->chart->chart->width); |
248
|
|
|
$this->assertRegExp('/"width":"800px"/', $this->chart->render()); |
249
|
|
|
} |
250
|
|
|
|
251
|
|
|
public function testZoomType() |
252
|
|
|
{ |
253
|
|
|
$this->markTestIncomplete(); |
254
|
|
|
} |
255
|
|
|
} |
256
|
|
|
|