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
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@111883 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
6c0a41f0c4
commit
9cd40767f6
@ -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