1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace CMEN\GoogleChartsBundle\Tests; |
4
|
|
|
|
5
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Charts\ColumnChart; |
6
|
|
|
|
7
|
|
|
class ChartTest extends \PHPUnit_Framework_TestCase |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* @expectedException CMEN\GoogleChartsBundle\Exception\GoogleChartsException |
11
|
|
|
* @expectedExceptionMessage Container is not defined. |
12
|
|
|
*/ |
13
|
|
|
public function testNullContainer() |
14
|
|
|
{ |
15
|
|
|
$chart = new ColumnChart(); |
16
|
|
|
$chart->getOptions()->setTitle('title')->setTitlePosition('in'); |
17
|
|
|
$chart->getData()->setArrayToDataTable([ |
18
|
|
|
['Time of Day', 'Motivation Level', ['role' => 'annotation'], 'Energy Level', ['role' => 'annotation']], |
19
|
|
|
[['v' => [8, 0, 0], 'f' => '8 am'], 1, '1', 0.25, '0.2'], |
20
|
|
|
[['v' => [9, 0, 0], 'f' => '9 am'], 2, '2', 0.5, '0.5'], |
21
|
|
|
[['v' => [10, 0, 0], 'f' => '10 am'], 3, '3', 1, '1'], |
22
|
|
|
[['v' => [11, 0, 0], 'f' => '11 am'], 4, '4', 2.25, '2'], |
23
|
|
|
[['v' => [12, 0, 0], 'f' => '12 am'], 5, '5', 2.25, '2'], |
24
|
|
|
[['v' => [13, 0, 0], 'f' => '1 pm'], 6, '6', 3, '3'], |
25
|
|
|
[['v' => [14, 0, 0], 'f' => '2 pm'], 7, '7', 3.25, '3'], |
26
|
|
|
[['v' => [15, 0, 0], 'f' => '3 pm'], 8, '8', 5, '5'], |
27
|
|
|
[['v' => [16, 0, 0], 'f' => '4 pm'], 9, '9', 6.5, '6'], |
28
|
|
|
[['v' => [17, 0, 0], 'f' => '5 pm'], 10, '10', 10, '10'] |
29
|
|
|
]); |
30
|
|
|
|
31
|
|
|
$chart->startDraw(); |
32
|
|
|
} |
33
|
|
|
} |
34
|
|
|
|