Completed
Push — master ( 110a17...f6145a )
by Christophe
03:27
created

ChartTest::testNullContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 16
nc 1
nop 0
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