// Set up the file system.
$filesystem =
[];
$files_by_type_and_name_expected =
$this->
populateFilesystemStructure($filesystem);
$vfs = vfsStream::
setup('root', NULL,
$filesystem);
$root =
$vfs->
url();
$this->
assertFileExists($root . '/core/modules/system/system.module'
);
$this->
assertFileExists($root . '/core/modules/system/system.info.yml'
);
// Create an ExtensionDiscovery with $root.
$extension_discovery =
new ExtensionDiscovery($root, FALSE, NULL, 'sites/default'
);
/** @var \Drupal\Core\Extension\Extension[][] $extensions_by_type */
$extensions_by_type =
[];
$files_by_type_and_name =
[];
foreach (['profile', 'module', 'theme', 'theme_engine'
] as $type) { $extensions_by_type[$type] =
$extension_discovery->
scan($type, FALSE
);
foreach ($extensions_by_type[$type] as $name =>
$extension) { $files_by_type_and_name[$type][$name] =
$extension->
getPathname();
} if ($type === 'profile'
) { // Set profile directories for discovery of the other extension types.