You are here

public function AttributeTest::testHasAttribute in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::testHasAttribute()

@covers ::hasAttribute @dataProvider providerTestHasAttribute

File

core/tests/Drupal/Tests/Core/Template/AttributeTest.php, line 479

Class

AttributeTest
@coversDefaultClass \Drupal\Core\Template\Attribute @group Template

Namespace

Drupal\Tests\Core\Template

Code

public function testHasAttribute(array $test_data, $test_attribute, $expected) {
  $attributes = new Attribute($test_data);
  $this
    ->assertSame($expected, $attributes
    ->hasAttribute($test_attribute));
}