Unverified Commit 3f22e3c1 authored by alexpott's avatar alexpott

Issue #3150731 by andypost, Beakerboy, kim.pepper:...

Issue #3150731 by andypost, Beakerboy, kim.pepper: FileSystemModuleDiscoveryDataProviderTrait needs to use DIRECTORY_SEPARATOR

(cherry picked from commit a804607c4150265ad0e6e2fd2335011c3269c8ce)
parent b976fd2c
......@@ -14,9 +14,10 @@ trait FileSystemModuleDiscoveryDataProviderTrait {
* An array of module names to test.
*/
public function coreModuleListDataProvider() {
$module_dirs = array_keys(iterator_to_array(new \FilesystemIterator(__DIR__ . '/../../../modules/')));
$module_names = array_map(function ($path) {
return str_replace(__DIR__ . '/../../../modules/', '', $path);
$prefix = dirname(__DIR__, 3) . DIRECTORY_SEPARATOR . 'modules';
$module_dirs = array_keys(iterator_to_array(new \FilesystemIterator($prefix)));
$module_names = array_map(function ($path) use ($prefix) {
return str_replace($prefix . DIRECTORY_SEPARATOR, '', $path);
}, $module_dirs);
$modules_keyed = array_combine($module_names, $module_names);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment