2012-10-24 15:28:39 -07:00
|
|
|
<?php
|
2014-01-02 15:59:34 +00:00
|
|
|
|
2016-10-14 14:30:05 +13:00
|
|
|
namespace SilverStripe\ORM\Tests;
|
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
require_once __DIR__ . "/ImageTest.php";
|
2016-09-12 18:16:39 +12:00
|
|
|
|
2016-08-19 10:51:35 +12:00
|
|
|
use SilverStripe\Core\Config\Config;
|
2017-02-24 08:39:57 +13:00
|
|
|
use Psr\SimpleCache\CacheInterface;
|
|
|
|
use SilverStripe\Core\Injector\Injector;
|
2016-10-14 14:30:05 +13:00
|
|
|
|
2016-12-16 17:34:21 +13: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-24 08:39:57 +13:00
|
|
|
$cache = Injector::inst()->get(CacheInterface::class . '.GDBackend_Manipulations');
|
|
|
|
$cache->clear();
|
|
|
|
|
2016-12-16 17:34:21 +13:00
|
|
|
parent::tearDown();
|
|
|
|
}
|
2012-10-24 15:28:39 -07:00
|
|
|
}
|