MINOR CoreTest::testGetTempPathInProject() will try to create a temp dirs when running. CoreTest::tearDown() will now remove these temp dirs when the test finishes

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@111748 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-10-06 03:44:10 +00:00 committed by Sam Minnee
parent 8fb332ac36
commit a9d752b344

View File

@ -13,7 +13,7 @@ class CoreTest extends SapphireTest {
public function setUp() { public function setUp() {
parent::setUp(); parent::setUp();
$this->tempPath = $tempPath = Director::baseFolder() . '/silverstripe-cache'; $this->tempPath = Director::baseFolder() . '/silverstripe-cache';
} }
public function testGetTempPathInProject() { public function testGetTempPathInProject() {
@ -31,4 +31,17 @@ class CoreTest extends SapphireTest {
} }
} }
public function tearDown() {
parent::tearDown();
if(file_exists(getSysTempDir() . '/silverstripe-cacheC--inetpub-wwwroot-silverstripe')) {
rmdir(getSysTempDir() . '/silverstripe-cacheC--inetpub-wwwroot-silverstripe');
}
if(file_exists(getSysTempDir() . '/silverstripe-cache-Users-joebloggs-Sites-silverstripe')) {
rmdir(getSysTempDir() . '/silverstripe-cache-Users-joebloggs-Sites-silverstripe');
}
if(file_exists(getSysTempDir() . '/silverstripe-cache-var-www-silverstripe')) {
rmdir(getSysTempDir() . '/silverstripe-cache-var-www-silverstripe');
}
}
} }