Skip to content

Commit 9f54915

Browse files
ci: Test against PHP 8.5 (#1046)
Co-authored-by: Alex Bouma <alex@bouma.me>
1 parent e76b71f commit 9f54915

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
php: [ "8.4", "8.3", "8.2", "8.1" ]
28+
php: [ "8.5", "8.4", "8.3", "8.2", "8.1" ]
2929
packages:
3030
# All versions below only support PHP ^8.1 (Laravel requirement)
3131
- { laravel: ^10.0, testbench: ^8.0, phpunit: 9.6.* }
@@ -84,7 +84,7 @@ jobs:
8484
strategy:
8585
fail-fast: false
8686
matrix:
87-
php: [ "8.4", "8.3", "8.2", "8.1", "8.0", "7.4", "7.3", "7.2" ]
87+
php: [ "8.5", "8.4", "8.3", "8.2", "8.1", "8.0", "7.4", "7.3", "7.2" ]
8888
packages:
8989
# All versions below should be test on PHP ^7.1 (Sentry SDK requirement) and PHP < 8.0 (PHPUnit requirement)
9090
- { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* }
@@ -136,6 +136,15 @@ jobs:
136136
- php: "8.4"
137137
packages: { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* }
138138

139+
- php: "8.5"
140+
packages: { laravel: ^6.0, testbench: 4.7.*, phpunit: 8.4.* }
141+
- php: "8.5"
142+
packages: { laravel: ^7.0, testbench: 5.1.*, phpunit: 8.4.* }
143+
- php: "8.5"
144+
packages: { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* }
145+
- php: "8.5"
146+
packages: { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
147+
139148
name: phpunit (PHP:${{ matrix.php }}, Laravel:${{ matrix.packages.laravel }})
140149

141150
steps:

test/Sentry/TestCase.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ protected function getCurrentSentryScope(): Scope
125125
$hub = $this->getSentryHubFromContainer();
126126

127127
$method = new ReflectionMethod($hub, 'getScope');
128-
$method->setAccessible(true);
128+
if (\PHP_VERSION_ID < 80100)
129+
{
130+
// This method is no-op starting from PHP 8.1; see also https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
131+
$method->setAccessible(true);
132+
}
129133

130134
return $method->invoke($hub);
131135
}
@@ -136,7 +140,11 @@ protected function getCurrentSentryBreadcrumbs(): array
136140
$scope = $this->getCurrentSentryScope();
137141

138142
$property = new ReflectionProperty($scope, 'breadcrumbs');
139-
$property->setAccessible(true);
143+
if (\PHP_VERSION_ID < 80100)
144+
{
145+
// This method is no-op starting from PHP 8.1; see also https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible
146+
$property->setAccessible(true);
147+
}
140148

141149
return $property->getValue($scope);
142150
}

0 commit comments

Comments
 (0)