summaryrefslogtreecommitdiffstats
path: root/tests/driver_gd_test.php
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/driver_gd_test.php
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/driver_gd_test.php')
-rw-r--r--tests/driver_gd_test.php41
1 files changed, 41 insertions, 0 deletions
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';
OpenPOWER on IntegriCloud