You are here

public function AttributeHelperTest::testAttributeExists in Drupal 9

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

@covers ::attributeExists @dataProvider providerTestAttributeExists

File

core/tests/Drupal/Tests/Core/Template/AttributeHelperTest.php, line 36

Class

AttributeHelperTest
@coversDefaultClass \Drupal\Core\Template\AttributeHelper @group Template

Namespace

Drupal\Tests\Core\Template

Code

public function testAttributeExists(array $test_data, $test_attribute, $expected) {
  $this
    ->assertSame($expected, AttributeHelper::attributeExists($test_attribute, $test_data));
  $attributes = new Attribute($test_data);
  $this
    ->assertSame($expected, AttributeHelper::attributeExists($test_attribute, $attributes));
}