Remove some constant definition from test/bootstrap-dist.php
Fix some failing tests. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
3f9265b48f
commit
f63d21b65b
@ -5,6 +5,11 @@
|
||||
colors="true"
|
||||
verbose="true">
|
||||
|
||||
<php>
|
||||
<const name="PHPMYADMIN" value="1"/>
|
||||
<const name="TESTSUITE" value="1"/>
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="default">
|
||||
<directory suffix="Test.php">test/classes</directory>
|
||||
|
||||
@ -1,7 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Bootstrap for phpMyAdmin tests
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
@ -24,19 +21,4 @@ error_reporting(E_ALL);
|
||||
// Ensure PHP has set timezone
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
// Adding phpMyAdmin sources to include path
|
||||
set_include_path(
|
||||
get_include_path() . PATH_SEPARATOR . dirname((string) realpath('../index.php'))
|
||||
);
|
||||
|
||||
// Setting constants for testing
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
define('PHPMYADMIN', 1);
|
||||
define('TESTSUITE', 1);
|
||||
}
|
||||
|
||||
// phpcs:enable
|
||||
|
||||
require_once ROOT_PATH . 'libraries/vendor_config.php';
|
||||
require_once AUTOLOAD_FILE;
|
||||
|
||||
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpMyAdmin\Tests\Controllers;
|
||||
|
||||
use PhpMyAdmin\Config;
|
||||
use PhpMyAdmin\Controllers\ExportTemplateController;
|
||||
use PhpMyAdmin\Export\Template as ExportTemplate;
|
||||
use PhpMyAdmin\Export\TemplateModel;
|
||||
|
||||
@ -181,13 +181,15 @@ class GisGeometryCollectionTest extends AbstractTestCase
|
||||
$this->markTestSkipped('GD extension missing!');
|
||||
}
|
||||
|
||||
$image = imagecreatetruecolor(120, 150);
|
||||
$this->assertNotFalse($image);
|
||||
$return = $this->object->prepareRowAsPng(
|
||||
'GEOMETRYCOLLECTION(POLYGON((35 10,10 20,15 40,45 45,35 10),'
|
||||
. '(20 30,35 32,30 20,20 30)))',
|
||||
'image',
|
||||
'#B02EE0',
|
||||
['x' => 12, 'y' => 69, 'scale' => 2, 'height' => 150],
|
||||
imagecreatetruecolor(120, 150)
|
||||
$image
|
||||
);
|
||||
$this->assertEquals(120, imagesx($return));
|
||||
$this->assertEquals(150, imagesy($return));
|
||||
|
||||
@ -174,12 +174,14 @@ class GisLineStringTest extends GisGeomTestCase
|
||||
$this->markTestSkipped('GD extension missing!');
|
||||
}
|
||||
|
||||
$image = imagecreatetruecolor(120, 150);
|
||||
$this->assertNotFalse($image);
|
||||
$return = $this->object->prepareRowAsPng(
|
||||
'LINESTRING(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
'image',
|
||||
'#B02EE0',
|
||||
['x' => 12, 'y' => 69, 'scale' => 2, 'height' => 150],
|
||||
imagecreatetruecolor(120, 150)
|
||||
$image
|
||||
);
|
||||
$this->assertImage($return);
|
||||
}
|
||||
|
||||
@ -256,12 +256,14 @@ class GisMultiLineStringTest extends GisGeomTestCase
|
||||
$this->markTestSkipped('GD extension missing!');
|
||||
}
|
||||
|
||||
$image = imagecreatetruecolor(120, 150);
|
||||
$this->assertNotFalse($image);
|
||||
$return = $this->object->prepareRowAsPng(
|
||||
'MULTILINESTRING((36 14,47 23,62 75),(36 10,17 23,178 53))',
|
||||
'image',
|
||||
'#B02EE0',
|
||||
['x' => 12, 'y' => 69, 'scale' => 2, 'height' => 150],
|
||||
imagecreatetruecolor(120, 150)
|
||||
$image
|
||||
);
|
||||
$this->assertImage($return);
|
||||
}
|
||||
|
||||
@ -176,12 +176,14 @@ class GisMultiPointTest extends GisGeomTestCase
|
||||
$this->markTestSkipped('GD extension missing!');
|
||||
}
|
||||
|
||||
$image = imagecreatetruecolor(120, 150);
|
||||
$this->assertNotFalse($image);
|
||||
$return = $this->object->prepareRowAsPng(
|
||||
'MULTIPOINT(12 35,48 75,69 23,25 45,14 53,35 78)',
|
||||
'image',
|
||||
'#B02EE0',
|
||||
['x' => 12, 'y' => 69, 'scale' => 2, 'height' => 150],
|
||||
imagecreatetruecolor(120, 150)
|
||||
$image
|
||||
);
|
||||
$this->assertImage($return);
|
||||
}
|
||||
|
||||
@ -343,13 +343,15 @@ class GisMultiPolygonTest extends GisGeomTestCase
|
||||
$this->markTestSkipped('GD extension missing!');
|
||||
}
|
||||
|
||||
$image = imagecreatetruecolor(120, 150);
|
||||
$this->assertNotFalse($image);
|
||||
$return = $this->object->prepareRowAsPng(
|
||||
'MULTIPOLYGON(((136 40,147 83,16 75,136 40)),'
|
||||
. '((105 0,56 20,78 73,105 0)))',
|
||||
'image',
|
||||
'#B02EE0',
|
||||
['x' => 12, 'y' => 69, 'scale' => 2, 'height' => 150],
|
||||
imagecreatetruecolor(120, 150)
|
||||
$image
|
||||
);
|
||||
$this->assertImage($return);
|
||||
}
|
||||
|
||||
@ -185,17 +185,20 @@ class GisPointTest extends GisGeomTestCase
|
||||
];
|
||||
}
|
||||
|
||||
public function testPrepareRowAsPng(): void {
|
||||
public function testPrepareRowAsPng(): void
|
||||
{
|
||||
if (! function_exists('imagecreatetruecolor')) {
|
||||
$this->markTestSkipped('GD extension missing!');
|
||||
}
|
||||
|
||||
$image = imagecreatetruecolor(120, 150);
|
||||
$this->assertNotFalse($image);
|
||||
$return = $this->object->prepareRowAsPng(
|
||||
'POINT(12 35)',
|
||||
'image',
|
||||
'#B02EE0',
|
||||
['x' => 12, 'y' => 69, 'scale' => 2, 'height' => 150],
|
||||
imagecreatetruecolor(120, 150)
|
||||
$image
|
||||
);
|
||||
$this->assertImage($return);
|
||||
}
|
||||
|
||||
@ -433,12 +433,14 @@ class GisPolygonTest extends GisGeomTestCase
|
||||
$this->markTestSkipped('GD extension missing!');
|
||||
}
|
||||
|
||||
$image = imagecreatetruecolor(120, 150);
|
||||
$this->assertNotFalse($image);
|
||||
$return = $this->object->prepareRowAsPng(
|
||||
'POLYGON((123 0,23 30,17 63,123 0))',
|
||||
'image',
|
||||
'#B02EE0',
|
||||
['x' => 12, 'y' => 69, 'scale' => 2, 'height' => 150],
|
||||
imagecreatetruecolor(120, 150)
|
||||
$image
|
||||
);
|
||||
$this->assertImage($return);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user