silverstripe-framework/tests/php/ORM/GDImageTest.php

41 lines
838 B
PHP
Raw Normal View History

<?php
2016-10-14 03:30:05 +02:00
namespace SilverStripe\ORM\Tests;
require_once __DIR__ . "/ImageTest.php";
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
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();
parent::tearDown();
}
}