You are here

function SecureSiteFormGuestTest::testSecureSiteTypeFormGuestUnsetRandomAccess in Secure Site 8

Request home page with random credentials and access enabled.

File

src/Tests/FormAuth/SecureSiteFormGuestTest.php, line 68
Contains Drupal\securesite\Tests\FormAuth\SecureSiteFormGuestTest

Class

SecureSiteFormGuestTest
Functional tests for form authentication with guest credentials.

Namespace

Drupal\securesite\Tests\FormAuth

Code

function testSecureSiteTypeFormGuestUnsetRandomAccess() {
  user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
    'access secured pages',
  ));
  $this
    ->drupalPostForm('', array(
    'name' => $this
      ->randomName(),
    'pass' => user_password(),
  ), 'Log in');
  $this
    ->assertNoFieldByXPath('//form[@id="securesite-user-login"]', '', t('Requesting home page with random credentials and guest access enabled.'));
  $this
    ->assertFieldByXPath('//form[@id="user-login-form"]', '', t('Checking for user log-in form when guest access is enabled and random password is given.'));
}