class AnnotationBaseTest

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php \Drupal\Tests\Component\Annotation\AnnotationBaseTest
  2. 8.9.x core/tests/Drupal/Tests/Component/Annotation/AnnotationBaseTest.php \Drupal\Tests\Component\Annotation\AnnotationBaseTest
  3. 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 14

Namespace

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

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