From 50368d11f6ccccc294c87c2f3ae4f7f20748bfac Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Tue, 23 Jun 2020 14:26:19 +0100
Subject: [PATCH] Issue #3150731 by andypost, Beakerboy, kim.pepper:
 FileSystemModuleDiscoveryDataProviderTrait needs to use DIRECTORY_SEPARATOR

---
 .../FileSystemModuleDiscoveryDataProviderTrait.php         | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php b/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
index 02d63841e22a..c955289fcfc7 100644
--- a/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
+++ b/core/tests/Drupal/KernelTests/FileSystemModuleDiscoveryDataProviderTrait.php
@@ -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);
 
-- 
GitLab