You are here

private function ServiceControllerTest::assertRedirectedToFrontPageOnHandle in CAS 8

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

Assert user redirected to homepage when controller invoked.

3 calls to ServiceControllerTest::assertRedirectedToFrontPageOnHandle()
ServiceControllerTest::testMissingTicketRedirectsHome in tests/src/Unit/Controller/ServiceControllerTest.php
Tests that we redirect to the homepage when no service ticket is present.
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 565

Class

ServiceControllerTest
ServiceController unit tests.

Namespace

Drupal\Tests\cas\Unit\Controller

Code

private function assertRedirectedToFrontPageOnHandle($serviceController) {

  // URL Generator will generate a path to the homepage.
  $this->urlGenerator
    ->expects($this
    ->once())
    ->method('generate')
    ->with('<front>')
    ->will($this
    ->returnValue('http://example.com/front'));
  $response = $serviceController
    ->handle();
  $this
    ->assertTrue($response
    ->isRedirect('http://example.com/front'));
}