You are here

protected function CasTestTrait::casLogin in CAS 2.x

Same name and namespace in other branches
  1. 8 tests/src/Traits/CasTestTrait.php \Drupal\Tests\cas\Traits\CasTestTrait::casLogin()

Logs-in the user to the CAS mock server.

Parameters

string $email: The CAS email.

string $password: The CAS user password.

3 calls to CasTestTrait::casLogin()
CasEventsTest::testLoginCancelling in tests/src/Functional/CasEventsTest.php
Tests cancelling the login process from a subscriber.
CasEventsTest::testRegistrationCancelling in tests/src/Functional/CasEventsTest.php
Tests cancelling the login with auto register process from a subscriber.
CasUserInteractionTest::casLogin in tests/src/Functional/CasUserInteractionTest.php
Logs-in the user to the CAS mock server.

File

tests/src/Traits/CasTestTrait.php, line 53

Class

CasTestTrait
Provides reusable code for tests.

Namespace

Drupal\Tests\cas\Traits

Code

protected function casLogin($email, $password) {
  $query = [
    'service' => Url::fromRoute('cas.service')
      ->setAbsolute()
      ->toString(),
  ];
  $edit = [
    'email' => $email,
    'password' => $password,
  ];
  $this
    ->drupalPostForm('/cas-mock-server/login', $edit, 'Log in', [
    'query' => $query,
  ]);
}