You are here

public function LTIToolProviderControllerTest::testLtiLaunchWithContext in LTI Tool Provider 8

Same name and namespace in other branches
  1. 2.x tests/src/Unit/LTIToolProviderControllerTest.php \Drupal\Tests\lti_tool_provider\Unit\LTIToolProviderControllerTest::testLtiLaunchWithContext()

@dataProvider ltiLaunchWithContextDataProvider @covers ::ltiLaunch @covers ::__construct

Parameters

RedirectResponse $expected:

Request $request:

SessionInterface $session:

mixed $context:

string | null $destination:

File

tests/src/Unit/LTIToolProviderControllerTest.php, line 146

Class

LTIToolProviderControllerTest
LTIToolProviderController unit tests.

Namespace

Drupal\Tests\lti_tool_provider\Unit

Code

public function testLtiLaunchWithContext(RedirectResponse $expected, Request $request, SessionInterface $session, $context, ?string $destination) {
  $controller = new LTIToolProviderController($this->configFactory, $this->loggerFactory, $this->eventDispatcher, $this->killSwitch, $request, $session, $context, $destination);
  $actual = $controller
    ->ltiLaunch();
  $this
    ->assertInstanceOf(RedirectResponse::class, $actual);
  $this
    ->assertEquals($expected
    ->getTargetUrl(), $actual
    ->getTargetUrl());
}