mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
8fb332ac36
commit
a9d752b344
@ -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');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user