You are here

protected function WebTestExtended::checkExpectedOptions in Scheduled Updates 8

Utility function to check that a select has only the expected options.

Parameters

string $select_id: The field name.

array $expected_options: The expected options.

array $unexpected_options: The unexpected options.

1 call to WebTestExtended::checkExpectedOptions()
AddFieldScheduledUpdateTypeTest::checkAddUpdateField in tests/src/FunctionalJavascript/AddFieldScheduledUpdateTypeTest.php
Test to check from manage fields on Node.

File

tests/src/FunctionalJavascript/WebTestExtended.php, line 114
Contains \Drupal\Tests\scheduled_updates\WebTestExtended.

Class

WebTestExtended
BrowserTestBase plus project agnostic helper functions.

Namespace

Drupal\Tests\scheduled_updates\FunctionalJavascript

Code

protected function checkExpectedOptions($select_id, $expected_options, $unexpected_options = []) {
  foreach ($expected_options as $expected_option) {
    $this
      ->assertOption($select_id, $expected_option);
  }
  foreach ($unexpected_options as $unexpected_option) {
    $this
      ->assertNoOption($select_id, $unexpected_option);
  }
}