class AnnotationBaseTest

Tests Drupal\Component\Annotation\AnnotationBase.

Attributes

#[CoversClass(AnnotationBase::class)] #[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 15

Namespace

Drupal\Tests\Component\Annotation
View source
class AnnotationBaseTest extends TestCase {
  
  /**
   * @legacy-covers ::getProvider
   * @legacy-covers ::setProvider
   */
  public function testSetProvider() : void {
    $plugin = new AnnotationBaseStub();
    $plugin->setProvider('example');
    $this->assertEquals('example', $plugin->getProvider());
  }
  
  /**
   * @legacy-covers ::getId
   */
  public function testGetId() : void {
    $plugin = new AnnotationBaseStub();
    // Doctrine sets the public prop directly.
    $plugin->id = 'example';
    $this->assertEquals('example', $plugin->getId());
  }
  
  /**
   * @legacy-covers ::getClass
   * @legacy-covers ::setClass
   */
  public function testSetClass() : void {
    $plugin = new AnnotationBaseStub();
    $plugin->setClass('example');
    $this->assertEquals('example', $plugin->getClass());
  }

}

Members

Title Sort descending Modifiers Object type Summary
AnnotationBaseTest::testGetId public function @legacy-covers ::getId
AnnotationBaseTest::testSetClass public function @legacy-covers ::getClass
@legacy-covers ::setClass
AnnotationBaseTest::testSetProvider public function @legacy-covers ::getProvider
@legacy-covers ::setProvider

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