You are here

public function TestBase::checkTestHierarchyMismatch in SimpleTest 8.3

Fail the test if it belongs to a PHPUnit-based framework.

This would probably be caused by automated test conversions such as those in https://www.drupal.org/project/drupal/issues/2770921.

1 call to TestBase::checkTestHierarchyMismatch()
TestBase::run in src/TestBase.php
Run all tests in this class.

File

src/TestBase.php, line 262

Class

TestBase
Base class for Drupal tests.

Namespace

Drupal\simpletest

Code

public function checkTestHierarchyMismatch() {

  // We can use getPhpunitTestSuite() because it uses a regex on the class'
  // namespace to deduce the PHPUnit test suite.
  if (TestDiscovery::getPhpunitTestSuite(get_class($this)) !== FALSE) {
    $this
      ->fail(get_class($this) . ' incorrectly subclasses ' . __CLASS__ . ', it should probably extend \\Drupal\\Tests\\BrowserTestBase instead.');
  }
}