MDL-51832 tests: Fix failing code manager unit tests on Windows

This commit is contained in:
David Mudrák 2015-10-19 17:43:12 +02:00
parent 30c264211e
commit c8a6d162a0
2 changed files with 2 additions and 1 deletions

View file

@ -325,7 +325,7 @@ class code_manager {
if ($fileinfo->isDir() and substr($key, -1) !== '/') { if ($fileinfo->isDir() and substr($key, -1) !== '/') {
$key .= '/'; $key .= '/';
} }
$files[$key] = $fileinfo->getRealPath(); $files[str_replace(DIRECTORY_SEPARATOR, '/', $key)] = str_replace(DIRECTORY_SEPARATOR, '/', $fileinfo->getRealPath());
} }
return $files; return $files;
} }

View file

@ -126,6 +126,7 @@ class core_update_code_manager_testcase extends advanced_testcase {
$files = $codeman->list_plugin_folder_files($fixtures.'/foobar'); $files = $codeman->list_plugin_folder_files($fixtures.'/foobar');
$this->assertInternalType('array', $files); $this->assertInternalType('array', $files);
$this->assertEquals(6, count($files)); $this->assertEquals(6, count($files));
$fixtures = str_replace(DIRECTORY_SEPARATOR, '/', $fixtures);
$this->assertEquals($files['foobar/'], $fixtures.'/foobar'); $this->assertEquals($files['foobar/'], $fixtures.'/foobar');
$this->assertEquals($files['foobar/lang/en/local_foobar.php'], $fixtures.'/foobar/lang/en/local_foobar.php'); $this->assertEquals($files['foobar/lang/en/local_foobar.php'], $fixtures.'/foobar/lang/en/local_foobar.php');
} }