You are here

class AnnotationBaseTest in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php \Drupal\Tests\Component\Annotation\AnnotationBaseTest
  2. 10 core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php \Drupal\Tests\Component\Annotation\AnnotationBaseTest

@coversDefaultClass \Drupal\Component\Annotation\AnnotationBase @group Annotation

Hierarchy

  • class \Drupal\Tests\Component\Annotation\AnnotationBaseTest extends \PHPUnit\Framework\TestCase

Expanded class hierarchy of AnnotationBaseTest

File

core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php, line 12

Namespace

Drupal\Tests\Component\Annotation
View source
class AnnotationBaseTest extends TestCase {

  /**
   * @covers ::getProvider
   * @covers ::setProvider
   */
  public function testSetProvider() {
    $plugin = new AnnotationBaseStub();
    $plugin
      ->setProvider('example');
    $this
      ->assertEquals('example', $plugin
      ->getProvider());
  }

  /**
   * @covers ::getId
   */
  public function testGetId() {
    $plugin = new AnnotationBaseStub();

    // Doctrine sets the public prop directly.
    $plugin->id = 'example';
    $this
      ->assertEquals('example', $plugin
      ->getId());
  }

  /**
   * @covers ::getClass
   * @covers ::setClass
   */
  public function testSetClass() {
    $plugin = new AnnotationBaseStub();
    $plugin
      ->setClass('example');
    $this
      ->assertEquals('example', $plugin
      ->getClass());
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AnnotationBaseTest::testGetId public function @covers ::getId
AnnotationBaseTest::testSetClass public function @covers ::getClass @covers ::setClass
AnnotationBaseTest::testSetProvider public function @covers ::getProvider @covers ::setProvider