BUG Fix ImageTest

Image test would erroneously reset the Image::$backend to null if the test was skipped, breaking subsequent test cases
This commit is contained in:
Damian Mooyman 2014-04-29 08:57:23 +12:00
parent 280ab2dcd3
commit 8673b11cd9

View File

@ -11,16 +11,15 @@ class ImageTest extends SapphireTest {
protected $origBackend;
public function setUp() {
if(get_class($this) == "ImageTest")
$this->skipTest = true;
if(get_class($this) == "ImageTest") $this->skipTest = true;
parent::setUp();
$this->origBackend = Image::get_backend();
if($this->skipTest)
return;
$this->origBackend = Image::get_backend();
if(!file_exists(ASSETS_PATH)) mkdir(ASSETS_PATH);
// Create a test folders for each of the fixture references
@ -34,7 +33,7 @@ class ImageTest extends SapphireTest {
}
public function tearDown() {
Image::set_backend($this->origBackend);
if($this->origBackend) Image::set_backend($this->origBackend);
/* Remove the test files that we've created */
$fileIDs = $this->allFixtureIDs('Image');