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:
Sean Harvey 2010-10-11 22:15:34 +00:00 committed by Sam Minnee
parent 9cd40767f6
commit 602fcaa7b5

View File

@ -22,26 +22,16 @@ class FilesystemPublisherTest extends SapphireTest {
}
function tearDown() {
parent::tearDown();
Object::remove_extension("SiteTree", "FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");
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'];
parent::tearDown();
if(file_exists(BASE_PATH . '/assets/FilesystemPublisherTest-static-folder')) {
Filesystem::removeFolder(BASE_PATH . '/assets/FilesystemPublisherTest-static-folder');
}
}
function testUrlsToPathsWithRelativeUrls() {