summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSebastian Bergmann <sb@sebastian-bergmann.de>2007-07-02 10:02:22 +0000
committerSebastian Bergmann <sb@sebastian-bergmann.de>2007-07-02 10:02:22 +0000
commit31fd34c1c1f5d03c9eddac0683c45df8c06db6e0 (patch)
tree2b7a14813636000127c7a71c51727f8235247bef /tests
parent7af2cca9ba5b3ab1e71bad2fd52b902ae111265d (diff)
downloadzetacomponents-graph-31fd34c1c1f5d03c9eddac0683c45df8c06db6e0.zip
zetacomponents-graph-31fd34c1c1f5d03c9eddac0683c45df8c06db6e0.tar.gz
- PHPUnit 3.1 Migration
- Migrate PHPUnit_Framework_Assert::getAttribute() to PHPUnit_Framework_Assert::readAttribute(). - Use PHPUnit_Framework_TestCase::setLocale(). - Populate code coverage whitelist from autoload arrays. - Remove ezcTestRunner::addFileToFilter(). # PHPUnit 3.1 is now required.
Diffstat (limited to 'tests')
-rw-r--r--tests/dataset_test.php8
-rw-r--r--tests/driver_svg_test.php8
-rw-r--r--tests/labeled_axis_test.php16
-rw-r--r--tests/line_test.php2
-rw-r--r--tests/matrix_test.php16
-rw-r--r--tests/pie_test.php2
-rw-r--r--tests/polynom_test.php2
-rw-r--r--tests/test_case.php3
-rw-r--r--tests/transformation_test.php16
9 files changed, 32 insertions, 41 deletions
diff --git a/tests/dataset_test.php b/tests/dataset_test.php
index 474c7ef..3c2f102 100644
--- a/tests/dataset_test.php
+++ b/tests/dataset_test.php
@@ -27,7 +27,7 @@ class ezcGraphDataSetTest extends ezcTestCase
$chart = new ezcGraphPieChart();
$chart->data['humanoids'] = new ezcGraphArrayDataSet( array( 'monkey' => 54, 'ape' => 37, 'human' => 9 ) );
- $datasets = $this->getAttribute( $chart, 'data' );
+ $datasets = $this->readAttribute( $chart, 'data' );
$this->assertTrue(
$datasets['humanoids'] instanceof ezcGraphDataSet,
'No ezcGraphDataSet was created.'
@@ -50,7 +50,7 @@ class ezcGraphDataSetTest extends ezcTestCase
$chart = new ezcGraphPieChart();
$chart->data['example'] = new ezcGraphArrayDataSet( array( 'monkey' => 54, 2001 => 37 ) );
- $data = $this->getAttribute( $chart->data['example'], 'data' );
+ $data = $this->readAttribute( $chart->data['example'], 'data' );
$this->assertSame(
54,
@@ -67,7 +67,7 @@ class ezcGraphDataSetTest extends ezcTestCase
$chart = new ezcGraphPieChart();
$chart->data['example'] = new ezcGraphArrayDataSet( array( 'monkey' => 'alive', 2001 => 'year' ) );
- $data = $this->getAttribute( $chart->data['example'], 'data' );
+ $data = $this->readAttribute( $chart->data['example'], 'data' );
$this->assertSame(
'alive',
@@ -85,7 +85,7 @@ class ezcGraphDataSetTest extends ezcTestCase
$chart->data['income'] = new ezcGraphArrayDataSet( array( 2000 => 2345.2, 2456.3, 2567.4 ) );
$chart->data['spending'] = new ezcGraphArrayDataSet( array( 2000 => 2347.2, 2458.3, 2569.4 ) );
- $datasets = $this->getAttribute( $chart, 'data' );
+ $datasets = $this->readAttribute( $chart, 'data' );
$this->assertTrue(
$datasets['income'] instanceof ezcGraphDataSet,
'No ezcGraphDataSet was created.'
diff --git a/tests/driver_svg_test.php b/tests/driver_svg_test.php
index 3543298..ec2ae31 100644
--- a/tests/driver_svg_test.php
+++ b/tests/driver_svg_test.php
@@ -1827,10 +1827,7 @@ class ezcGraphSvgDriverTest extends ezcGraphTestCase
public function testSvgWithDifferentLocales()
{
- // backup locale
- $oldLocale = setlocale( LC_NUMERIC, null );
-
- setlocale( LC_NUMERIC, 'de_DE' );
+ $this->setLocale( LC_NUMERIC, 'de_DE' );
$filename = $this->tempDir . __FUNCTION__ . '.svg';
@@ -1856,9 +1853,6 @@ class ezcGraphSvgDriverTest extends ezcGraphTestCase
$chart->render( 500, 200, $filename );
- // restore locale
- setlocale( LC_NUMERIC, $oldLocale );
-
$this->compare(
$filename,
$this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
diff --git a/tests/labeled_axis_test.php b/tests/labeled_axis_test.php
index 8d8bf86..d376c22 100644
--- a/tests/labeled_axis_test.php
+++ b/tests/labeled_axis_test.php
@@ -66,7 +66,7 @@ class ezcGraphLabeledAxisTest extends ezcGraphTestCase
'2002',
'2003',
),
- $this->getAttribute( $chart->xAxis, 'labels' )
+ $this->readAttribute( $chart->xAxis, 'labels' )
);
}
@@ -86,7 +86,7 @@ class ezcGraphLabeledAxisTest extends ezcGraphTestCase
'2004',
'2005',
),
- $this->getAttribute( $chart->xAxis, 'labels' )
+ $this->readAttribute( $chart->xAxis, 'labels' )
);
}
@@ -99,7 +99,7 @@ class ezcGraphLabeledAxisTest extends ezcGraphTestCase
$this->assertEquals(
array( 0, 1, 2, 3, 4, 5, 6, 7, 8 ),
- $this->getAttribute( $chart->xAxis, 'labels' )
+ $this->readAttribute( $chart->xAxis, 'labels' )
);
}
@@ -120,7 +120,7 @@ class ezcGraphLabeledAxisTest extends ezcGraphTestCase
'2005',
'2006',
),
- $this->getAttribute( $chart->xAxis, 'labels' )
+ $this->readAttribute( $chart->xAxis, 'labels' )
);
}
@@ -313,7 +313,7 @@ class ezcGraphLabeledAxisTest extends ezcGraphTestCase
2018,
2021,
),
- $this->getAttribute( $chart->xAxis, 'displayedLabels' )
+ $this->readAttribute( $chart->xAxis, 'displayedLabels' )
);
}
@@ -347,7 +347,7 @@ class ezcGraphLabeledAxisTest extends ezcGraphTestCase
2027,
2030,
),
- $this->getAttribute( $chart->xAxis, 'displayedLabels' )
+ $this->readAttribute( $chart->xAxis, 'displayedLabels' )
);
}
@@ -380,7 +380,7 @@ class ezcGraphLabeledAxisTest extends ezcGraphTestCase
2028,
2031,
),
- $this->getAttribute( $chart->xAxis, 'displayedLabels' )
+ $this->readAttribute( $chart->xAxis, 'displayedLabels' )
);
}
@@ -408,7 +408,7 @@ class ezcGraphLabeledAxisTest extends ezcGraphTestCase
2123,
2164,
),
- $this->getAttribute( $chart->xAxis, 'displayedLabels' )
+ $this->readAttribute( $chart->xAxis, 'displayedLabels' )
);
}
diff --git a/tests/line_test.php b/tests/line_test.php
index 3bbf463..18a2588 100644
--- a/tests/line_test.php
+++ b/tests/line_test.php
@@ -246,7 +246,7 @@ class ezcGraphLineChartTest extends ezcTestCase
$this->addSampleData( $chart );
$chart->render( 500, 200 );
- $legend = $this->getAttribute( $chart->legend, 'labels' );
+ $legend = $this->readAttribute( $chart->legend, 'labels' );
$this->assertEquals(
3,
diff --git a/tests/matrix_test.php b/tests/matrix_test.php
index 7c9ad55..823c5d6 100644
--- a/tests/matrix_test.php
+++ b/tests/matrix_test.php
@@ -32,7 +32,7 @@ class ezcGraphMatrixTest extends ezcTestCase
array( 0, 1, 0 ),
array( 0, 0, 1 ),
),
- $this->getAttribute( $matrix, 'matrix' )
+ $this->readAttribute( $matrix, 'matrix' )
);
}
@@ -45,7 +45,7 @@ class ezcGraphMatrixTest extends ezcTestCase
array( 1, 0, 0, 0 ),
array( 0, 1, 0, 0 ),
),
- $this->getAttribute( $matrix, 'matrix' )
+ $this->readAttribute( $matrix, 'matrix' )
);
}
@@ -58,7 +58,7 @@ class ezcGraphMatrixTest extends ezcTestCase
array( 1, 0, 5, 0 ),
array( 6, -1, -3, .5 ),
),
- $this->getAttribute( $matrix, 'matrix' )
+ $this->readAttribute( $matrix, 'matrix' )
);
}
@@ -127,7 +127,7 @@ class ezcGraphMatrixTest extends ezcTestCase
array( 0, 2, 0 ),
array( 0, 0, 2 ),
),
- $this->getAttribute( $matrix, 'matrix' )
+ $this->readAttribute( $matrix, 'matrix' )
);
}
@@ -142,7 +142,7 @@ class ezcGraphMatrixTest extends ezcTestCase
array( 0, 0, 0 ),
array( 0, 0, 0 ),
),
- $this->getAttribute( $matrix, 'matrix' )
+ $this->readAttribute( $matrix, 'matrix' )
);
}
@@ -205,7 +205,7 @@ class ezcGraphMatrixTest extends ezcTestCase
array( 0, -.5, 0 ),
array( 0, 0, -.5 ),
),
- $this->getAttribute( $matrix, 'matrix' )
+ $this->readAttribute( $matrix, 'matrix' )
);
}
@@ -228,7 +228,7 @@ class ezcGraphMatrixTest extends ezcTestCase
array( 12, -6 ),
array( 39, -12 ),
),
- $this->getAttribute( $c, 'matrix' )
+ $this->readAttribute( $c, 'matrix' )
);
}
@@ -294,7 +294,7 @@ class ezcGraphMatrixTest extends ezcTestCase
array( 2, 5 ),
array( 3, 6 ),
),
- $this->getAttribute( $matrix, 'matrix' )
+ $this->readAttribute( $matrix, 'matrix' )
);
}
diff --git a/tests/pie_test.php b/tests/pie_test.php
index 5ddf66a..3a8a280 100644
--- a/tests/pie_test.php
+++ b/tests/pie_test.php
@@ -179,7 +179,7 @@ class ezcGraphPieChartTest extends ezcGraphTestCase
$chart->data['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->getAttribute( $chart->legend, 'labels' );
+ $legend = $this->readAttribute( $chart->legend, 'labels' );
$this->assertEquals(
5,
diff --git a/tests/polynom_test.php b/tests/polynom_test.php
index bef73fc..0268ffe 100644
--- a/tests/polynom_test.php
+++ b/tests/polynom_test.php
@@ -39,7 +39,7 @@ class ezcGraphPolynomTest extends ezcTestCase
$this->assertEquals(
array( 0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0 ),
- $this->getAttribute( $polynom, 'values' ),
+ $this->readAttribute( $polynom, 'values' ),
'Values array not properly initialized.'
);
}
diff --git a/tests/test_case.php b/tests/test_case.php
index e7af1e0..0ed30b2 100644
--- a/tests/test_case.php
+++ b/tests/test_case.php
@@ -1,7 +1,4 @@
<?php
-
-ezcTestRunner::addFileToFilter( __FILE__ );
-
class ezcGraphTestCase extends ezcTestImageCase
{
diff --git a/tests/transformation_test.php b/tests/transformation_test.php
index e3ed9a0..b64d07a 100644
--- a/tests/transformation_test.php
+++ b/tests/transformation_test.php
@@ -28,8 +28,8 @@ class ezcGraphTransformationTest extends ezcTestCase
$matrix = new ezcGraphMatrix( 3, 3 );
$this->assertEquals(
- $this->getAttribute( $matrix, 'matrix' ),
- $this->getAttribute( $transformation, 'matrix' ),
+ $this->readAttribute( $matrix, 'matrix' ),
+ $this->readAttribute( $transformation, 'matrix' ),
'Transformation matrices are not aequivalent',
.0001
);
@@ -54,8 +54,8 @@ class ezcGraphTransformationTest extends ezcTestCase
);
$this->assertEquals(
- $this->getAttribute( $matrix, 'matrix' ),
- $this->getAttribute( $transformation, 'matrix' ),
+ $this->readAttribute( $matrix, 'matrix' ),
+ $this->readAttribute( $transformation, 'matrix' ),
'Transformation matrices are not aequivalent',
.0001
);
@@ -74,8 +74,8 @@ class ezcGraphTransformationTest extends ezcTestCase
);
$this->assertEquals(
- $this->getAttribute( $matrix, 'matrix' ),
- $this->getAttribute( $transformation, 'matrix' ),
+ $this->readAttribute( $matrix, 'matrix' ),
+ $this->readAttribute( $transformation, 'matrix' ),
'Transformation matrices are not aequivalent',
.0001
);
@@ -129,8 +129,8 @@ class ezcGraphTransformationTest extends ezcTestCase
);
$this->assertEquals(
- $this->getAttribute( $matrix, 'matrix' ),
- $this->getAttribute( $transformation, 'matrix' ),
+ $this->readAttribute( $matrix, 'matrix' ),
+ $this->readAttribute( $transformation, 'matrix' ),
'Transformation matrices are not aequivalent',
.0001
);
OpenPOWER on IntegriCloud