You are here

public function AnnotationBaseTest::testGetId in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php \Drupal\Tests\Component\Annotation\AnnotationBaseTest::testGetId()
  2. 9 core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php \Drupal\Tests\Component\Annotation\AnnotationBaseTest::testGetId()

@covers ::getId

File

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

Class

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

Namespace

Drupal\Tests\Component\Annotation

Code

public function testGetId() {
  $plugin = new AnnotationBaseStub();

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