From a83427cd285ad61ed4ad7c50f92417272bf44a60 Mon Sep 17 00:00:00 2001 From: Athos Ribeiro Date: Thu, 25 Jan 2024 22:59:16 -0300 Subject: [PATCH 1/2] Adjust tests for PHP 8.3 As of PHP 8.3.0, calling ReflectionProperty::setValue with a single argument is deprecated. See [1] for further reference. [1] https://www.php.net/manual/en/reflectionproperty.setvalue.php --- tests/Doctrine/Deprecations/DeprecationTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Doctrine/Deprecations/DeprecationTest.php b/tests/Doctrine/Deprecations/DeprecationTest.php index 597027d..e54b0dc 100644 --- a/tests/Doctrine/Deprecations/DeprecationTest.php +++ b/tests/Doctrine/Deprecations/DeprecationTest.php @@ -28,11 +28,11 @@ public function setUp(): void // reset the global state of Deprecation class across tests $reflectionProperty = new ReflectionProperty(Deprecation::class, 'ignoredPackages'); $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue([]); + $reflectionProperty->setValue(null, []); $reflectionProperty = new ReflectionProperty(Deprecation::class, 'triggeredDeprecations'); $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue([]); + $reflectionProperty->setValue(null, []); Deprecation::disable(); @@ -277,12 +277,12 @@ public function testDeprecationTrackByEnv(): void { $reflectionProperty = new ReflectionProperty(Deprecation::class, 'type'); $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue(null); + $reflectionProperty->setValue(null, null); Deprecation::trigger('Foo', 'link', 'message'); $this->assertSame(0, Deprecation::getUniqueTriggeredDeprecationsCount()); - $reflectionProperty->setValue(null); + $reflectionProperty->setValue(null, null); $_SERVER['DOCTRINE_DEPRECATIONS'] = 'track'; Deprecation::trigger('Foo', __METHOD__, 'message'); @@ -293,7 +293,7 @@ public function testDeprecationTriggerByEnv(): void { $reflectionProperty = new ReflectionProperty(Deprecation::class, 'type'); $reflectionProperty->setAccessible(true); - $reflectionProperty->setValue(null); + $reflectionProperty->setValue(null, null); $_ENV['DOCTRINE_DEPRECATIONS'] = 'trigger'; $this->expectErrorHandler( From 29377e0a4768142b78586e34de2b9cbc71e81bea Mon Sep 17 00:00:00 2001 From: Athos Ribeiro Date: Tue, 30 Jan 2024 14:28:55 -0300 Subject: [PATCH 2/2] Run CI tests for PHP 8.3 --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 904a4a3..47a302f 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -27,5 +27,5 @@ jobs: name: "PHPUnit" uses: "doctrine/.github/.github/workflows/continuous-integration.yml@3.0.0" with: - php-versions: '["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]' + php-versions: '["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]' composer-options: '--ignore-platform-req=php+'