2012-10-24 15:28:39 -07:00
|
|
|
<?php
|
2014-01-02 15:59:34 +00:00
|
|
|
|
2016-08-19 10:51:35 +12:00
|
|
|
use SilverStripe\Core\Config\Config;
|
2016-09-09 18:43:05 +12:00
|
|
|
use SilverStripe\Core\Cache;
|
2016-08-19 10:51:35 +12:00
|
|
|
|
2012-10-24 15:28:39 -07:00
|
|
|
class GDImageTest extends ImageTest {
|
2014-01-02 15:59:34 +00:00
|
|
|
|
2012-10-24 15:28:39 -07:00
|
|
|
public function setUp() {
|
2015-06-09 16:16:11 -07:00
|
|
|
parent::setUp();
|
2015-09-15 14:52:02 +12:00
|
|
|
|
2015-07-16 22:12:15 +12:00
|
|
|
if(!extension_loaded("gd")) {
|
2015-09-15 14:52:02 +12:00
|
|
|
$this->markTestSkipped("The GD extension is required");
|
2015-07-16 22:12:15 +12:00
|
|
|
return;
|
2015-09-15 14:52:02 +12:00
|
|
|
}
|
|
|
|
|
2016-08-19 10:51:35 +12:00
|
|
|
/** @skipUpgrade */
|
|
|
|
Config::inst()->update(
|
|
|
|
'SilverStripe\\Core\\Injector\\Injector',
|
|
|
|
'Image_Backend',
|
|
|
|
'SilverStripe\\Assets\\GDBackend'
|
|
|
|
);
|
2012-10-24 15:28:39 -07:00
|
|
|
}
|
2014-01-02 15:59:34 +00:00
|
|
|
|
|
|
|
public function tearDown() {
|
2016-09-09 18:43:05 +12:00
|
|
|
$cache = Cache::factory('GDBackend_Manipulations');
|
2014-01-02 15:59:34 +00:00
|
|
|
$cache->clean(Zend_Cache::CLEANING_MODE_ALL);
|
|
|
|
parent::tearDown();
|
|
|
|
}
|
2012-10-24 15:28:39 -07:00
|
|
|
}
|