summaryrefslogtreecommitdiffstats
path: root/tests/graph_test.php
blob: 4c25c33956521f09a99f4315003784520c2f08e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
 * ezcGraphTest 
 * 
 * @package Graph
 * @version //autogen//
 * @subpackage Tests
 * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
 * @license http://ez.no/licenses/new_bsd New BSD License
 */

/**
 * Tests for ezcGraph class.
 * 
 * @package ImageAnalysis
 * @subpackage Tests
 */
class ezcGraphTest extends ezcTestCase
{

	public static function suite()
	{
		return new ezcTestSuite( "ezcGraphTest" );
	}

    /**
     * setUp 
     * 
     * @access public
     */
    public function setUp()
    {
    }

    /**
     * tearDown 
     * 
     * @access public
     */
    public function tearDown()
    {
    }

    public function testFactoryPieChart()
    {
        $pieChart = ezcGraph::create( 'Pie' );

        $this->assertTrue(
            $pieChart instanceof ezcGraphPieChart,
            'ezcGraph::create did not return a ezcGraphPieChart'
        );
    }

    public function testFactoryLineChart()
    {
        $lineChart = ezcGraph::create( 'Line' );

        $this->assertTrue(
            $lineChart instanceof ezcGraphLineChart,
            'ezcGraph::create did not return a ezcGraphLineChart'
        );
    }

    public function testFactoryUnknownChart()
    {
        try
        {
            $unknownChart = ezcGraph::create( 'Unknown' );
        }
        catch ( ezcGraphUnknownChartTypeException $e )
        {
            return true;
        }

        $this->fail( 'Expected ezcGraphUnknownChartTypeException' );
    }
}
?>
OpenPOWER on IntegriCloud