Skip to content

Commit

Permalink
Merge branch 'v6-deep-link' into final-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhynds committed Dec 19, 2023
2 parents 5f464b9 + 36650b8 commit 0267ef0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/LtiDeepLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class LtiDeepLinkTest extends TestCase
public const DEPLOYMENT_ID = 'deployment-id';
public const LTI_RESOURCE_ARRAY = ['resource'];
private $registrationMock;
private $ltiResourceMock;
private $resourceMock;

protected function setUp(): void
{
$this->registrationMock = Mockery::mock(ILtiRegistration::class);
$this->ltiResourceMock = Mockery::mock(Resource::class);
$this->resourceMock = Mockery::mock(Resource::class);
}

public function testItInstantiates()
Expand All @@ -40,7 +40,7 @@ public function testItGetsJwtResponse()

$deepLink = new LtiDeepLink($this->registrationMock, self::DEPLOYMENT_ID, []);

$result = $deepLink->getResponseJwt([$this->ltiResourceMock]);
$result = $deepLink->getResponseJwt([$this->resourceMock]);

$publicKey = new Key(file_get_contents(__DIR__.'/data/public.key'), 'RS256');
$resultPayload = JWT::decode($result, $publicKey);
Expand All @@ -61,7 +61,7 @@ public function testJwtResponseDoesNotContainDataPropertyWhenNotSet()

$deepLink = new LtiDeepLink($this->registrationMock, self::DEPLOYMENT_ID, []);

$result = $deepLink->getResponseJwt([$this->ltiResourceMock]);
$result = $deepLink->getResponseJwt([$this->resourceMock]);

$publicKey = new Key(file_get_contents(__DIR__.'/data/public.key'), 'RS256');
$resultPayload = JWT::decode($result, $publicKey);
Expand All @@ -79,7 +79,7 @@ public function testJwtResponseContainsDataPropertyWhenSet()
'data' => $dataValue,
]);

$result = $deepLink->getResponseJwt([$this->ltiResourceMock]);
$result = $deepLink->getResponseJwt([$this->resourceMock]);

$publicKey = new Key(file_get_contents(__DIR__.'/data/public.key'), 'RS256');
$resultPayload = JWT::decode($result, $publicKey);
Expand All @@ -106,7 +106,7 @@ private function setupMocksExpectations(): void
->once()
->andReturn('kid');

$this->ltiResourceMock
$this->resourceMock
->shouldReceive('toArray')
->once()
->andReturn(self::LTI_RESOURCE_ARRAY);
Expand Down

0 comments on commit 0267ef0

Please sign in to comment.