Unverified Commit 4e3cc125 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3081501 by Mile23, Wim Leers, alexpott: Remove...

Issue #3081501 by Mile23, Wim Leers, alexpott: Remove TestSetupTrait::$originalProfile and test infrastructure which uses it
parent c7a1b020
Loading
Loading
Loading
Loading
+0 −9
Changes for core/lib/Drupal/Core/DrupalKernel.php: 0 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -774,15 +774,6 @@ protected function moduleData($module) {
      $all_profiles = $listing->scan('profile');
      $profiles = array_intersect_key($all_profiles, $this->moduleList);

      // If a module is within a profile directory but specifies another
      // profile for testing, it needs to be found in the parent profile.
      $parent_profile = Settings::get('test_parent_profile');
      if ($parent_profile && !isset($profiles[$parent_profile])) {
        // In case both profile directories contain the same extension, the
        // actual profile always has precedence.
        $profiles = [$parent_profile => $all_profiles[$parent_profile]] + $profiles;
      }

      $profile_directories = array_map(function ($profile) {
        return $profile->getPath();
      }, $profiles);
+1 −13
Changes for core/lib/Drupal/Core/Extension/ExtensionDiscovery.php: 1 added line, 13 removed lines.
Original line number Diff line number Diff line
@@ -228,19 +228,7 @@ public function scan($type, $include_tests = NULL) {
   */
  public function setProfileDirectoriesFromSettings() {
    $this->profileDirectories = [];
    $profile = \Drupal::installProfile();
    // For SimpleTest to be able to test modules packaged together with a
    // distribution we need to include the profile of the parent site (in
    // which test runs are triggered).
    if (drupal_valid_test_ua() && !drupal_installation_attempted()) {
      $testing_profile = Settings::get('test_parent_profile');
      if ($testing_profile && $testing_profile != $profile) {
        $this->profileDirectories[] = drupal_get_path('profile', $testing_profile);
      }
    }
    // In case both profile directories contain the same extension, the actual
    // profile always has precedence.
    if ($profile) {
    if ($profile = \Drupal::installProfile()) {
      $this->profileDirectories[] = drupal_get_path('profile', $profile);
    }
    return $this;
+0 −11
Changes for core/lib/Drupal/Core/Extension/ModuleExtensionList.php: 0 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@

use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Site\Settings;
use Drupal\Core\State\StateInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;

@@ -110,16 +109,6 @@ protected function getProfileDirectories(ExtensionDiscovery $discovery) {
    $active_profile = $all_profiles[$this->installProfile];
    $profiles = array_intersect_key($all_profiles, $this->configFactory->get('core.extension')->get('module') ?: [$active_profile->getName() => 0]);

    // If a module is within a profile directory but specifies another
    // profile for testing, it needs to be found in the parent profile.
    $parent_profile = Settings::get('test_parent_profile');

    if ($parent_profile && !isset($profiles[$parent_profile])) {
      // In case both profile directories contain the same extension, the
      // actual profile always has precedence.
      $profiles = [$parent_profile => $all_profiles[$parent_profile]] + $profiles;
    }

    $profile_directories = array_map(function (Extension $profile) {
      return $profile->getPath();
    }, $profiles);
+0 −6
Changes for core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php: 0 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -108,12 +108,6 @@ protected function prepareSettings() {
      'value' => $this->originalSite,
      'required' => TRUE,
    ];
    // Add the parent profile's search path to the child site's search paths.
    // @see \Drupal\Core\Extension\ExtensionDiscovery::getProfileDirectories()
    $settings['setting']['test_parent_profile'] = (object) [
      'value' => $this->originalProfile,
      'required' => TRUE,
    ];
    $settings['settings']['apcu_ensure_unique_prefix'] = (object) [
      'value' => $this->apcuEnsureUniquePrefix,
      'required' => TRUE,
+0 −7
Changes for core/lib/Drupal/Core/Test/TestSetupTrait.php: 0 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -66,13 +66,6 @@ trait TestSetupTrait {
   */
  protected $privateFilesDirectory;

  /**
   * The original installation profile.
   *
   * @var string
   */
  protected $originalProfile;

  /**
   * Set to TRUE to strict check all configuration saved.
   *
Loading