Commit 408df6b7 authored by catch's avatar catch
Browse files

Revert "Issue #3462383 by phenaproxima, catch, alexpott, longwave: CoreRecipesTest is slow"

This reverts commit e47f22df.
parent d75b4e27
Loading
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -106,15 +106,6 @@ public function registerTestNamespaces() {
      $this->testNamespaces["Drupal\\Tests\\$name\\"][] = "$base_path/tests/src";
    }

    // Expose tests provided by core recipes.
    $base_path = $this->root . '/core/recipes';
    if (@opendir($base_path)) {
      while (($recipe = readdir()) !== FALSE) {
        $this->testNamespaces["Drupal\\Tests\\Recipe\\Core\\$recipe\\"][] = "$base_path/$recipe/tests/src";
      }
      closedir();
    }

    foreach ($this->testNamespaces as $prefix => $paths) {
      $this->classLoader->addPsr4($prefix, $paths);
    }
+0 −55
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace Drupal\Tests\system\Functional\Recipe;

use Drupal\FunctionalTests\Core\Recipe\RecipeTestTrait;
use Drupal\Tests\BrowserTestBase;

/**
 * Runs a series of generic tests for one recipe.
 */
abstract class GenericRecipeTestBase extends BrowserTestBase {

  use RecipeTestTrait;

  /**
   * {@inheritdoc}
   */
  protected $profile = 'minimal';

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * Returns the path of the recipe under test.
   *
   * @return string
   *   The absolute path of the recipe that contains this test.
   */
  protected function getRecipePath(): string {
    // Assume this test in located in RECIPE_DIR/tests/src/Functional.
    return dirname((new \ReflectionObject($this))->getFileName(), 4);
  }

  /**
   * Applies the recipe under test.
   */
  protected function doApply(): void {
    $this->applyRecipe($this->getRecipePath());
  }

  /**
   * Tests that this recipe can be applied multiple times.
   */
  public function testRecipeCanBeApplied(): void {
    $this->setUpCurrentUser(admin: TRUE);
    $this->doApply();
    // Apply the recipe again to prove that it is idempotent.
    $this->doApply();
  }

}
+0 −3
Original line number Diff line number Diff line
@@ -88,7 +88,6 @@
    <testsuite name="kernel">
      <directory>tests/Drupal/KernelTests</directory>
      <directory>modules/**/tests/src/Kernel</directory>
      <directory>recipes/*/tests/src/Kernel</directory>
      <directory>profiles/**/tests/src/Kernel</directory>
      <directory>themes/**/tests/src/Kernel</directory>
      <directory>../modules/**/tests/src/Kernel</directory>
@@ -99,7 +98,6 @@
      <directory>tests/Drupal/FunctionalTests</directory>
      <directory>modules/**/tests/src/Functional</directory>
      <directory>profiles/**/tests/src/Functional</directory>
      <directory>recipes/*/tests/src/Functional</directory>
      <directory>themes/**/tests/src/Functional</directory>
      <directory>../modules/**/tests/src/Functional</directory>
      <directory>../profiles/**/tests/src/Functional</directory>
@@ -108,7 +106,6 @@
    <testsuite name="functional-javascript">
      <directory>tests/Drupal/FunctionalJavascriptTests</directory>
      <directory>modules/**/tests/src/FunctionalJavascript</directory>
      <directory>recipes/*/tests/src/FunctionalJavascript</directory>
      <directory>profiles/**/tests/src/FunctionalJavascript</directory>
      <directory>themes/**/tests/src/FunctionalJavascript</directory>
      <directory>../modules/**/tests/src/FunctionalJavascript</directory>
+0 −12
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace Drupal\Tests\Recipe\Core\administrator_role\Functional;

use Drupal\Tests\system\Functional\Recipe\GenericRecipeTestBase;

/**
 * @group core_administrator_role_recipe
 */
class GenericTest extends GenericRecipeTestBase {}
+0 −12
Original line number Diff line number Diff line
<?php

declare(strict_types=1);

namespace Drupal\Tests\Recipe\Core\article_comment\Functional;

use Drupal\Tests\system\Functional\Recipe\GenericRecipeTestBase;

/**
 * @group core_article_comment_recipe
 */
class GenericTest extends GenericRecipeTestBase {}
Loading