You are here

public function LTIToolProviderControllerTest::testAccess 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::testAccess()

@dataProvider accessDataProvider @covers ::access @covers ::__construct

Parameters

$expected:

Request $request:

SessionInterface $session:

mixed $context:

string | null $destination:

File

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

Class

LTIToolProviderControllerTest
LTIToolProviderController unit tests.

Namespace

Drupal\Tests\lti_tool_provider\Unit

Code

public function testAccess($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
    ->access();
  $this
    ->assertInstanceOf(AccessResult::class, $actual);
  $this
    ->assertEquals($expected, $actual);
}