From 09df230722d919a72d38df906f1dbab217d3feaa Mon Sep 17 00:00:00 2001 From: jrfnl Date: Mon, 8 Jan 2024 11:45:08 +0100 Subject: [PATCH] PHP 8.3 | RequestsTest::testHasCapabilitiesFailsForUnsupportedCapabilities(): fix deprecation notices for ReflectionProperty::setValue() The `ReflectionProperty::setValue()` method supports three method signatures, two of which are deprecated as of PHP 8.3. This adjusts the call to `ReflectionProperty::setValue()` in the `HasCapabilitiesTest` to pass `null` as the "object" for setting the value of a static property to make the method call cross-version compatible. Ref: https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#reflectionpropertysetvalue --- tests/RequestsTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/RequestsTest.php b/tests/RequestsTest.php index 6f94a9038..773aab974 100644 --- a/tests/RequestsTest.php +++ b/tests/RequestsTest.php @@ -337,11 +337,11 @@ public function testHasCapabilitiesSucceedsForDetectingSsl() { public function testHasCapabilitiesFailsForUnsupportedCapabilities() { $transports = new ReflectionProperty(Requests::class, 'transports'); $transports->setAccessible(true); - $transports->setValue([TestTransportMock::class]); + $transports->setValue(null, [TestTransportMock::class]); $result = Requests::has_capabilities(['time-travel' => true]); - $transports->setValue([]); + $transports->setValue(null, []); $transports->setAccessible(false); $this->assertFalse($result);