mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
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:
parent
83561f2e40
commit
a91726e0aa
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user