mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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 (from r111748)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112919 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
25af09b0f6
commit
dd92459517
@ -13,7 +13,7 @@ class CoreTest extends SapphireTest {
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->tempPath = $tempPath = Director::baseFolder() . '/silverstripe-cache';
|
||||
$this->tempPath = Director::baseFolder() . '/silverstripe-cache';
|
||||
}
|
||||
|
||||
public function testGetTempPathInProject() {
|
||||
@ -22,7 +22,7 @@ class CoreTest extends SapphireTest {
|
||||
} else {
|
||||
// A typical Windows location for where sites are stored on IIS
|
||||
$this->assertEquals(getTempFolder('C:\\inetpub\\wwwroot\\silverstripe'), getSysTempDir() . '/silverstripe-cacheC--inetpub-wwwroot-silverstripe');
|
||||
|
||||
|
||||
// A typical Mac OS X location for where sites are stored
|
||||
$this->assertEquals(getTempFolder('/Users/joebloggs/Sites/silverstripe'), getSysTempDir() . '/silverstripe-cache-Users-joebloggs-Sites-silverstripe');
|
||||
|
||||
@ -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…
x
Reference in New Issue
Block a user