Issue #3490493 by catch, dww, baysaa, jhodgdon, daffie: Test profiles should be in a tests directory

merge-requests/10393/head
Alex Pott 2024-11-29 10:27:42 +00:00
parent 1bf859116c
commit 7f8c55c9c5
No known key found for this signature in database
GPG Key ID: BDA67E7EE836E5CE
74 changed files with 18 additions and 14 deletions

View File

@ -56269,13 +56269,13 @@ $ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Method Drupal\\\\Tests\\\\drupal_system_listing_compatible_test\\\\Kernel\\\\SystemListingCrossProfileCompatibleTest\\:\\:testSystemListing\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/profiles/testing/modules/drupal_system_listing_compatible_test/tests/src/Kernel/SystemListingCrossProfileCompatibleTest.php',
'path' => __DIR__ . '/profiles/tests/testing/modules/drupal_system_listing_compatible_test/tests/src/Kernel/SystemListingCrossProfileCompatibleTest.php',
];
$ignoreErrors[] = [
// identifier: missingType.return
'message' => '#^Function testing_requirements_requirements\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/profiles/testing_requirements/testing_requirements.install',
'path' => __DIR__ . '/profiles/tests/testing_requirements/testing_requirements.install',
];
$ignoreErrors[] = [
// identifier: missingType.return

View File

@ -75,7 +75,7 @@ class ConfigInstallProfileUnmetDependenciesTest extends InstallerTestBase {
protected function copyTestingOverrides(): void {
$dest = $this->siteDirectory . '/profiles/testing_config_overrides';
mkdir($dest, 0777, TRUE);
$source = DRUPAL_ROOT . '/core/profiles/testing_config_overrides';
$source = DRUPAL_ROOT . '/core/profiles/tests/testing_config_overrides';
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $item) {
if ($item->isDir()) {

View File

@ -24,7 +24,7 @@ class SystemListingTest extends KernelTestBase {
// 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',
],
];
@ -42,7 +42,7 @@ class SystemListingTest extends KernelTestBase {
// 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);
@ -57,7 +57,7 @@ class SystemListingTest extends KernelTestBase {
*/
public function testFileScanIgnoreDirectory(): void {
$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);
@ -68,7 +68,7 @@ class SystemListingTest extends KernelTestBase {
$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);
}

View File

@ -179,7 +179,7 @@ class ModuleHandlerTest extends KernelTestBase {
// @todo Remove as part of https://www.drupal.org/node/2186491
$profile_list = \Drupal::service('extension.list.profile');
assert($profile_list instanceof ProfileExtensionList);
$profile_list->setPathname($profile, 'core/profiles/' . $profile . '/' . $profile . '.info.yml');
$profile_list->setPathname($profile, 'core/profiles/tests/' . $profile . '/' . $profile . '.info.yml');
$this->enableModules(['module_test', $profile]);
$data = \Drupal::service('extension.list.module')->reset()->getList();
@ -238,7 +238,7 @@ class ModuleHandlerTest extends KernelTestBase {
// @todo Remove as part of https://www.drupal.org/node/2186491
$profile_list = \Drupal::service('extension.list.profile');
assert($profile_list instanceof ProfileExtensionList);
$profile_list->setPathname($profile, 'core/profiles/' . $profile . '/' . $profile . '.info.yml');
$profile_list->setPathname($profile, 'core/profiles/tests/' . $profile . '/' . $profile . '.info.yml');
$this->enableModules(['module_test', $profile]);
$data = \Drupal::service('extension.list.module')->reset()->getList();

View File

@ -30,7 +30,7 @@ class InstallerDependenciesResolutionTest extends KernelTestBase {
// @todo Remove as part of https://www.drupal.org/node/2186491
$profile_list = \Drupal::service('extension.list.profile');
assert($profile_list instanceof ProfileExtensionList);
$profile_list->setPathname('testing_missing_dependencies', 'core/profiles/testing_missing_dependencies/testing_missing_dependencies.info.yml');
$profile_list->setPathname('testing_missing_dependencies', 'core/profiles/tests/testing_missing_dependencies/testing_missing_dependencies.info.yml');
// Requires install.inc to be able to use drupal_verify_profile.
require_once dirname(__FILE__, 7) . '/includes/install.inc';

View File

@ -5,6 +5,8 @@
* Install hooks for test profile.
*/
declare(strict_types=1);
/**
* Implements hook_requirements().
*/

View File

@ -5,6 +5,8 @@
* Install functions for the testing_site_config module.
*/
declare(strict_types=1);
/**
* Implements hook_install().
*/

View File

@ -55,7 +55,7 @@ class InstallerNonEnglishProfileWithoutLocaleModuleTest extends InstallerTestBas
file_put_contents($profile_info_file, Yaml::encode($profile_info));
// Copy a non-English language config YAML to be installed with the profile.
copy($this->root . '/core/profiles/testing_multilingual/config/install/language.entity.de.yml', $profile_config_dir . '/language.entity.de.yml');
copy($this->root . '/core/profiles/tests/testing_multilingual/config/install/language.entity.de.yml', $profile_config_dir . '/language.entity.de.yml');
}
/**

View File

@ -41,7 +41,7 @@ class ExtensionPathResolverTest extends KernelTestBase {
// Retrieving the location of a profile. Profiles are a special case with
// a fixed location and naming.
$this->assertSame('core/profiles/testing/testing.info.yml', \Drupal::service('extension.list.profile')
$this->assertSame('core/profiles/tests/testing/testing.info.yml', \Drupal::service('extension.list.profile')
->getPathname('testing'));
}

View File

@ -54,7 +54,7 @@ class InstallerLanguageTest extends KernelTestBase {
// @todo Remove as part of https://www.drupal.org/node/2186491
$profile_list = \Drupal::service('extension.list.profile');
assert($profile_list instanceof ProfileExtensionList);
$profile_list->setPathname('testing', 'core/profiles/testing/testing.info.yml');
$profile_list->setPathname('testing', 'core/profiles/tests/testing/testing.info.yml');
$info_en = install_profile_info('testing', 'en');
$info_nl = install_profile_info('testing', 'nl');

View File

@ -154,7 +154,7 @@ class QuickStartTest extends TestCase {
$this->php,
'core/scripts/drupal',
'install',
'testing',
'minimal',
"--password='secret'",
"--site-name='Test site {$this->testDb->getDatabasePrefix()}'",
];