mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
29 lines
632 B
PHP
29 lines
632 B
PHP
<?php
|
|
class GDImageTest extends ImageTest {
|
|
public function setUp() {
|
|
if(!extension_loaded("gd")) {
|
|
$this->markTestSkipped("The GD extension is required");
|
|
$this->skipTest = true;
|
|
parent::setUp();
|
|
return;
|
|
}
|
|
|
|
parent::setUp();
|
|
|
|
Image::set_backend("GDBackend");
|
|
|
|
// Create a test files for each of the fixture references
|
|
$fileIDs = $this->allFixtureIDs('Image');
|
|
foreach($fileIDs as $fileID) {
|
|
$file = DataObject::get_by_id('Image', $fileID);
|
|
|
|
$image = imagecreatetruecolor(300,300);
|
|
|
|
imagepng($image, BASE_PATH."/{$file->Filename}");
|
|
imagedestroy($image);
|
|
|
|
$file->write();
|
|
}
|
|
}
|
|
}
|