Unverified Commit b096f36e authored by Alex Pott's avatar Alex Pott
Browse files

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 ea57e3ac
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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);