diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-06-07 12:28:53 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-06-07 12:28:53 +0000 |
commit | c8ce91759e37ab7afb61068862e4a057ce1aa5b8 (patch) | |
tree | ce983224b7f0259d8f59dee891cdbede9104a6a9 /tests/text_test.php | |
parent | 03c4ad60f8fd30891fbbf981f6d56f6b1b5007c7 (diff) | |
download | zetacomponents-graph-c8ce91759e37ab7afb61068862e4a057ce1aa5b8.zip zetacomponents-graph-c8ce91759e37ab7afb61068862e4a057ce1aa5b8.tar.gz |
- Cleaned up tests
Diffstat (limited to 'tests/text_test.php')
-rw-r--r-- | tests/text_test.php | 114 |
1 files changed, 49 insertions, 65 deletions
diff --git a/tests/text_test.php b/tests/text_test.php index 22e7986..8814dee 100644 --- a/tests/text_test.php +++ b/tests/text_test.php @@ -43,75 +43,59 @@ class ezcGraphTextTest extends ezcTestCase public function testRenderTextTop() { - try - { - $chart = ezcGraph::create( 'Line' ); - $chart->sample = array( 'foo' => 1, 'bar' => 10 ); - $chart->sample->color = '#FF0000'; - - $chart->title = 'Title of a chart'; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawTextBox', - ) ); - - // Y-Axis - $mockedRenderer - ->expects( $this->at( 0 ) ) - ->method( 'drawTextBox' ) - ->with( - $this->equalTo( new ezcGraphCoordinate( 1, 1 ) ), - $this->equalTo( 'Title of a chart' ), - $this->equalTo( 498 ), - $this->equalTo( 18 ), - $this->equalTo( ezcGraph::CENTER | ezcGraph::MIDDLE ) - ); - - $chart->renderer = $mockedRenderer; - - $chart->render( 500, 200 ); - } - catch ( Exception $e ) - { - $this->fail( $e->getMessage() ); - } + $chart = ezcGraph::create( 'Line' ); + $chart->sample = array( 'foo' => 1, 'bar' => 10 ); + + $chart->title = 'Title of a chart'; + + $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( + 'drawTextBox', + ) ); + + // Y-Axis + $mockedRenderer + ->expects( $this->at( 0 ) ) + ->method( 'drawTextBox' ) + ->with( + $this->equalTo( new ezcGraphCoordinate( 1, 1 ) ), + $this->equalTo( 'Title of a chart' ), + $this->equalTo( 498 ), + $this->equalTo( 18 ), + $this->equalTo( ezcGraph::CENTER | ezcGraph::MIDDLE ) + ); + + $chart->renderer = $mockedRenderer; + + $chart->render( 500, 200 ); } public function testRenderTextBottom() { - try - { - $chart = ezcGraph::create( 'Line' ); - $chart->sample = array( 'foo' => 1, 'bar' => 10 ); - $chart->sample->color = '#FF0000'; - - $chart->title = 'Title of a chart'; - $chart->title->position = ezcGraph::BOTTOM; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawTextBox', - ) ); - - // Y-Axis - $mockedRenderer - ->expects( $this->at( 0 ) ) - ->method( 'drawTextBox' ) - ->with( - $this->equalTo( new ezcGraphCoordinate( 1, 181 ) ), - $this->equalTo( 'Title of a chart' ), - $this->equalTo( 498 ), - $this->equalTo( 18 ), - $this->equalTo( ezcGraph::CENTER | ezcGraph::MIDDLE ) - ); - - $chart->renderer = $mockedRenderer; - - $chart->render( 500, 200 ); - } - catch ( Exception $e ) - { - $this->fail( $e->getMessage() ); - } + $chart = ezcGraph::create( 'Line' ); + $chart->sample = array( 'foo' => 1, 'bar' => 10 ); + + $chart->title = 'Title of a chart'; + $chart->title->position = ezcGraph::BOTTOM; + + $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( + 'drawTextBox', + ) ); + + // Y-Axis + $mockedRenderer + ->expects( $this->at( 0 ) ) + ->method( 'drawTextBox' ) + ->with( + $this->equalTo( new ezcGraphCoordinate( 1, 181 ) ), + $this->equalTo( 'Title of a chart' ), + $this->equalTo( 498 ), + $this->equalTo( 18 ), + $this->equalTo( ezcGraph::CENTER | ezcGraph::MIDDLE ) + ); + + $chart->renderer = $mockedRenderer; + + $chart->render( 500, 200 ); } } |