function GenericTestExistsTest::testGenericTestExists

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Extension/GenericTestExistsTest.php \Drupal\Tests\Core\Extension\GenericTestExistsTest::testGenericTestExists()
  2. 10 core/tests/Drupal/Tests/Core/Extension/GenericTestExistsTest.php \Drupal\Tests\Core\Extension\GenericTestExistsTest::testGenericTestExists()

Tests that the Generic module test exists for all modules.

Attributes

#[DataProvider('coreModuleListDataProvider')]

File

core/tests/Drupal/Tests/Core/Extension/GenericTestExistsTest.php, line 35

Class

GenericTestExistsTest
Tests that the Generic module test exists for all modules.

Namespace

Drupal\Tests\Core\Extension

Code

public function testGenericTestExists(string $module_name) : void {
  if (in_array($module_name, $this->modulesNoTest, TRUE)) {
    $this->markTestSkipped();
  }
  // @todo Revert to the previous version of this assertion when all core
  // modules have their GenericTest converted to a Kernel test.
  $this->assertTrue(file_exists("{$this->root}/core/modules/{$module_name}/tests/src/Functional/GenericTest.php") || file_exists("{$this->root}/core/modules/{$module_name}/tests/src/Kernel/GenericTest.php"));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.