MINOR #6090 FilesystemPublisherTest now stores temporary files in assets, which is writable, instead of the webroot which almost never has write permissions (from r111883)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112810 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2010-10-19 01:04:29 +00:00
parent 83561f2e40
commit a91726e0aa

View File

@ -14,7 +14,7 @@ class FilesystemPublisherTest extends SapphireTest {
function setUp() {
parent::setUp();
Object::add_extension("SiteTree", "FilesystemPublisher('../FilesystemPublisherTest-static-folder/')");
Object::add_extension("SiteTree", "FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/')");
SiteTree::$write_homepage_map = false;
$this->orig['domain_based_caching'] = FilesystemPublisher::$domain_based_caching;
@ -22,9 +22,23 @@ class FilesystemPublisherTest extends SapphireTest {
}
function tearDown() {
Object::remove_extension("SiteTree", "FilesystemPublisher('../FilesystemPublisherTest-static-folder/')");
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();