Verified Commit cee3acd2 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3439750 by vasike, alexpott: Remove...

Issue #3439750 by vasike, alexpott: Remove \Drupal\FunctionalTests\Core\Recipe\StandardRecipeTest::rebuildContainer()

(cherry picked from commit 027b0d72427080677100c85717057e4db6eb1349)
parent a821ec79
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ core-tests:
    BROWSERTEST_OUTPUT_DIRECTORY: "sites/simpletest/browser_output"
    BROWSERTEST_OUTPUT_FILE: "test-output.html"
    MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"chromeOptions": { "args": [ "--disable-gpu", "--headless" ] } }, "http://127.0.0.1:4444/wd/hub" ]'
    CORE_TESTS: "core/modules/config/tests/src/Functional/ConfigImportUITest.php core/modules/jsonapi/tests/src/Functional/ConfigTestTest.php core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php core/tests/Drupal/KernelTests/Core/DependencyInjection/AutoconfigurationTest.php core/tests/Drupal/KernelTests/Config/TypedConfigTest.php"
    CORE_TESTS: "core/modules/config/tests/src/Functional/ConfigImportUITest.php core/modules/jsonapi/tests/src/Functional/ConfigTestTest.php core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityAdapterTest.php core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php core/tests/Drupal/KernelTests/Core/DependencyInjection/AutowireTest.php core/tests/Drupal/KernelTests/Core/DependencyInjection/AutoconfigurationTest.php core/tests/Drupal/KernelTests/Config/TypedConfigTest.php core/profiles/standard/tests/src/Functional/StandardTest.php"
  #    SYMFONY_DEPRECATIONS_HELPER: "max[self]=0"
  before_script:
    - ln -s $CI_PROJECT_DIR /var/www/html/subdirectory
+10 −2
Original line number Diff line number Diff line
@@ -187,8 +187,7 @@ function (ConstraintViolation $v) {

    // Make sure the optional image styles are installed after enabling
    // the responsive_image module.
    \Drupal::service('module_installer')->install(['responsive_image']);
    $this->rebuildContainer();
    $this->installResponsiveImage();
    $this->drupalGet('admin/config/media/image-styles');
    $this->assertSession()->pageTextContains('Max 325x325');
    $this->assertSession()->pageTextContains('Max 650x650');
@@ -312,4 +311,13 @@ function (ConstraintViolation $v) {
    $this->assertSession()->statusCodeEquals(403);
  }

  /**
   * Installs the responsive image module.
   */
  protected function installResponsiveImage(): void {
    // Install responsive_image module.
    \Drupal::service('module_installer')->install(['responsive_image']);
    $this->rebuildContainer();
  }

}
+4 −17
Original line number Diff line number Diff line
@@ -141,24 +141,11 @@ public function testStandard(): void {

  /**
   * {@inheritdoc}
   *
   * @todo https://www.drupal.org/i/3439750 Remove this.
   */
  protected function rebuildContainer(): void {
    // Compare the module list before and after the container is rebuilt, to
    // determine if any modules were installed.
    $modules_before = array_keys($this->container->get('module_handler')->getModuleList());
    parent::rebuildContainer();
    $modules_after = array_keys($this->container->get('module_handler')->getModuleList());

    // If responsive_image was installed, apply the recipe that provides the
    // responsive image styles. We cannot just do this unconditionally, because
    // the parent class explicitly asserts that the image styles don't exist
    // if responsive_image is not installed.
    $installed = array_diff($modules_after, $modules_before);
    if (in_array('responsive_image', $installed, TRUE)) {
  protected function installResponsiveImage(): void {
    // Overrides StandardTest::installResponsiveImage() in order to use the
    // recipe.
    $this->applyRecipe('core/recipes/standard_responsive_images');
  }
  }

}