2012-10-25 00:28:39 +02:00
|
|
|
<?php
|
2014-01-02 16:59:34 +01:00
|
|
|
|
2016-10-14 03:30:05 +02:00
|
|
|
namespace SilverStripe\ORM\Tests;
|
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
require_once __DIR__ . "/ImageTest.php";
|
2016-09-12 08:16:39 +02:00
|
|
|
|
2016-08-19 00:51:35 +02:00
|
|
|
use SilverStripe\Core\Config\Config;
|
2017-02-23 20:39:57 +01:00
|
|
|
use Psr\SimpleCache\CacheInterface;
|
|
|
|
use SilverStripe\Core\Injector\Injector;
|
2016-10-14 03:30:05 +02:00
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
class GDImageTest extends ImageTest
|
|
|
|
{
|
|
|
|
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
|
|
|
if (!extension_loaded("gd")) {
|
|
|
|
$this->markTestSkipped("The GD extension is required");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @skipUpgrade
|
|
|
|
*/
|
|
|
|
Config::inst()->update(
|
|
|
|
'SilverStripe\\Core\\Injector\\Injector',
|
|
|
|
'Image_Backend',
|
|
|
|
'SilverStripe\\Assets\\GDBackend'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function tearDown()
|
|
|
|
{
|
2017-02-23 20:39:57 +01:00
|
|
|
$cache = Injector::inst()->get(CacheInterface::class . '.GDBackend_Manipulations');
|
|
|
|
$cache->clear();
|
|
|
|
|
2016-12-16 05:34:21 +01:00
|
|
|
parent::tearDown();
|
|
|
|
}
|
2012-10-25 00:28:39 +02:00
|
|
|
}
|