/** @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.
$extension_discovery->
setProfileDirectories(['my_profile' => 'profiles/my_profile'
]);
} } $this->
assertEquals($files_by_type_and_name_expected,
$files_by_type_and_name);
$extension_expected =
new Extension($root, 'module', 'core/modules/system/system.info.yml', 'system.module'
);
$extension_expected->subpath = 'modules/system';
$extension_expected->origin = 'core';
$this->
assertEquals($extension_expected,
$extensions_by_type['module'
]['system'
], 'system'
);
$extension_expected =
new Extension($root, 'theme_engine', 'core/themes/engines/twig/twig.info.yml', 'twig.engine'
);