You are here

protected function ViewTestBase::helperButtonHasLabel in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/views/src/Tests/ViewTestBase.php \Drupal\views\Tests\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 assertion was successful, or FALSE on failure.

4 calls to ViewTestBase::helperButtonHasLabel()
ExposedFormTest::testInputRequired in core/modules/views/src/Tests/Plugin/ExposedFormTest.php
Test the input required exposed form type.
ExposedFormTest::testResetButton in core/modules/views/src/Tests/Plugin/ExposedFormTest.php
Tests whether the reset button works on an exposed form.
ExposedFormTest::testSubmitButton in core/modules/views/src/Tests/Plugin/ExposedFormTest.php
Tests the submit button.
ExposedFormUITest::testExposedAdminUi in core/modules/views_ui/src/Tests/ExposedFormUITest.php
Tests the admin interface of exposed filter and sort items.

File

core/modules/views/src/Tests/ViewTestBase.php, line 108
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,
  )));
}