Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot committed Nov 7, 2024
1 parent dea5190 commit 051c2b0
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tests/OAuthTwoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ public function it_can_return_the_service_container_key(): void
*/
public function userReturnsAUserInstanceForTheAuthenticatedRequest(): void
{
$session = m::mock(SessionInterface::class);
$session = m::mock(SessionContract::class);
$request = Request::create('foo', 'GET', [
'state' => str_repeat('A', 40),
'code' => 'code',
]);
$request->setSession($session);
$request->setLaravelSession($session);
$session
->shouldReceive('pull')
->once()
Expand Down Expand Up @@ -94,13 +94,13 @@ public function userReturnsAUserInstanceForTheAuthenticatedRequest(): void
*/
public function access_token_response_body_is_accessible_from_user(): void
{
$session = m::mock(SessionInterface::class);
$session = m::mock(SessionContract::class);
$accessTokenResponseBody = '{"access_token": "access_token", "test": "test"}';
$request = Request::create('foo', 'GET', [
'state' => str_repeat('A', 40),
'code' => 'code',
]);
$request->setSession($session);
$request->setLaravelSession($session);
$session
->shouldReceive('pull')
->once()
Expand Down Expand Up @@ -139,13 +139,13 @@ public function access_token_response_body_is_accessible_from_user(): void
*/
public function regular_laravel_socialite_class_works_as_well(): void
{
$session = m::mock(SessionInterface::class);
$session = m::mock(SessionContract::class);
$accessTokenResponseBody = '{"access_token": "access_token", "test": "test"}';
$request = Request::create('foo', 'GET', [
'state' => str_repeat('A', 40),
'code' => 'code',
]);
$request->setSession($session);
$request->setLaravelSession($session);
$session
->shouldReceive('pull')
->once()
Expand Down Expand Up @@ -186,12 +186,12 @@ public function exceptionIsThrownIfStateIsInvalid(): void
{
$this->expectExceptionObject(new InvalidStateException());

$session = m::mock(SessionInterface::class);
$session = m::mock(SessionContract::class);
$request = Request::create('foo', 'GET', [
'state' => str_repeat('B', 40),
'code' => 'code',
]);
$request->setSession($session);
$request->setLaravelSession($session);
$session
->shouldReceive('pull')
->once()
Expand All @@ -208,12 +208,12 @@ public function exceptionIsThrownIfStateIsNotSet(): void
{
$this->expectExceptionObject(new InvalidStateException());

$session = m::mock(SessionInterface::class);
$session = m::mock(SessionContract::class);
$request = Request::create('foo', 'GET', [
'state' => 'state',
'code' => 'code',
]);
$request->setSession($session);
$request->setLaravelSession($session);
$session
->shouldReceive('pull')
->once()
Expand All @@ -227,13 +227,13 @@ public function exceptionIsThrownIfStateIsNotSet(): void
*/
public function userObjectShouldBeCachedOnFirstCall(): void
{
$session = m::mock(SessionInterface::class);
$session = m::mock(SessionContract::class);
$accessTokenResponseBody = '{"access_token": "access_token", "test": "test"}';
$request = Request::create('foo', 'GET', [
'state' => str_repeat('A', 40),
'code' => 'code',
]);
$request->setSession($session);
$request->setLaravelSession($session);
$session
->shouldReceive('pull')
->once()
Expand Down

0 comments on commit 051c2b0

Please sign in to comment.