test-methods-with-metadata.php

Namespace

Drupal\Tests\Core\Foo

File

core/tests/PHPStan/fixtures/test-methods-with-metadata.php

View source
<?php

// phpcs:ignoreFile
declare (strict_types=1);
namespace Drupal\Tests\Core\Foo;

use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
class FriendsTest extends TestCase {
  public function testWithAttribute() : void {
  }
  
  /**
   * @group Chandler
   */
  public function testWithAttributeAndForbiddenAnnotation() : void {
  }
  
  /**
   * @legacy-covers ::phoebe
   */
  public function testWithAttributeAndAllowedAnnotation() : void {
  }
  
  /**
   * @group Janice
   */
  public function testWithForbiddenAnnotation() : void {
  }
  
  /**
   * @see Monica
   */
  public function testWithAllowedAnnotation() : void {
  }
  
  /**
   * This test method has a legacy covers annotation.
   *
   * @legacy-covers ::ben
   */
  public function testWithLegacyCoversAnnotation() : void {
  }
  public function testNoMetadata() : void {
  }

}
class ExtendFriendsTest extends FriendsTest {

}
trait FriendsTrait {
  public function testInTraitWithAttribute() : void {
  }
  
  /**
   * @group Chandler
   */
  public function testInTraitWithAttributeAndForbiddenAnnotation() : void {
  }
  
  /**
   * @legacy-covers ::phoebe
   */
  public function testInTraitWithAttributeAndAllowedAnnotation() : void {
  }
  
  /**
   * @group Janice
   */
  public function testInTraitWithForbiddenAnnotation() : void {
  }
  
  /**
   * @see Monica
   */
  public function testInTraitWithAllowedAnnotation() : void {
  }
  
  /**
   * This test method has a legacy covers annotation.
   *
   * @legacy-covers ::ben
   */
  public function testInTraitWithLegacyCoversAnnotation() : void {
  }
  public function testInTraitNoMetadata() : void {
  }

}
class FriendsWithFriendsTraitTest extends TestCase {
  use FriendsTrait;

}
class FriendsNotATestClass {
  public function noMetadata() : void {
  }

}

Classes

Traits

Title Deprecated Summary
FriendsTrait

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