mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'wip-mdl-55174' of https://github.com/rajeshtaneja/moodle
This commit is contained in:
commit
3ed88885e5
@ -798,7 +798,7 @@ abstract class testing_util {
|
||||
if (file_exists(self::get_dataroot() . '/filedir')) {
|
||||
$handle = opendir(self::get_dataroot() . '/filedir');
|
||||
while (false !== ($item = readdir($handle))) {
|
||||
if (in_array('filedir/' . $item, $childclassname::$datarootskiponreset)) {
|
||||
if (in_array('filedir' . DIRECTORY_SEPARATOR . $item, $childclassname::$datarootskiponreset)) {
|
||||
continue;
|
||||
}
|
||||
if (is_dir(self::get_dataroot()."/filedir/$item")) {
|
||||
@ -1054,8 +1054,10 @@ abstract class testing_util {
|
||||
if (!file_exists($jsonfilepath)) {
|
||||
|
||||
$listfiles = array();
|
||||
$listfiles['filedir/.'] = 'filedir/.';
|
||||
$listfiles['filedir/..'] = 'filedir/..';
|
||||
$currentdir = 'filedir' . DIRECTORY_SEPARATOR . '.';
|
||||
$parentdir = 'filedir' . DIRECTORY_SEPARATOR . '..';
|
||||
$listfiles[$currentdir] = $currentdir;
|
||||
$listfiles[$parentdir] = $parentdir;
|
||||
|
||||
$filedir = self::get_dataroot() . '/filedir';
|
||||
if (file_exists($filedir)) {
|
||||
|
@ -1025,6 +1025,7 @@ EOF;
|
||||
'filename' => $filename,
|
||||
);
|
||||
$file = self::create_draft_file($filerecord);
|
||||
$draftitemid = $file->get_itemid();
|
||||
|
||||
$maxbytes = $CFG->userquota;
|
||||
$maxareabytes = $CFG->userquota;
|
||||
@ -1034,7 +1035,7 @@ EOF;
|
||||
'areamaxbytes' => $maxareabytes);
|
||||
|
||||
// Add new file.
|
||||
file_merge_files_from_draft_area_into_filearea($file->get_itemid(), $usercontext->id, 'user', 'private', 0, $options);
|
||||
file_merge_files_from_draft_area_into_filearea($draftitemid, $usercontext->id, 'user', 'private', 0, $options);
|
||||
|
||||
$files = $fs->get_area_files($usercontext->id, 'user', 'private', 0);
|
||||
// Directory and file.
|
||||
@ -1051,12 +1052,12 @@ EOF;
|
||||
|
||||
// Add two more files.
|
||||
$filerecord = array(
|
||||
'itemid' => $file->get_itemid(),
|
||||
'itemid' => $draftitemid,
|
||||
'filename' => 'second.txt',
|
||||
);
|
||||
self::create_draft_file($filerecord);
|
||||
$filerecord = array(
|
||||
'itemid' => $file->get_itemid(),
|
||||
'itemid' => $draftitemid,
|
||||
'filename' => 'third.txt',
|
||||
);
|
||||
$file = self::create_draft_file($filerecord);
|
||||
|
Loading…
x
Reference in New Issue
Block a user