From e2278a73701dda4f2d161bb2c50436cd0a17ddfb Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 3 Jun 2026 04:35:12 +1200 Subject: [PATCH] test(messaging): drop deprecated ReflectionMethod::setAccessible call The CI unit-test job runs inside the Appwrite container on PHP 8.5, where ReflectionMethod::setAccessible() is deprecated, and the suite fails on triggered deprecations. It is also a no-op on PHP 8.1+ (reflection invokes private methods without it), so it was both unnecessary and the cause of the red Tests/Unit check. Reverts the setAccessible addition from 7c8d7dcb80. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/unit/Messaging/MessagingFanoutTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit/Messaging/MessagingFanoutTest.php b/tests/unit/Messaging/MessagingFanoutTest.php index b7529433c5..ec6dbe87f4 100644 --- a/tests/unit/Messaging/MessagingFanoutTest.php +++ b/tests/unit/Messaging/MessagingFanoutTest.php @@ -435,8 +435,9 @@ class MessagingFanoutTest extends TestCase EmailAdapter $adapter ): void { $worker = new TestableMessaging($adapter); + // No setAccessible(true): reflection invokes private methods without it on PHP 8.1+, and the call is + // deprecated on PHP 8.5 (the CI unit-test runtime), where the suite fails on triggered deprecations. $method = new \ReflectionMethod(Messaging::class, 'sendExternalMessage'); - $method->setAccessible(true); $publisher = $this->createMock(UsagePublisher::class); $publisher->method('enqueue')->willReturn(true); @@ -574,8 +575,9 @@ class MessagingFanoutTest extends TestCase $adapter = new ConcurrencyProbeAdapter(); $worker = new TestableMessaging($adapter); + // No setAccessible(true): reflection invokes private methods without it on PHP 8.1+, and the call is + // deprecated on PHP 8.5 (the CI unit-test runtime), where the suite fails on triggered deprecations. $method = new \ReflectionMethod(Messaging::class, 'sendExternalMessage'); - $method->setAccessible(true); $publisher = $this->createMock(UsagePublisher::class); $device = new Local(\sys_get_temp_dir()); $project = new Document(['$id' => 'project1', '$sequence' => '1']);