class NoClassMetadataOnAbstractTestClassesTest

Tests NoClassMetadataOnAbstractTestClasses rule.

@extends RuleTestCase<NoClassMetadataOnAbstractTestClasses>

Hierarchy

Expanded class hierarchy of NoClassMetadataOnAbstractTestClassesTest

File

core/tests/PHPStan/tests/NoClassMetadataOnAbstractTestClassesTest.php, line 19

Namespace

Drupal\PHPStan\Tests
View source
class NoClassMetadataOnAbstractTestClassesTest extends RuleTestCase {
  
  /**
   * {@inheritdoc}
   */
  protected function getRule() : Rule {
    return new NoClassMetadataOnAbstractTestClasses(self::getContainer()->getByType(ReflectionProvider::class));
  }
  
  /**
   * {@inheritdoc}
   */
  public function testRule() : void {
    $this->analyse([
      __DIR__ . '/../fixtures/abstract-test-classes.php',
    ], [
      [
        'Abstract test class Drupal\\Tests\\Core\\Foo\\BarTest must not add attribute PHPUnit\\Framework\\Attributes\\RunTestsInSeparateProcesses.',
        16,
      ],
      [
        'Abstract test class Drupal\\Tests\\Core\\Foo\\BarTest must not add annotation @group.',
        16,
      ],
      [
        'Abstract test class Drupal\\Tests\\Core\\Foo\\BarTest must not add annotation @coversNothing.',
        16,
      ],
    ]);
  }

}

Members


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