You are here

public function ForcePasswordChangeBrowserTestBase::selectRadio in Force Password Change 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Functional/ForcePasswordChangeBrowserTestBase.php \Drupal\Tests\force_password_change\Functional\ForcePasswordChangeBrowserTestBase::selectRadio()
3 calls to ForcePasswordChangeBrowserTestBase::selectRadio()
ForcePasswordChangeAdminUiTest::testForcePasswordChangeAdminPage in tests/src/Functional/ForcePasswordChangeAdminUiTest.php
* Test that the admin UI page is properly linked to, that all the required elements * exist, and that the form is working properly
ForcePasswordChangeFunctionalityTest::testNextLoginPasswordForce in tests/src/Functional/ForcePasswordChangeFunctionalityTest.php
* Tests that users in a given role that has it's passwords forced are forced * to change their password on next login when the settings are set for next login.
ForcePasswordChangeFunctionalityTest::testUserEditPageForcePassword in tests/src/Functional/ForcePasswordChangeFunctionalityTest.php
* Test that the force password change checkbox on the user edit page works

File

tests/src/Functional/ForcePasswordChangeBrowserTestBase.php, line 64

Class

ForcePasswordChangeBrowserTestBase
Provides some helper functions for functional tests.

Namespace

Drupal\Tests\force_password_change\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);
}