summaryrefslogtreecommitdiffstats
path: root/tests/chart_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-06-14 09:49:53 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-06-14 09:49:53 +0000
commita592d91b0a69c421d842c9315ad73adedb521421 (patch)
treea4699499d1bd525c39e60687c0298e2e308a3d77 /tests/chart_test.php
parent96e75636cbb1dbecc21172496ae6cbfa359bcf31 (diff)
downloadzetacomponents-graph-a592d91b0a69c421d842c9315ad73adedb521421.zip
zetacomponents-graph-a592d91b0a69c421d842c9315ad73adedb521421.tar.gz
- Fixed issue #10828: PHP error when overwriting renderer in extended
ezGraphPieChart
Diffstat (limited to 'tests/chart_test.php')
-rw-r--r--tests/chart_test.php34
1 files changed, 31 insertions, 3 deletions
diff --git a/tests/chart_test.php b/tests/chart_test.php
index 02b6cac..436087b 100644
--- a/tests/chart_test.php
+++ b/tests/chart_test.php
@@ -9,13 +9,16 @@
* @license http://ez.no/licenses/new_bsd New BSD License
*/
+require_once dirname( __FILE__ ) . '/test_case.php';
+require_once dirname( __FILE__ ) . '/custom_chart.php';
+
/**
* Tests for ezcGraph class.
*
* @package ImageAnalysis
* @subpackage Tests
*/
-class ezcGraphChartTest extends ezcTestCase
+class ezcGraphChartTest extends ezcGraphTestCase
{
protected $testFiles = array(
'jpeg' => 'jpeg.jpg',
@@ -23,6 +26,7 @@ class ezcGraphChartTest extends ezcTestCase
'invalid' => 'text.txt',
);
+ protected $tempDir;
protected $basePath;
public static function suite()
@@ -32,9 +36,20 @@ class ezcGraphChartTest extends ezcTestCase
protected function setUp()
{
+ static $i = 0;
+
+ $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/';
$this->basePath = dirname( __FILE__ ) . '/data/';
}
+ protected function tearDown()
+ {
+ if ( !$this->hasFailed() )
+ {
+ $this->removeTempDir();
+ }
+ }
+
public function testSetTitle()
{
$pieChart = new ezcGraphPieChart();
@@ -72,7 +87,7 @@ class ezcGraphChartTest extends ezcTestCase
$this->assertSame(
$renderer,
- $this->getAttribute( $pieChart, 'renderer' )
+ $pieChart->renderer
);
}
@@ -104,7 +119,7 @@ class ezcGraphChartTest extends ezcTestCase
$this->assertSame(
$driver,
- $this->getAttribute( $pieChart, 'driver' )
+ $pieChart->driver
);
}
@@ -148,5 +163,18 @@ class ezcGraphChartTest extends ezcTestCase
return true;
}
}
+
+ public function testCustomChartClass()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcCustomTestChart();
+ $chart->render( 400, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
}
?>
OpenPOWER on IntegriCloud