Skip to content

Commit 41e65d5

Browse files
authored
[5.x] PHP 8.5 Compatibility (#755)
* [5.x] PHP 8.5 Compatibility Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> --------- Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent b0bcd12 commit 41e65d5

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
php: [8.1, 8.2, 8.3, 8.4]
2020
laravel: [10, 11, 12]
2121
include:
22+
- php: 8.5
23+
laravel: 12
2224
- php: 8.2
2325
laravel: 9
2426
- php: 8.1

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
},
2828
"require-dev": {
2929
"mockery/mockery": "^1.0",
30-
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0|^9.0|^10.0",
30+
"orchestra/testbench": "^4.18|^5.20|^6.47|^7.55|^8.36|^9.15|^10.8",
3131
"phpstan/phpstan": "^1.12.23",
32-
"phpunit/phpunit": "^8.0|^9.3|^10.4|^11.5"
32+
"phpunit/phpunit": "^8.0|^9.3|^10.4|^11.5|^12.0"
3333
},
3434
"autoload": {
3535
"psr-4": {

tests/GoogleProviderIdTokenTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Laravel\Socialite\Two\GoogleProvider;
99
use Laravel\Socialite\Two\User;
1010
use Mockery as m;
11+
use PHPUnit\Framework\Attributes\DataProvider;
1112
use PHPUnit\Framework\TestCase;
1213
use Psr\Http\Message\ResponseInterface;
1314
use Psr\Http\Message\StreamInterface;
@@ -30,7 +31,10 @@ public function test_it_can_detect_jwt_tokens()
3031

3132
$reflection = new \ReflectionClass($provider);
3233
$method = $reflection->getMethod('isJwtToken');
33-
$method->setAccessible(true);
34+
35+
if (PHP_VERSION_ID < 80100) {
36+
$method->setAccessible(true);
37+
}
3438

3539
$this->assertTrue($method->invoke($provider, $jwtToken));
3640
$this->assertFalse($method->invoke($provider, $accessToken));
@@ -99,6 +103,7 @@ public function test_it_falls_back_to_api_call_for_access_tokens()
99103
/**
100104
* @dataProvider invalidJwtProvider
101105
*/
106+
#[DataProvider('invalidJwtProvider')]
102107
public function test_it_handles_invalid_jwt_tokens($description, $tokenOverrides, $expectedException = true)
103108
{
104109
$provider = $this->getProvider();
@@ -145,7 +150,10 @@ public function test_user_mapping_works_with_id_token_format()
145150

146151
$reflection = new \ReflectionClass($provider);
147152
$method = $reflection->getMethod('mapUserToObject');
148-
$method->setAccessible(true);
153+
154+
if (PHP_VERSION_ID < 80100) {
155+
$method->setAccessible(true);
156+
}
149157

150158
$user = $method->invoke($provider, $idTokenUser);
151159

0 commit comments

Comments
 (0)