function ViewTestBase::helperButtonHasLabel
Same name in this branch
- 8.9.x core/modules/views/tests/src/Functional/ViewTestBase.php \Drupal\Tests\views\Functional\ViewTestBase::helperButtonHasLabel()
Same name in other branches
- 9 core/modules/views/tests/src/Functional/ViewTestBase.php \Drupal\Tests\views\Functional\ViewTestBase::helperButtonHasLabel()
- 10 core/modules/views/tests/src/Functional/ViewTestBase.php \Drupal\Tests\views\Functional\ViewTestBase::helperButtonHasLabel()
- 11.x core/modules/views/tests/src/Functional/ViewTestBase.php \Drupal\Tests\views\Functional\ViewTestBase::helperButtonHasLabel()
Asserts the existence of a button with a certain ID and label.
Parameters
string $id: The HTML ID of the button
string $expected_label: The expected label for the button.
string $message: (optional) A custom message to display with the assertion. If no custom message is provided, the message will indicate the button label.
Return value
bool TRUE if the assertion was successful, or FALSE on failure.
File
-
core/
modules/ views/ src/ Tests/ ViewTestBase.php, line 109
Class
- ViewTestBase
- Defines a base class for Views testing in the full web test environment.
Namespace
Drupal\views\TestsCode
protected function helperButtonHasLabel($id, $expected_label, $message = 'Label has the expected value: %label.') {
return $this->assertFieldById($id, $expected_label, t($message, [
'%label' => $expected_label,
]));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.