function AssertLegacyTrait::assertOption

Same name and namespace in other branches
  1. 9 core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php \Drupal\FunctionalTests\AssertLegacyTrait::assertOption()

Asserts that a select option in the current page exists.

Parameters

string $id: ID of select field to assert.

string $option: Option to assert.

Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->optionExists() instead.

2 calls to AssertLegacyTrait::assertOption()
BrowserTestBaseTest::testFieldAssertsForOptions in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
Tests legacy field asserts for options field type.
InstallerLanguagePageTest::setUpLanguage in core/tests/Drupal/FunctionalTests/Installer/InstallerLanguagePageTest.php
Installer step: Select language.

File

core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php, line 452

Class

AssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\FunctionalTests

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.