1 | <?php |
||
7 | class ChartTest extends \PHPUnit_Framework_TestCase |
||
8 | { |
||
9 | protected $chart; |
||
10 | |||
11 | protected function setUp() |
||
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() |
||
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() |
||
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() |
||
154 | |||
155 | public function testPlotBackgroundImage() |
||
159 | |||
160 | public function testPlotBorderColor() |
||
164 | |||
165 | public function testPlotBorderWidth() |
||
169 | |||
170 | public function testPlotShadow() |
||
174 | |||
175 | public function testReflow() |
||
179 | |||
180 | public function testRenderTo() |
||
184 | |||
185 | public function testSelectionMarkerFIll() |
||
189 | |||
190 | public function testShadow() |
||
194 | |||
195 | public function testSpacing() |
||
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() |
||
236 | |||
237 | public function testType() |
||
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() |
||
254 | } |
||
255 |