public function AttributeTest::providerTestHasAttribute in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::providerTestHasAttribute()
- 9 core/tests/Drupal/Tests/Core/Template/AttributeTest.php \Drupal\Tests\Core\Template\AttributeTest::providerTestHasAttribute()
Provides tests data for testHasAttribute.
Return value
array An array of test data each containing an array of attributes, the name of the attribute to check existence of, and the expected result.
File
- core/
tests/ Drupal/ Tests/ Core/ Template/ AttributeTest.php, line 473
Class
- AttributeTest
- @coversDefaultClass \Drupal\Core\Template\Attribute @group Template
Namespace
Drupal\Tests\Core\TemplateCode
public function providerTestHasAttribute() {
return [
[
[
'class' => [
'example-class',
],
],
'class',
TRUE,
],
[
[],
'class',
FALSE,
],
[
[
'class' => [
'example-class',
],
],
'id',
FALSE,
],
[
[
'class' => [
'example-class',
],
'id' => 'foo',
],
'id',
TRUE,
],
[
[
'id' => 'foo',
],
'class',
FALSE,
],
];
}