From 47627abe9dd3f68476c97ea7196d401be173cf55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20D=C3=A9niz=20Falc=C3=B3n?= Date: Fri, 8 Nov 2019 22:18:11 +0000 Subject: [PATCH] MDL-67156 core_h5p: change DIRECTORY_SEPARATOR by slashes In Windows, the value of DIRECTORY_SEPARATOR is "\", causing failures in the tests when compared to the path strings that use "/". --- h5p/tests/h5p_file_storage_test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/h5p/tests/h5p_file_storage_test.php b/h5p/tests/h5p_file_storage_test.php index 832b4f0f2d0..6726fce425e 100644 --- a/h5p/tests/h5p_file_storage_test.php +++ b/h5p/tests/h5p_file_storage_test.php @@ -462,7 +462,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)); } @@ -489,9 +489,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; }