summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-09-11 08:41:25 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-09-11 08:41:25 +0000
commitb269dab61f162292ba4ad1f3cb400e182be23cee (patch)
tree0d70d5e446cd956427478ae04120383e7c7e0c08 /tests
parentb2f80e187bc61f0e9510c5cff18f6bb8e8eac4e6 (diff)
downloadzetacomponents-graph-b269dab61f162292ba4ad1f3cb400e182be23cee.zip
zetacomponents-graph-b269dab61f162292ba4ad1f3cb400e182be23cee.tar.gz
- Skip tests if extension or extension feature is not available
Diffstat (limited to 'tests')
-rw-r--r--tests/chart_test.php6
-rw-r--r--tests/driver_gd_test.php41
-rw-r--r--tests/line_test.php2
-rw-r--r--tests/pie_test.php12
-rw-r--r--tests/renderer_3d_test.php6
5 files changed, 66 insertions, 1 deletions
diff --git a/tests/chart_test.php b/tests/chart_test.php
index 4ebf8ae..4baef53 100644
--- a/tests/chart_test.php
+++ b/tests/chart_test.php
@@ -167,6 +167,12 @@ class ezcGraphChartTest extends ezcTestCase
public function testSetDriver()
{
+ if ( !ezcBaseFeatures::hasExtensionSupport( 'gd' ) &&
+ ( ezcBaseFeatures::hasFunction( 'imagefttext' ) || ezcBaseFeatures::hasFunction( 'imagettftext' ) ) )
+ {
+ $this->markTestSkipped( 'This test needs ext/gd with native ttf support or FreeType 2 support.' );
+ }
+
$pieChart = new ezcGraphPieChart();
$driver = $pieChart->driver = new ezcGraphGdDriver();
diff --git a/tests/driver_gd_test.php b/tests/driver_gd_test.php
index 0be109c..48e2a32 100644
--- a/tests/driver_gd_test.php
+++ b/tests/driver_gd_test.php
@@ -41,6 +41,12 @@ class ezcGraphGdDriverTest extends ezcImageTestCase
*/
public function setUp()
{
+ if ( !ezcBaseFeatures::hasExtensionSupport( 'gd' ) &&
+ ( ezcBaseFeatures::hasFunction( 'imagefttext' ) || ezcBaseFeatures::hasFunction( 'imagettftext' ) ) )
+ {
+ $this->markTestSkipped( 'This test needs ext/gd with native ttf support or FreeType 2 support.' );
+ }
+
static $i = 0;
$this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/';
$this->basePath = dirname( __FILE__ ) . '/data/';
@@ -1273,6 +1279,11 @@ class ezcGraphGdDriverTest extends ezcImageTestCase
public function testDrawSmallNativeTTFStringWithSpecialChars()
{
+ if ( !ezcBaseFeatures::hasFunction( 'imagettftext' ) )
+ {
+ $this->markTestSkipped( 'This test needs native ttf support within your gd extension.' );
+ }
+
$filename = $this->tempDir . __FUNCTION__ . '.png';
$this->driver->options->forceNativeTTF = true;
@@ -1311,6 +1322,11 @@ class ezcGraphGdDriverTest extends ezcImageTestCase
public function testDrawSmallFreeTypeStringWithSpecialChars()
{
+ if ( !ezcBaseFeatures::hasFunction( 'imagefttext' ) )
+ {
+ $this->markTestSkipped( 'This test needs FreeType 2 ttf support within your gd extension.' );
+ }
+
$filename = $this->tempDir . __FUNCTION__ . '.png';
$this->driver->drawPolygon(
@@ -1348,6 +1364,16 @@ class ezcGraphGdDriverTest extends ezcImageTestCase
public function testDrawSmallPsStringWithSpecialChars()
{
+ if ( !ezcBaseFeatures::hasFunction( 'imagepstext' ) )
+ {
+ $this->markTestSkipped( 'This test needs Type 1 font support within your gd extension.' );
+ }
+
+ if ( !ezcBaseFeatures::hasFunction( 'imagepstext' ) )
+ {
+ $this->markTestSkipped( 'This test needs Type 1 font support within your gd extension.' );
+ }
+
$filename = $this->tempDir . __FUNCTION__ . '.png';
$this->driver->options->font->path = $this->basePath . 'ps_font.pfb';
@@ -1386,6 +1412,11 @@ class ezcGraphGdDriverTest extends ezcImageTestCase
public function testDrawNativeTTFText()
{
+ if ( !ezcBaseFeatures::hasFunction( 'imagettftext' ) )
+ {
+ $this->markTestSkipped( 'This test needs native ttf support within your gd extension.' );
+ }
+
$filename = $this->tempDir . __FUNCTION__ . '.png';
$this->driver->options->font->path = $this->basePath . 'font.ttf';
$this->driver->options->forceNativeTTF = true;
@@ -1415,6 +1446,11 @@ class ezcGraphGdDriverTest extends ezcImageTestCase
public function testDrawFreeTypeTTFText()
{
+ if ( !ezcBaseFeatures::hasFunction( 'imagefttext' ) )
+ {
+ $this->markTestSkipped( 'This test needs FreeType 2 ttf support within your gd extension.' );
+ }
+
$filename = $this->tempDir . __FUNCTION__ . '.png';
$this->driver->options->font->path = $this->basePath . 'font.ttf';
@@ -1443,6 +1479,11 @@ class ezcGraphGdDriverTest extends ezcImageTestCase
public function testDrawPSText()
{
+ if ( !ezcBaseFeatures::hasFunction( 'imagepstext' ) )
+ {
+ $this->markTestSkipped( 'This test needs Type 1 font support within your gd extension.' );
+ }
+
$filename = $this->tempDir . __FUNCTION__ . '.png';
$this->driver->options->font->path = $this->basePath . 'ps_font.pfb';
diff --git a/tests/line_test.php b/tests/line_test.php
index e0a03d7..c19200f 100644
--- a/tests/line_test.php
+++ b/tests/line_test.php
@@ -39,7 +39,7 @@ class ezcGraphLineChartTest extends ezcTestCase
{
$this->markTestSkipped( "These tests required atleast PHP 5.1.3" );
}
- $this->tempDir = $this->createTempDir( 'ezcGraphGdDriverTest' . sprintf( '_%03d_', ++$i ) ) . '/';
+ $this->tempDir = $this->createTempDir( __CLASS__ . sprintf( '_%03d_', ++$i ) ) . '/';
$this->basePath = dirname( __FILE__ ) . '/data/';
}
diff --git a/tests/pie_test.php b/tests/pie_test.php
index bbea502..00d9292 100644
--- a/tests/pie_test.php
+++ b/tests/pie_test.php
@@ -183,6 +183,12 @@ class ezcGraphPieChartTest extends ezcImageTestCase
public function testRenderPieChartWithLotsOfLabels()
{
+ if ( !ezcBaseFeatures::hasExtensionSupport( 'gd' ) &&
+ ( ezcBaseFeatures::hasFunction( 'imagefttext' ) || ezcBaseFeatures::hasFunction( 'imagettftext' ) ) )
+ {
+ $this->markTestSkipped( 'This test needs ext/gd with native ttf support or FreeType 2 support.' );
+ }
+
$filename = $this->tempDir . __FUNCTION__ . '.png';
$chart = new ezcGraphPieChart();
@@ -204,6 +210,12 @@ class ezcGraphPieChartTest extends ezcImageTestCase
public function testRenderPortraitPieChartWithLotsOfLabels()
{
+ if ( !ezcBaseFeatures::hasExtensionSupport( 'gd' ) &&
+ ( ezcBaseFeatures::hasFunction( 'imagefttext' ) || ezcBaseFeatures::hasFunction( 'imagettftext' ) ) )
+ {
+ $this->markTestSkipped( 'This test needs ext/gd with native ttf support or FreeType 2 support.' );
+ }
+
$filename = $this->tempDir . __FUNCTION__ . '.png';
$chart = new ezcGraphPieChart();
diff --git a/tests/renderer_3d_test.php b/tests/renderer_3d_test.php
index 5dde168..0d22d80 100644
--- a/tests/renderer_3d_test.php
+++ b/tests/renderer_3d_test.php
@@ -393,6 +393,12 @@ class ezcGraphRenderer3dTest extends ezcImageTestCase
public function testRenderLabeledPieSegmentWithGleamAndShadowGD()
{
+ if ( !ezcBaseFeatures::hasExtensionSupport( 'gd' ) &&
+ ( ezcBaseFeatures::hasFunction( 'imagefttext' ) || ezcBaseFeatures::hasFunction( 'imagettftext' ) ) )
+ {
+ $this->markTestSkipped( 'This test needs ext/gd with native ttf support or FreeType 2 support.' );
+ }
+
$filename = $this->tempDir . __FUNCTION__ . '.png';
$chart = new ezcGraphPieChart();
OpenPOWER on IntegriCloud