Do not try to run gd based tests if gd extension is not there

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2016-12-06 10:44:06 +01:00
parent 18a96f0178
commit ec9139edef
8 changed files with 49 additions and 24 deletions

View File

@ -208,6 +208,9 @@ class GISGeometryCollectionTest extends PHPUnit_Framework_TestCase
*/
public function providerForPrepareRowAsPng()
{
if (! function_exists('imagecreatetruecolor')) {
$this->markTestSkipped('GD extension missing!');
}
return array(
array(
'GEOMETRYCOLLECTION(POLYGON((35 10,10 20,15 40,45 45,35 10),'

View File

@ -192,6 +192,9 @@ class GISLinestringTest extends GISGeomTest
*/
public function providerForPrepareRowAsPng()
{
if (! function_exists('imagecreatetruecolor')) {
$this->markTestSkipped('GD extension missing!');
}
return array(
array(
'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)',

View File

@ -253,6 +253,9 @@ class GISMultilinestringTest extends GISGeomTest
*/
public function providerForPrepareRowAsPng()
{
if (! function_exists('imagecreatetruecolor')) {
$this->markTestSkipped('GD extension missing!');
}
return array(
array(
'MULTILINESTRING((36 14,47 23,62 75),(36 10,17 23,178 53))',

View File

@ -196,6 +196,9 @@ class GISMultipointTest extends GISGeomTest
*/
public function providerForPrepareRowAsPng()
{
if (! function_exists('imagecreatetruecolor')) {
$this->markTestSkipped('GD extension missing!');
}
return array(
array(
'MULTIPOINT(12 35,48 75,69 23,25 45,14 53,35 78)',

View File

@ -296,6 +296,9 @@ class GISMultipolygonTest extends GISGeomTest
*/
public function providerForPrepareRowAsPng()
{
if (! function_exists('imagecreatetruecolor')) {
$this->markTestSkipped('GD extension missing!');
}
return array(
array(
'MULTIPOLYGON(((136 40,147 83,16 75,136 40)),'

View File

@ -197,6 +197,9 @@ class GISPointTest extends GISGeomTest
*/
public function providerForPrepareRowAsPng()
{
if (! function_exists('imagecreatetruecolor')) {
$this->markTestSkipped('GD extension missing!');
}
return array(
array(
'POINT(12 35)',

View File

@ -384,6 +384,9 @@ class GISPolygonTest extends GISGeomTest
*/
public function providerForPrepareRowAsPng()
{
if (! function_exists('imagecreatetruecolor')) {
$this->markTestSkipped('GD extension missing!');
}
return array(
array(
'POLYGON((123 0,23 30,17 63,123 0))',

View File

@ -690,7 +690,7 @@ class TransformationPluginsTest extends PMATestCase
*/
public function transformationDataProvider()
{
return array(
$result = array(
array(
new Image_JPEG_Upload(),
array(
@ -771,17 +771,6 @@ class TransformationPluginsTest extends PMATestCase
),
'31 31 31 31 31 30 30 31 '
),
array(
new Image_JPEG_Inline(),
array(
'PMA_JPEG_Inline',
array("./image/", "200", "wrapper_link"=>"PMA_wrapper_link")
),
'<a href="transformation_wrapper.phpPMA_wrapper_link" '
. 'rel="noopener noreferrer" target="_blank"><img src="transformation_wrapper.php'
. 'PMA_wrapper_link&amp;resize=jpeg&amp;newWidth=0&amp;'
. 'newHeight=200" alt="[PMA_JPEG_Inline]" border="0" /></a>'
),
array(
new Image_JPEG_Link(),
array(
@ -792,18 +781,6 @@ class TransformationPluginsTest extends PMATestCase
. ' href="transformation_wrapper.phpPMA_wrapper_link"'
. ' alt="[PMA_IMAGE_LINK]">[BLOB]</a>'
),
array(
new Image_PNG_Inline(),
array(
'PMA_PNG_Inline',
array("./image/", "200", "wrapper_link"=>"PMA_wrapper_link")
),
'<a href="transformation_wrapper.phpPMA_wrapper_link"'
. ' rel="noopener noreferrer" target="_blank"><img src="transformation_wrapper.php'
. 'PMA_wrapper_link&amp;'
. 'resize=jpeg&amp;newWidth=0&amp;newHeight=200" '
. 'alt="[PMA_PNG_Inline]" border="0" /></a>'
),
array(
new Text_Plain_Dateformat(),
array(
@ -970,6 +947,33 @@ class TransformationPluginsTest extends PMATestCase
'suffixMA_suffix'
),
);
if (function_exists('imagecreatetruecolor')) {
$result[] = array(
new Image_JPEG_Inline(),
array(
'PMA_JPEG_Inline',
array("./image/", "200", "wrapper_link"=>"PMA_wrapper_link")
),
'<a href="transformation_wrapper.phpPMA_wrapper_link" '
. 'rel="noopener noreferrer" target="_blank"><img src="transformation_wrapper.php'
. 'PMA_wrapper_link&amp;resize=jpeg&amp;newWidth=0&amp;'
. 'newHeight=200" alt="[PMA_JPEG_Inline]" border="0" /></a>'
);
$result[] = array(
new Image_PNG_Inline(),
array(
'PMA_PNG_Inline',
array("./image/", "200", "wrapper_link"=>"PMA_wrapper_link")
),
'<a href="transformation_wrapper.phpPMA_wrapper_link"'
. ' rel="noopener noreferrer" target="_blank"><img src="transformation_wrapper.php'
. 'PMA_wrapper_link&amp;'
. 'resize=jpeg&amp;newWidth=0&amp;newHeight=200" '
. 'alt="[PMA_PNG_Inline]" border="0" /></a>'
);
}
return $result;
}
/**