protected function ViewTestBase::helperButtonHasLabel

Asserts the existence of a button with a certain ID and label.

Parameters

string $id: The HTML ID of the button

string $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 asserion was succesful, or FALSE on failure.

2 calls to ViewTestBase::helperButtonHasLabel()
ExposedFormTest::testExposedAdminUi in drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/ExposedFormTest.php
Tests the admin interface of exposed filter and sort items.
ExposedFormTest::testRenameResetButton in drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/ExposedFormTest.php
Tests, whether and how the reset button can be renamed.

File

drupal/core/modules/views/lib/Drupal/views/Tests/ViewTestBase.php, line 207
Contains \Drupal\views\Tests\ViewTestBase.

Class

ViewTestBase
Defines a base class for Views testing in the full web test environment.

Namespace

Drupal\views\Tests

Code

protected function helperButtonHasLabel($id, $expected_label, $message = 'Label has the expected value: %label.') {
  return $this
    ->assertFieldById($id, $expected_label, t($message, array(
    '%label' => $expected_label,
  )));
}