mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
MINOR Use Filesystem::removeFolder() in FilesystemPublisherTest::tearDown() instead of specific code to handle this
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@111899 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
9cd40767f6
commit
602fcaa7b5
@ -22,26 +22,16 @@ class FilesystemPublisherTest extends SapphireTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function tearDown() {
|
function tearDown() {
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
Object::remove_extension("SiteTree", "FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");
|
Object::remove_extension("SiteTree", "FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");
|
||||||
SiteTree::$write_homepage_map = true;
|
SiteTree::$write_homepage_map = true;
|
||||||
|
|
||||||
$basePath = '../assets/FilesystemPublisherTest-static-folder';
|
|
||||||
if(file_exists($basePath)) {
|
|
||||||
$dir = opendir($basePath);;
|
|
||||||
while($file = readdir($dir)) {
|
|
||||||
$path = Director::baseFolder() . '/assets/FilesystemPublisherTest-static-folder/' . $file;
|
|
||||||
if(is_dir($path)) continue;
|
|
||||||
else {
|
|
||||||
unlink($path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closedir($dir);
|
|
||||||
rmdir($basePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
FilesystemPublisher::$domain_based_caching = $this->orig['domain_based_caching'];
|
FilesystemPublisher::$domain_based_caching = $this->orig['domain_based_caching'];
|
||||||
|
|
||||||
parent::tearDown();
|
if(file_exists(BASE_PATH . '/assets/FilesystemPublisherTest-static-folder')) {
|
||||||
|
Filesystem::removeFolder(BASE_PATH . '/assets/FilesystemPublisherTest-static-folder');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function testUrlsToPathsWithRelativeUrls() {
|
function testUrlsToPathsWithRelativeUrls() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user