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