diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index c75da59c7a..d23a1f3f53 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -449,10 +449,10 @@ function install_begin_request($class_loader, &$install_state) { $container->get('string_translation') ->addTranslator($container->get('string_translator.file_translation')); - // Add list of all available profiles to the installation state. + // Add list of all available profiles to the installation state, including + // test profiles. $listing = new ExtensionDiscovery($container->get('app.root')); - $listing->setProfileDirectories([]); - $install_state['profiles'] += $listing->scan('profile'); + $install_state['profiles'] += $listing->scan('profile', TRUE); // Prime drupal_get_filename()'s static cache. foreach ($install_state['profiles'] as $name => $profile) { diff --git a/core/lib/Drupal/Core/Command/InstallCommand.php b/core/lib/Drupal/Core/Command/InstallCommand.php index bff4bc471d..1bd5069bbc 100644 --- a/core/lib/Drupal/Core/Command/InstallCommand.php +++ b/core/lib/Drupal/Core/Command/InstallCommand.php @@ -310,12 +310,11 @@ protected function validateProfile($install_profile, SymfonyStyle $io) { * An array of profile descriptions keyed by the profile machine name. */ protected function getProfiles($include_hidden = FALSE, $auto_select_distributions = TRUE) { - // Build a list of all available profiles. + // Build a list of all available profiles, including test profiles. $listing = new ExtensionDiscovery(getcwd(), FALSE); - $listing->setProfileDirectories([]); $profiles = []; $info_parser = new InfoParserDynamic(); - foreach ($listing->scan('profile') as $profile) { + foreach ($listing->scan('profile', TRUE) as $profile) { $details = $info_parser->parse($profile->getPathname()); // Don't show hidden profiles. if (!$include_hidden && !empty($details['hidden'])) { diff --git a/core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php b/core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php index ab71faa3a2..466310d4a8 100644 --- a/core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php +++ b/core/modules/config/tests/src/Functional/ConfigInstallProfileUnmetDependenciesTest.php @@ -58,7 +58,7 @@ protected function setUp() { protected function copyTestingOverrides() { $dest = $this->siteDirectory . '/profiles/testing_config_overrides'; mkdir($dest, 0777, TRUE); - $source = DRUPAL_ROOT . '/core/profiles/testing_config_overrides'; + $source = DRUPAL_ROOT . '/core/modules/config/tests/profiles/testing_config_overrides'; $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST); foreach ($iterator as $item) { if ($item->isDir()) { diff --git a/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php b/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php index 1ff6a84550..26137e68e8 100644 --- a/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php +++ b/core/modules/system/tests/src/Kernel/Common/SystemListingTest.php @@ -23,7 +23,7 @@ public function testDirectoryPrecedence() { // When both copies of the module are compatible with Drupal core, the // copy in the profile directory takes precedence. 'drupal_system_listing_compatible_test' => [ - 'core/profiles/testing/modules', + 'core/profiles/tests/testing/modules', 'core/modules/system/tests/modules', ], ]; @@ -41,7 +41,7 @@ public function testDirectoryPrecedence() { // Now scan the directories and check that the files take precedence as // expected. $listing = new ExtensionDiscovery($this->root); - $listing->setProfileDirectories(['core/profiles/testing']); + $listing->setProfileDirectories(['core/profiles/tests/testing']); $files = $listing->scan('module'); foreach ($expected_directories as $module => $directories) { $expected_directory = array_shift($directories); @@ -58,7 +58,7 @@ public function testDirectoryPrecedence() { */ public function testFileScanIgnoreDirectory() { $listing = new ExtensionDiscovery($this->root, FALSE); - $listing->setProfileDirectories(['core/profiles/testing']); + $listing->setProfileDirectories(['core/profiles/tests/testing']); $files = $listing->scan('module'); $this->assertArrayHasKey('drupal_system_listing_compatible_test', $files); @@ -70,7 +70,7 @@ public function testFileScanIgnoreDirectory() { $this->setSetting('file_scan_ignore_directories', ['drupal_system_listing_compatible_test']); $listing = new ExtensionDiscovery($this->root, FALSE); - $listing->setProfileDirectories(['core/profiles/testing']); + $listing->setProfileDirectories(['core/profiles/tests/testing']); $files = $listing->scan('module'); $this->assertArrayNotHasKey('drupal_system_listing_compatible_test', $files); } diff --git a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php index 698de170a6..ac85c714c5 100644 --- a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php +++ b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php @@ -166,7 +166,7 @@ public function testUninstallProfileDependencyBC() { // testing profile as it is not the currently active profile and we don't // yet have any cached way to retrieve its location. // @todo Remove as part of https://www.drupal.org/node/2186491 - drupal_get_filename('profile', $profile, 'core/profiles/' . $profile . '/' . $profile . '.info.yml'); + drupal_get_filename('profile', $profile, 'core/profiles/tests/' . $profile . '/' . $profile . '.info.yml'); $this->enableModules(['module_test', $profile]); $data = \Drupal::service('extension.list.module')->getList(); @@ -201,7 +201,7 @@ public function testUninstallProfileDependency() { // active profile and we don't yet have any cached way to retrieve its // location. // @todo Remove as part of https://www.drupal.org/node/2186491 - drupal_get_filename('profile', $profile, 'core/profiles/' . $profile . '/' . $profile . '.info.yml'); + drupal_get_filename('profile', $profile, 'core/profiles/tests/' . $profile . '/' . $profile . '.info.yml'); $this->enableModules(['module_test', $profile]); $data = \Drupal::service('extension.list.module')->reset()->getList(); @@ -241,7 +241,7 @@ public function testProfileAllDependencies() { // active profile and we don't yet have any cached way to retrieve its // location. // @todo Remove as part of https://www.drupal.org/node/2186491 - drupal_get_filename('profile', $profile, 'core/profiles/' . $profile . '/' . $profile . '.info.yml'); + drupal_get_filename('profile', $profile, 'core/profiles/tests/' . $profile . '/' . $profile . '.info.yml'); $this->enableModules(['module_test', $profile]); $data = \Drupal::service('extension.list.module')->reset()->getList(); diff --git a/core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php b/core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php index d4d4c3194a..fd313ef495 100644 --- a/core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php +++ b/core/modules/system/tests/src/Kernel/Installer/InstallerDependenciesResolutionTest.php @@ -24,7 +24,7 @@ public function testDependenciesResolution() { // testing profile as it is not the currently active profile and we don't // yet have any cached way to retrieve its location. // @todo Remove as part of https://www.drupal.org/node/2186491 - drupal_get_filename('profile', 'testing_missing_dependencies', 'core/profiles/testing_missing_dependencies/testing_missing_dependencies.info.yml'); + drupal_get_filename('profile', 'testing_missing_dependencies', 'core/profiles/tests/testing_missing_dependencies/testing_missing_dependencies.info.yml'); $info = drupal_verify_profile([ 'parameters' => ['profile' => 'testing_missing_dependencies'], diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesBcTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesBcTest.php index 4152633344..41e2da3384 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesBcTest.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesBcTest.php @@ -20,7 +20,7 @@ class InstallProfileDependenciesBcTest extends BrowserTestBase { /** * Tests that the install profile BC layer for dependencies key works. * - * @expectedDeprecation The install profile core/profiles/testing_install_profile_dependencies_bc/testing_install_profile_dependencies_bc.info.yml only implements a 'dependencies' key. As of Drupal 8.6.0 profile's support a new 'install' key for modules that should be installed but not depended on. See https://www.drupal.org/node/2952947. + * @expectedDeprecation The install profile core/profiles/tests/testing_install_profile_dependencies_bc/testing_install_profile_dependencies_bc.info.yml only implements a 'dependencies' key. As of Drupal 8.6.0 profile's support a new 'install' key for modules that should be installed but not depended on. See https://www.drupal.org/node/2952947. */ public function testUninstallingModules() { $user = $this->drupalCreateUser(['administer modules']); diff --git a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php index 4772366c11..0faad70c2f 100644 --- a/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php +++ b/core/tests/Drupal/KernelTests/Core/Bootstrap/GetFilenameTest.php @@ -42,7 +42,7 @@ public function testDrupalGetFilename() { // Retrieving the location of a profile. Profiles are a special case with // a fixed location and naming. - $this->assertIdentical(drupal_get_filename('profile', 'testing'), 'core/profiles/testing/testing.info.yml'); + $this->assertIdentical(drupal_get_filename('profile', 'testing'), 'core/profiles/tests/testing/testing.info.yml'); // Set a custom error handler so we can ignore the file not found error. set_error_handler(function ($severity, $message, $file, $line) {