From c8a6d162a090a40625c38fbb4cdb75f18fe0202e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20Mudr=C3=A1k?= Date: Mon, 19 Oct 2015 17:43:12 +0200 Subject: [PATCH] MDL-51832 tests: Fix failing code manager unit tests on Windows --- lib/classes/update/code_manager.php | 2 +- lib/tests/update_code_manager_test.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/classes/update/code_manager.php b/lib/classes/update/code_manager.php index e18715fe862..3af994d166d 100644 --- a/lib/classes/update/code_manager.php +++ b/lib/classes/update/code_manager.php @@ -325,7 +325,7 @@ class code_manager { if ($fileinfo->isDir() and substr($key, -1) !== '/') { $key .= '/'; } - $files[$key] = $fileinfo->getRealPath(); + $files[str_replace(DIRECTORY_SEPARATOR, '/', $key)] = str_replace(DIRECTORY_SEPARATOR, '/', $fileinfo->getRealPath()); } return $files; } diff --git a/lib/tests/update_code_manager_test.php b/lib/tests/update_code_manager_test.php index a2ef45c39ee..6166152d3a5 100644 --- a/lib/tests/update_code_manager_test.php +++ b/lib/tests/update_code_manager_test.php @@ -126,6 +126,7 @@ class core_update_code_manager_testcase extends advanced_testcase { $files = $codeman->list_plugin_folder_files($fixtures.'/foobar'); $this->assertInternalType('array', $files); $this->assertEquals(6, count($files)); + $fixtures = str_replace(DIRECTORY_SEPARATOR, '/', $fixtures); $this->assertEquals($files['foobar/'], $fixtures.'/foobar'); $this->assertEquals($files['foobar/lang/en/local_foobar.php'], $fixtures.'/foobar/lang/en/local_foobar.php'); } -- 2.43.0