diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-07-11 08:49:26 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-07-11 08:49:26 +0000 |
commit | 6f359d97e38932b0da23abb0940f32bf5380c0d8 (patch) | |
tree | bc6221534bf65aa6777245e7f555e943cdd2bbc6 /tests/legend_test.php | |
parent | 663493a7224dc7869c6c63d770016f9fd8850e2a (diff) | |
download | zetacomponents-graph-6f359d97e38932b0da23abb0940f32bf5380c0d8.zip zetacomponents-graph-6f359d97e38932b0da23abb0940f32bf5380c0d8.tar.gz |
- Refactored ezcGraphRenderer
# Most test run again, but complete result is still errnous
Diffstat (limited to 'tests/legend_test.php')
-rw-r--r-- | tests/legend_test.php | 355 |
1 files changed, 0 insertions, 355 deletions
diff --git a/tests/legend_test.php b/tests/legend_test.php index 6c7f2ce..bd125de 100644 --- a/tests/legend_test.php +++ b/tests/legend_test.php @@ -125,360 +125,5 @@ class ezcGraphLegendTest extends ezcTestCase $this->getNonPublicProperty( $chart->legend, 'position' ) ); } - - public function testRenderLegendBackground() - { - $chart = ezcGraph::create( 'Line' ); - $this->addSampleData( $chart ); - $chart->legend->background = '#0000FF'; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawBackground', - ) ); - - $mockedRenderer - ->expects( $this->at( 1 ) ) - ->method( 'drawBackground' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#0000FF' ) ), - $this->equalTo( new ezcGraphCoordinate( 0, 0 ) ), - $this->equalTo( 100 ), - $this->equalTo( 200 ) - ); - $chart->renderer = $mockedRenderer; - - $chart->render( 500, 200 ); - } - - public function testRenderLegendSymbols() - { - $chart = ezcGraph::create( 'Line' ); - $this->addSampleData( $chart ); - $chart->legend->background = '#0000FF'; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawSymbol', - ) ); - - $mockedRenderer - ->expects( $this->at( 0 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#0000FF' ) ), - $this->equalTo( new ezcGraphCoordinate( 2, 2 ) ), - $this->equalTo( 12 ), - $this->equalTo( 12 ), - ezcGraph::DIAMOND - ); - $mockedRenderer - ->expects( $this->at( 1 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#FF0000' ) ), - $this->equalTo( new ezcGraphCoordinate( 2, 18 ) ), - $this->equalTo( 12 ), - $this->equalTo( 12 ), - ezcGraph::NO_SYMBOL - ); - $mockedRenderer - ->expects( $this->at( 2 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#FF0000' ) ), - $this->equalTo( new ezcGraphCoordinate( 2, 34 ) ), - $this->equalTo( 12 ), - $this->equalTo( 12 ), - ezcGraph::NO_SYMBOL - ); - - $chart->renderer = $mockedRenderer; - - $chart->render( 500, 200 ); - } - - public function testRenderLegendText() - { - $chart = ezcGraph::create( 'Line' ); - $this->addSampleData( $chart ); - $chart->legend->background = '#0000FF'; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawTextBox', - ) ); - - $mockedRenderer - ->expects( $this->at( 0 ) ) - ->method( 'drawTextBox' ) - ->with( - $this->equalTo( new ezcGraphCoordinate( 17, 2 ) ), - 'sampleData', - $this->equalTo( 81 ), - $this->equalTo( 12 ), - $this->equalTo( ezcGraph::LEFT | ezcGraph::MIDDLE ) - ); - $mockedRenderer - ->expects( $this->at( 1 ) ) - ->method( 'drawTextBox' ) - ->with( - $this->equalTo( new ezcGraphCoordinate( 17, 18 ) ), - 'moreData', - $this->equalTo( 81 ), - $this->equalTo( 12 ), - $this->equalTo( ezcGraph::LEFT | ezcGraph::MIDDLE ) - - ); - $mockedRenderer - ->expects( $this->at( 2 ) ) - ->method( 'drawTextBox' ) - ->with( - $this->equalTo( new ezcGraphCoordinate( 17, 34 ) ), - 'Even more data', - $this->equalTo( 81 ), - $this->equalTo( 12 ), - $this->equalTo( ezcGraph::LEFT | ezcGraph::MIDDLE ) - - ); - - $chart->renderer = $mockedRenderer; - - $chart->render( 500, 200 ); - } - - public function testRenderLegendBackgroundRight() - { - $chart = ezcGraph::create( 'Line' ); - $this->addSampleData( $chart ); - $chart->legend->background = '#0000FF'; - $chart->legend->position = ezcGraph::RIGHT; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawBackground', - 'drawTextBox', - 'drawSymbol', - 'drawLine', - ) ); - $mockedRenderer - ->expects( $this->at( 1 ) ) - ->method( 'drawBackground' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#0000FF' ) ), - $this->equalTo( new ezcGraphCoordinate( 400, 0 ) ), - $this->equalTo( 100 ), - $this->equalTo( 200 ) - ); - $chart->renderer = $mockedRenderer; - - $chart->render( 500, 200 ); - } - - public function testRenderLegendSymbolsRight() - { - $chart = ezcGraph::create( 'Line' ); - $this->addSampleData( $chart ); - $chart->legend->background = '#0000FF'; - $chart->legend->position = ezcGraph::RIGHT; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawSymbol', - ) ); - - $mockedRenderer - ->expects( $this->at( 0 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#0000FF' ) ), - $this->equalTo( new ezcGraphCoordinate( 402, 2 ) ), - $this->equalTo( 12 ), - $this->equalTo( 12 ), - ezcGraph::DIAMOND - ); - $mockedRenderer - ->expects( $this->at( 1 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#FF0000' ) ), - $this->equalTo( new ezcGraphCoordinate( 402, 18 ) ), - $this->equalTo( 12 ), - $this->equalTo( 12 ), - ezcGraph::NO_SYMBOL - ); - $mockedRenderer - ->expects( $this->at( 2 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#FF0000' ) ), - $this->equalTo( new ezcGraphCoordinate( 402, 34 ) ), - $this->equalTo( 12 ), - $this->equalTo( 12 ), - ezcGraph::NO_SYMBOL - ); - - $chart->renderer = $mockedRenderer; - - $chart->render( 500, 200 ); - } - - public function testRenderLegendBackgroundBottom() - { - $chart = ezcGraph::create( 'Line' ); - $this->addSampleData( $chart ); - $chart->legend->background = '#0000FF'; - $chart->legend->position = ezcGraph::BOTTOM; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawBackground', - ) ); - $mockedRenderer - ->expects( $this->at( 1 ) ) - ->method( 'drawBackground' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#0000FF' ) ), - $this->equalTo( new ezcGraphCoordinate( 0, 180 ) ), - $this->equalTo( 500 ), - $this->equalTo( 20 ) - ); - $chart->renderer = $mockedRenderer; - - $chart->render( 500, 200 ); - } - - public function testRenderLegendSymbolsBottom() - { - $chart = ezcGraph::create( 'Line' ); - $this->addSampleData( $chart ); - $chart->legend->background = '#0000FF'; - $chart->legend->position = ezcGraph::BOTTOM; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawSymbol', - ) ); - - $mockedRenderer - ->expects( $this->at( 0 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#0000FF' ) ), - $this->equalTo( new ezcGraphCoordinate( 2, 182 ) ), - $this->equalTo( 12 ), - $this->equalTo( 12 ), - ezcGraph::DIAMOND - ); - $mockedRenderer - ->expects( $this->at( 1 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#FF0000' ) ), - $this->equalTo( new ezcGraphCoordinate( 101, 182 ) ), - $this->equalTo( 12 ), - $this->equalTo( 12 ), - ezcGraph::NO_SYMBOL - ); - $mockedRenderer - ->expects( $this->at( 2 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#FF0000' ) ), - $this->equalTo( new ezcGraphCoordinate( 200, 182 ) ), - $this->equalTo( 12 ), - $this->equalTo( 12 ), - ezcGraph::NO_SYMBOL - ); - - $chart->renderer = $mockedRenderer; - - $chart->render( 300, 200 ); - } - - public function testRenderLegendTextBottom() - { - $chart = ezcGraph::create( 'Line' ); - $this->addSampleData( $chart ); - $chart->legend->background = '#0000FF'; - $chart->legend->position = ezcGraph::TOP; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawTextBox', - ) ); - - $mockedRenderer - ->expects( $this->at( 0 ) ) - ->method( 'drawTextBox' ) - ->with( - $this->equalTo( new ezcGraphCoordinate( 18, 2 ) ), - 'sampleData', - $this->equalTo( 182 ), - $this->equalTo( 12 ) - ); - $mockedRenderer - ->expects( $this->at( 1 ) ) - ->method( 'drawTextBox' ) - ->with( - $this->equalTo( new ezcGraphCoordinate( 217, 2 ) ), - 'moreData', - $this->equalTo( 182 ), - $this->equalTo( 12 ) - ); - $mockedRenderer - ->expects( $this->at( 2 ) ) - ->method( 'drawTextBox' ) - ->with( - $this->equalTo( new ezcGraphCoordinate( 416, 2 ) ), - 'Even more data', - $this->equalTo( 182 ), - $this->equalTo( 12 ) - ); - - $chart->renderer = $mockedRenderer; - - $chart->render( 600, 200 ); - } - - public function testRenderLegendBigSymbolsPadding() - { - $chart = ezcGraph::create( 'Line' ); - $this->addSampleData( $chart ); - $chart->legend->background = '#0000FF'; - $chart->legend->padding = 3; - $chart->legend->symbolSize = 20; - - $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array( - 'drawSymbol', - ) ); - - $mockedRenderer - ->expects( $this->at( 0 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#0000FF' ) ), - $this->equalTo( new ezcGraphCoordinate( 6, 6 ) ), - $this->equalTo( 14 ), - $this->equalTo( 14 ), - ezcGraph::DIAMOND - ); - $mockedRenderer - ->expects( $this->at( 1 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#FF0000' ) ), - $this->equalTo( new ezcGraphCoordinate( 6, 28 ) ), - $this->equalTo( 14 ), - $this->equalTo( 14 ), - ezcGraph::NO_SYMBOL - ); - $mockedRenderer - ->expects( $this->at( 2 ) ) - ->method( 'drawSymbol' ) - ->with( - $this->equalTo( ezcGraphColor::fromHex( '#FF0000' ) ), - $this->equalTo( new ezcGraphCoordinate( 6, 50 ) ), - $this->equalTo( 14 ), - $this->equalTo( 14 ), - ezcGraph::NO_SYMBOL - ); - - $chart->renderer = $mockedRenderer; - - $chart->render( 500, 200 ); - } } ?> |