function AttributeBaseTest::testSetClass

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Component/Plugin/Attribute/AttributeBaseTest.php \Drupal\Tests\Component\Plugin\Attribute\AttributeBaseTest::testSetClass()

@covers ::getClass @covers ::setClass

File

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

Class

AttributeBaseTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Component%21Plugin%21Attribute%21AttributeBase.php/class/AttributeBase/11.x" title="Provides a base class for classed attributes." class="local">\Drupal\Component\Plugin\Attribute\AttributeBase</a> @group Attribute

Namespace

Drupal\Tests\Component\Plugin\Attribute

Code

public function testSetClass() : void {
    $plugin = new AttributeBaseStub(id: '1');
    $plugin->setClass('example');
    $this->assertEquals('example', $plugin->getClass());
}

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