diff --git a/core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php b/core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php
index 7059c90b529be052842b941a3762ecf2e9cd0bcc..fe72a958a6b25c310d379e6ce592ee5a9fefe375 100644
--- a/core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php
+++ b/core/tests/Drupal/BuildTests/Composer/Component/ComponentsIsolatedBuildTest.php
@@ -4,6 +4,7 @@
 
 use Drupal\BuildTests\Composer\ComposerBuildTestBase;
 use Drupal\Composer\Composer;
+use Symfony\Component\Finder\Finder;
 
 /**
  * Try to install dependencies per component, using Composer.
@@ -32,7 +33,7 @@ public function provideComponentPaths(): array {
 
     /** @var \Symfony\Component\Finder\SplFileInfo $path */
     foreach ($composer_json_finder->getIterator() as $path) {
-      $data[] = ['/' . $path->getRelativePath()];
+      $data[$path->getRelativePath()] = ['/' . $path->getRelativePath()];
     }
     return $data;
   }
@@ -45,8 +46,12 @@ public function provideComponentPaths(): array {
   public function testComponentComposerJson(string $component_path): void {
     // Only copy the components. Copy all of them because some of them depend on
     // each other.
-    $finder = $this->getCodebaseFinder();
-    $finder->in($this->getDrupalRoot() . static::$componentsPath);
+    $finder = new Finder();
+    $finder->files()
+      ->ignoreUnreadableDirs()
+      ->in($this->getDrupalRoot() . static::$componentsPath)
+      ->ignoreDotFiles(FALSE)
+      ->ignoreVCS(FALSE);
     $this->copyCodebase($finder->getIterator());
 
     $working_dir = $this->getWorkingPath() . static::$componentsPath . $component_path;