From 051c2b0e40bf2306ed3c0d2af5b4573bfae49b4e Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Thu, 7 Nov 2024 22:22:33 +0100 Subject: [PATCH] Fix tests --- tests/OAuthTwoTest.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/OAuthTwoTest.php b/tests/OAuthTwoTest.php index a80be99..8a3b176 100644 --- a/tests/OAuthTwoTest.php +++ b/tests/OAuthTwoTest.php @@ -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() @@ -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() @@ -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() @@ -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() @@ -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() @@ -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()