Permalink
Browse files

MINOR Use Filesystem::removeFolder() in FilesystemPublisherTest::tear…

…Down() 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
  • Loading branch information...
1 parent 9cd4076 commit 602fcaa7b5529b80f2a3845f8675f8855284265f @halkyon halkyon committed with sminnee Oct 11, 2010
Showing with 7 additions and 17 deletions.
  1. +7 −17 tests/FilesystemPublisherTest.php
@@ -22,26 +22,16 @@ function setUp() {
}
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() {

0 comments on commit 602fcaa

Please sign in to comment.