class AttributeBaseTest

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeBaseTest.php \Drupal\Tests\Component\Plugin\Attribute\AttributeBaseTest

@coversDefaultClass \Drupal\Component\Plugin\Attribute\AttributeBase
@group Attribute

Hierarchy

  • class \Drupal\Tests\Component\Plugin\Attribute\AttributeBaseTest implements \PHPUnit\Framework\TestCase

Expanded class hierarchy of AttributeBaseTest

File

core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeBaseTest.php, line 14

Namespace

Drupal\Tests\Component\Plugin\Attribute
View source
class AttributeBaseTest extends TestCase {
  
  /**
   * @covers ::getProvider
   * @covers ::setProvider
   */
  public function testSetProvider() : void {
    $plugin = new AttributeBaseStub(id: '1');
    $plugin->setProvider('example');
    $this->assertEquals('example', $plugin->getProvider());
  }
  
  /**
   * @covers ::getId
   */
  public function testGetId() : void {
    $plugin = new AttributeBaseStub(id: 'example');
    $this->assertEquals('example', $plugin->getId());
  }
  
  /**
   * @covers ::getClass
   * @covers ::setClass
   */
  public function testSetClass() : void {
    $plugin = new AttributeBaseStub(id: '1');
    $plugin->setClass('example');
    $this->assertEquals('example', $plugin->getClass());
  }

}

Members

Title Sort descending Modifiers Object type Summary
AttributeBaseTest::testGetId public function @covers ::getId[[api-linebreak]]
AttributeBaseTest::testSetClass public function @covers ::getClass[[api-linebreak]]
@covers ::setClass[[api-linebreak]]
AttributeBaseTest::testSetProvider public function @covers ::getProvider[[api-linebreak]]
@covers ::setProvider[[api-linebreak]]

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