diff options
author | Sebastian Bergmann <sb@sebastian-bergmann.de> | 2006-08-14 14:08:39 +0000 |
---|---|---|
committer | Sebastian Bergmann <sb@sebastian-bergmann.de> | 2006-08-14 14:08:39 +0000 |
commit | 07af754620fd064b0d83345f2edcc00f3afa5a98 (patch) | |
tree | 9fab249bb8822bbc1dcacfdbf9c558288fdb3e51 | |
parent | 48155e33dd6901e3966d9b151d837bcbdc8e9968 (diff) | |
download | zetacomponents-graph-07af754620fd064b0d83345f2edcc00f3afa5a98.zip zetacomponents-graph-07af754620fd064b0d83345f2edcc00f3afa5a98.tar.gz |
Update UnitTest component and unit tests to work with PHPUnit >= 3.0.0alpha12. This is also the required version of PHPUnit now.
-rw-r--r-- | tests/chart_test.php | 10 | ||||
-rw-r--r-- | tests/dataset_test.php | 6 | ||||
-rw-r--r-- | tests/date_axis_test.php | 48 | ||||
-rw-r--r-- | tests/labeled_axis_test.php | 6 | ||||
-rw-r--r-- | tests/legend_test.php | 8 | ||||
-rw-r--r-- | tests/line_test.php | 2 | ||||
-rw-r--r-- | tests/numeric_axis_test.php | 8 | ||||
-rw-r--r-- | tests/pie_test.php | 2 |
8 files changed, 45 insertions, 45 deletions
diff --git a/tests/chart_test.php b/tests/chart_test.php index a906eeb..8999921 100644 --- a/tests/chart_test.php +++ b/tests/chart_test.php @@ -101,7 +101,7 @@ class ezcGraphChartTest extends ezcTestCase $this->assertEquals( ezcGraphColor::fromHex( 'FF0000' ), - $this->getNonPublicProperty( $pieChart->background, 'background' ) + $this->getAttribute( $pieChart->background, 'background' ) ); } @@ -112,7 +112,7 @@ class ezcGraphChartTest extends ezcTestCase $this->assertEquals( ezcGraphColor::fromHex( 'FF0000' ), - $this->getNonPublicProperty( $pieChart->background, 'border' ) + $this->getAttribute( $pieChart->background, 'border' ) ); } @@ -121,7 +121,7 @@ class ezcGraphChartTest extends ezcTestCase $pieChart = new ezcGraphPieChart(); $pieChart->background->borderWidth = 3; - $this->assertSame( 3, $this->getNonPublicProperty( $pieChart->background, 'borderWidth' ) ); + $this->assertSame( 3, $this->getAttribute( $pieChart->background, 'borderWidth' ) ); } public function testSetOptionsUnknown() @@ -146,7 +146,7 @@ class ezcGraphChartTest extends ezcTestCase $this->assertSame( $renderer, - $this->getNonPublicProperty( $pieChart, 'renderer' ) + $this->getAttribute( $pieChart, 'renderer' ) ); } @@ -172,7 +172,7 @@ class ezcGraphChartTest extends ezcTestCase $this->assertSame( $driver, - $this->getNonPublicProperty( $pieChart, 'driver' ) + $this->getAttribute( $pieChart, 'driver' ) ); } diff --git a/tests/dataset_test.php b/tests/dataset_test.php index 54851ed..19b1981 100644 --- a/tests/dataset_test.php +++ b/tests/dataset_test.php @@ -46,7 +46,7 @@ class ezcGraphDataSetTest extends ezcTestCase $chart = new ezcGraphPieChart(); $chart['humanoids'] = new ezcGraphArrayDataSet( array( 'monkey' => 54, 'ape' => 37, 'human' => 9 ) ); - $datasets = $this->getNonPublicProperty( $chart, 'data' ); + $datasets = $this->getAttribute( $chart, 'data' ); $this->assertTrue( $datasets['humanoids'] instanceof ezcGraphDataSet, 'No ezcGraphDataSet was created.' @@ -69,7 +69,7 @@ class ezcGraphDataSetTest extends ezcTestCase $chart = new ezcGraphPieChart(); $chart['example'] = new ezcGraphArrayDataSet( array( 'monkey' => 54, 2001 => 37 ) ); - $data = $this->getNonPublicProperty( $chart['example'], 'data' ); + $data = $this->getAttribute( $chart['example'], 'data' ); $this->assertSame( 54., @@ -87,7 +87,7 @@ class ezcGraphDataSetTest extends ezcTestCase $chart['income'] = new ezcGraphArrayDataSet( array( 2000 => 2345.2, 2456.3, 2567.4 ) ); $chart['spending'] = new ezcGraphArrayDataSet( array( 2000 => 2347.2, 2458.3, 2569.4 ) ); - $datasets = $this->getNonPublicProperty( $chart, 'data' ); + $datasets = $this->getAttribute( $chart, 'data' ); $this->assertTrue( $datasets['income'] instanceof ezcGraphDataSet, 'No ezcGraphDataSet was created.' diff --git a/tests/date_axis_test.php b/tests/date_axis_test.php index 4a4be39..c6d3dae 100644 --- a/tests/date_axis_test.php +++ b/tests/date_axis_test.php @@ -60,19 +60,19 @@ class ezcGraphDateAxisTest extends ezcTestCase $this->assertEquals( 0, - $this->getNonPublicProperty( $this->chart->xAxis, 'startDate' ), + $this->getAttribute( $this->chart->xAxis, 'startDate' ), 'Wrong starting date. ' ); $this->assertEquals( 100, - $this->getNonPublicProperty( $this->chart->xAxis, 'endDate' ), + $this->getAttribute( $this->chart->xAxis, 'endDate' ), 'Wrong end date. ' ); $this->assertEquals( 10, - $this->getNonPublicProperty( $this->chart->xAxis, 'interval' ), + $this->getAttribute( $this->chart->xAxis, 'interval' ), 'Wrong interval. ' ); } @@ -88,19 +88,19 @@ class ezcGraphDateAxisTest extends ezcTestCase $this->assertEquals( 0, - $this->getNonPublicProperty( $this->chart->xAxis, 'startDate' ), + $this->getAttribute( $this->chart->xAxis, 'startDate' ), 'Wrong starting date. ' ); $this->assertEquals( 100, - $this->getNonPublicProperty( $this->chart->xAxis, 'endDate' ), + $this->getAttribute( $this->chart->xAxis, 'endDate' ), 'Wrong end date. ' ); $this->assertEquals( 10, - $this->getNonPublicProperty( $this->chart->xAxis, 'interval' ), + $this->getAttribute( $this->chart->xAxis, 'interval' ), 'Wrong interval. ' ); } @@ -115,19 +115,19 @@ class ezcGraphDateAxisTest extends ezcTestCase $this->assertEquals( 10, - $this->getNonPublicProperty( $this->chart->xAxis, 'startDate' ), + $this->getAttribute( $this->chart->xAxis, 'startDate' ), 'Wrong starting date. ' ); $this->assertEquals( 120, - $this->getNonPublicProperty( $this->chart->xAxis, 'endDate' ), + $this->getAttribute( $this->chart->xAxis, 'endDate' ), 'Wrong end date. ' ); $this->assertEquals( 10, - $this->getNonPublicProperty( $this->chart->xAxis, 'interval' ), + $this->getAttribute( $this->chart->xAxis, 'interval' ), 'Wrong interval. ' ); } @@ -139,19 +139,19 @@ class ezcGraphDateAxisTest extends ezcTestCase $this->assertEquals( 0, - $this->getNonPublicProperty( $this->chart->xAxis, 'startDate' ), + $this->getAttribute( $this->chart->xAxis, 'startDate' ), 'Wrong starting date. ' ); $this->assertEquals( 120, - $this->getNonPublicProperty( $this->chart->xAxis, 'endDate' ), + $this->getAttribute( $this->chart->xAxis, 'endDate' ), 'Wrong end date. ' ); $this->assertEquals( 30, - $this->getNonPublicProperty( $this->chart->xAxis, 'interval' ), + $this->getAttribute( $this->chart->xAxis, 'interval' ), 'Wrong interval. ' ); } @@ -163,19 +163,19 @@ class ezcGraphDateAxisTest extends ezcTestCase $this->assertEquals( 30000, - $this->getNonPublicProperty( $this->chart->xAxis, 'startDate' ), + $this->getAttribute( $this->chart->xAxis, 'startDate' ), 'Wrong starting date. ' ); $this->assertEquals( 30120, - $this->getNonPublicProperty( $this->chart->xAxis, 'endDate' ), + $this->getAttribute( $this->chart->xAxis, 'endDate' ), 'Wrong end date. ' ); $this->assertEquals( 30, - $this->getNonPublicProperty( $this->chart->xAxis, 'interval' ), + $this->getAttribute( $this->chart->xAxis, 'interval' ), 'Wrong interval. ' ); } @@ -192,19 +192,19 @@ class ezcGraphDateAxisTest extends ezcTestCase $this->assertEquals( 'Sun, 07 May 2006 10:00:00 +0200', - date( 'r', $this->getNonPublicProperty( $this->chart->xAxis, 'startDate' ) ), + date( 'r', $this->getAttribute( $this->chart->xAxis, 'startDate' ) ), 'Wrong starting date. ' ); $this->assertEquals( 'Sun, 07 May 2006 13:00:00 +0200', - date( 'r', $this->getNonPublicProperty( $this->chart->xAxis, 'endDate' ) ), + date( 'r', $this->getAttribute( $this->chart->xAxis, 'endDate' ) ), 'Wrong end date. ' ); $this->assertEquals( 1800, - $this->getNonPublicProperty( $this->chart->xAxis, 'interval' ), + $this->getAttribute( $this->chart->xAxis, 'interval' ), 'Wrong interval. ' ); } @@ -222,19 +222,19 @@ class ezcGraphDateAxisTest extends ezcTestCase $this->assertEquals( 'Sun, 07 May 2006 06:00:00 +0200', - date( 'r', $this->getNonPublicProperty( $this->chart->xAxis, 'startDate' ) ), + date( 'r', $this->getAttribute( $this->chart->xAxis, 'startDate' ) ), 'Wrong starting date. ' ); $this->assertEquals( 'Tue, 09 May 2006 12:00:00 +0200', - date( 'r', $this->getNonPublicProperty( $this->chart->xAxis, 'endDate' ) ), + date( 'r', $this->getAttribute( $this->chart->xAxis, 'endDate' ) ), 'Wrong end date. ' ); $this->assertEquals( 21600, - $this->getNonPublicProperty( $this->chart->xAxis, 'interval' ), + $this->getAttribute( $this->chart->xAxis, 'interval' ), 'Wrong interval. ' ); } @@ -251,19 +251,19 @@ class ezcGraphDateAxisTest extends ezcTestCase $this->assertEquals( 'Mon, 01 Jan 2001 01:00:00 +0100', - date( 'r', $this->getNonPublicProperty( $this->chart->xAxis, 'startDate' ) ), + date( 'r', $this->getAttribute( $this->chart->xAxis, 'startDate' ) ), 'Wrong starting date. ' ); $this->assertEquals( 'Thu, 01 Jan 2004 01:00:00 +0100', - date( 'r', $this->getNonPublicProperty( $this->chart->xAxis, 'endDate' ) ), + date( 'r', $this->getAttribute( $this->chart->xAxis, 'endDate' ) ), 'Wrong end date. ' ); $this->assertEquals( 31536000, - $this->getNonPublicProperty( $this->chart->xAxis, 'interval' ), + $this->getAttribute( $this->chart->xAxis, 'interval' ), 'Wrong interval. ' ); } diff --git a/tests/labeled_axis_test.php b/tests/labeled_axis_test.php index 4f4370e..8576e4d 100644 --- a/tests/labeled_axis_test.php +++ b/tests/labeled_axis_test.php @@ -63,7 +63,7 @@ class ezcGraphLabeledAxisTest extends ezcTestCase '2002', '2003', ), - $this->getNonPublicProperty( $chart->xAxis, 'labels' ) + $this->getAttribute( $chart->xAxis, 'labels' ) ); } @@ -83,7 +83,7 @@ class ezcGraphLabeledAxisTest extends ezcTestCase '2004', '2005', ), - $this->getNonPublicProperty( $chart->xAxis, 'labels' ) + $this->getAttribute( $chart->xAxis, 'labels' ) ); } @@ -104,7 +104,7 @@ class ezcGraphLabeledAxisTest extends ezcTestCase '2005', '2006', ), - $this->getNonPublicProperty( $chart->xAxis, 'labels' ) + $this->getAttribute( $chart->xAxis, 'labels' ) ); } diff --git a/tests/legend_test.php b/tests/legend_test.php index 2396d4c..bd43fed 100644 --- a/tests/legend_test.php +++ b/tests/legend_test.php @@ -74,7 +74,7 @@ class ezcGraphLegendTest extends ezcTestCase $this->assertEquals( ezcGraphColor::fromHex( '#FF0000' ), - $this->getNonPublicProperty( $chart->legend, 'background' ) + $this->getAttribute( $chart->legend, 'background' ) ); } @@ -90,7 +90,7 @@ class ezcGraphLegendTest extends ezcTestCase $this->assertEquals( ezcGraphColor::fromHex( '#FF0000' ), - $this->getNonPublicProperty( $chart->legend, 'border' ) + $this->getAttribute( $chart->legend, 'border' ) ); } @@ -106,7 +106,7 @@ class ezcGraphLegendTest extends ezcTestCase $this->assertEquals( 1, - $this->getNonPublicProperty( $chart->legend, 'borderWidth' ) + $this->getAttribute( $chart->legend, 'borderWidth' ) ); } @@ -122,7 +122,7 @@ class ezcGraphLegendTest extends ezcTestCase $this->assertEquals( ezcGraph::LEFT, - $this->getNonPublicProperty( $chart->legend, 'position' ) + $this->getAttribute( $chart->legend, 'position' ) ); } } diff --git a/tests/line_test.php b/tests/line_test.php index bf04926..013c4b3 100644 --- a/tests/line_test.php +++ b/tests/line_test.php @@ -62,7 +62,7 @@ class ezcGraphLineChartTest extends ezcTestCase $this->addSampleData( $chart ); $chart->render( 500, 200 ); - $legend = $this->getNonPublicProperty( $chart->legend, 'labels' ); + $legend = $this->getAttribute( $chart->legend, 'labels' ); $this->assertEquals( 3, diff --git a/tests/numeric_axis_test.php b/tests/numeric_axis_test.php index 6cd392a..6bb20ef 100644 --- a/tests/numeric_axis_test.php +++ b/tests/numeric_axis_test.php @@ -60,22 +60,22 @@ class ezcGraphNumericAxisTest extends ezcTestCase $this->assertEquals( 10., - $this->getNonPublicProperty( $chart->yAxis, 'min' ) + $this->getAttribute( $chart->yAxis, 'min' ) ); $this->assertEquals( 50., - $this->getNonPublicProperty( $chart->yAxis, 'max' ) + $this->getAttribute( $chart->yAxis, 'max' ) ); $this->assertEquals( 10., - $this->getNonPublicProperty( $chart->yAxis, 'majorStep' ) + $this->getAttribute( $chart->yAxis, 'majorStep' ) ); $this->assertEquals( 1., - $this->getNonPublicProperty( $chart->yAxis, 'minorStep' ) + $this->getAttribute( $chart->yAxis, 'minorStep' ) ); } diff --git a/tests/pie_test.php b/tests/pie_test.php index 4a79d79..f0e77bf 100644 --- a/tests/pie_test.php +++ b/tests/pie_test.php @@ -55,7 +55,7 @@ class ezcGraphPieChartTest extends ezcImageTestCase $chart['sampleData'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1 ) ); $chart->render( 500, 200 ); - $legend = $this->getNonPublicProperty( $chart->legend, 'labels' ); + $legend = $this->getAttribute( $chart->legend, 'labels' ); $this->assertEquals( 5, |