You are here

protected function WebformAssertLegacyTrait::assertOptionByText in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/src/Traits/WebformAssertLegacyTrait.php \Drupal\Tests\webform\Traits\WebformAssertLegacyTrait::assertOptionByText()

Asserts that a select option with the visible text exists.

Parameters

string $id: The ID of the select field to assert.

string $text: The text for the option tag to assert.

File

tests/src/Traits/WebformAssertLegacyTrait.php, line 434

Class

WebformAssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\Tests\webform\Traits

Code

protected function assertOptionByText($id, $text) {
  return $this
    ->assertSession()
    ->optionExists($id, $text);
}