Skip to content

Commit

Permalink
Issue #3150731 by andypost, Beakerboy, kim.pepper: FileSystemModuleDi…
Browse files Browse the repository at this point in the history
…scoveryDataProviderTrait needs to use DIRECTORY_SEPARATOR

(cherry picked from commit a804607c4150265ad0e6e2fd2335011c3269c8ce)
  • Loading branch information
alexpott committed Jun 23, 2020
1 parent 8346f5a commit 9a47575
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 9a47575

Please sign in to comment.