Skip to content

Commit

Permalink
Fix tests (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmichot authored Nov 7, 2024
1 parent dea5190 commit ab8588a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
fail-fast: false
matrix:
coverage: [ 'none' ]
php-versions: [ '8.0', '8.1', '8.2' ]
php-versions: [ '8.0', '8.1', '8.2', '8.3', '8.4' ]
exclude:
- php-versions: '8.2'
- php-versions: '8.3'
include:
- php-versions: '8.2'
- php-versions: '8.3'
coverage: 'xdebug'

name: PHP ${{ matrix.php-versions }}
Expand Down
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 ab8588a

Please sign in to comment.