You are here

public function RestrictIpBrowserTestBase::selectRadio in Restrict IP 3.x

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/RestrictIpBrowserTestBase.php \Drupal\Tests\restrict_ip\Functional\RestrictIpBrowserTestBase::selectRadio()
  2. 8 tests/src/Functional/RestrictIpBrowserTestBase.php \Drupal\Tests\restrict_ip\Functional\RestrictIpBrowserTestBase::selectRadio()
4 calls to RestrictIpBrowserTestBase::selectRadio()
RestrictIpAccessTest::testBlacklistedPaths in tests/src/Functional/RestrictIpAccessTest.php
RestrictIpAccessTest::testRedirectToLoginWhenBypassByRoleEnabled in tests/src/Functional/RestrictIpAccessTest.php
RestrictIpAccessTest::testWhitelistedPaths in tests/src/Functional/RestrictIpAccessTest.php
RestrictIpAdminUiTest::testRestrictIpAdminPage in tests/src/Functional/RestrictIpAdminUiTest.php
* Test that the admin UI page is properly linked to, that all the required elements * exist, and that the form is working properly

File

tests/src/Functional/RestrictIpBrowserTestBase.php, line 34

Class

RestrictIpBrowserTestBase
Provides some helper functions for functional tests.

Namespace

Drupal\Tests\restrict_ip\Functional

Code

public function selectRadio($htmlID) {
  if (preg_match('/^#/', $htmlID)) {
    $htmlID = substr($htmlID, 1);
  }
  $radio = $this
    ->getSession()
    ->getPage()
    ->findField($htmlID);
  $name = $radio
    ->getAttribute('name');
  $option = $radio
    ->getAttribute('value');
  $this
    ->getSession()
    ->getPage()
    ->selectFieldOption($name, $option);
}