Merge branch 'MDL-67156-master' of git://github.com/vmdef/moodle

This commit is contained in:
Sara Arjona 2019-11-09 19:53:27 +01:00
commit 1cb3493ab1

View File

@ -463,7 +463,7 @@ class h5p_file_storage_testcase extends \advanced_testcase {
];
$filestorage = new file_storage();
$fs->create_file_from_string($filerecord, 'test string info');
$expectedfilepath = DIRECTORY_SEPARATOR . file_storage::LIBRARY_FILEAREA . $filepath . 'upgrade.js';
$expectedfilepath = '/' . file_storage::LIBRARY_FILEAREA . $filepath . 'upgrade.js';
$this->assertEquals($expectedfilepath, $filestorage->getUpgradeScript($machinename, $majorversion, $minorversion));
$this->assertNull($filestorage->getUpgradeScript($machinename, $majorversion, 7));
}
@ -490,9 +490,9 @@ class h5p_file_storage_testcase extends \advanced_testcase {
foreach ($files as $file) {
if (!$file->is_directory) {
$stream = $ziparchive->get_stream($file->index);
$items = explode(DIRECTORY_SEPARATOR, $file->pathname);
$items = explode('/', $file->pathname);
array_shift($items);
$path = implode(DIRECTORY_SEPARATOR, $items);
$path = implode('/', $items);
$this->h5p_file_storage->saveFileFromZip($this->h5p_tempath, $path, $stream);
$filestocheck[] = $path;
}