You are here

private function ServiceControllerTest::assertSuccessfulValidation in CAS 2.x

Same name and namespace in other branches
  1. 8 tests/src/Unit/Controller/ServiceControllerTest.php \Drupal\Tests\cas\Unit\Controller\ServiceControllerTest::assertSuccessfulValidation()

Asserts that validation is executed.

3 calls to ServiceControllerTest::assertSuccessfulValidation()
ServiceControllerTest::testLoginError in tests/src/Unit/Controller/ServiceControllerTest.php
Tests for a potential login error.
ServiceControllerTest::testSuccessfulLogin in tests/src/Unit/Controller/ServiceControllerTest.php
Tests that validation and logging in occurs when a ticket is present.
ServiceControllerTest::testSuccessfulLoginProxyEnabled in tests/src/Unit/Controller/ServiceControllerTest.php
Tests that a user is validated and logged in with Drupal acting as proxy.

File

tests/src/Unit/Controller/ServiceControllerTest.php, line 589

Class

ServiceControllerTest
ServiceController unit tests.

Namespace

Drupal\Tests\cas\Unit\Controller

Code

private function assertSuccessfulValidation($returnto, $for_proxy = FALSE) {
  $service_params = [];
  if ($returnto) {
    $service_params['returnto'] = 'node/1';
  }
  $validation_data = new CasPropertyBag('testuser');
  if ($for_proxy) {
    $validation_data
      ->setPgt('testpgt');
  }

  // Validation service should be called for that ticket.
  $this->casValidator
    ->expects($this
    ->once())
    ->method('validateTicket')
    ->with($this
    ->equalTo('ST-foobar'), $this
    ->equalTo($service_params))
    ->will($this
    ->returnValue($validation_data));
}