Skip to content

Commit 49438a9

Browse files
committed
Fix: Adjust accessibility of cache property for PHP versions below 8.5
1 parent 2c0fd93 commit 49438a9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/phpunit/tests/cache.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ public function test_stats_with_non_serializable_simplexml_data() {
539539
// any object-clone logic in set(), simulating a real-world scenario where
540540
// a non-serializable object ends up in the cache.
541541
$cache_property = new ReflectionProperty( $this->cache, 'cache' );
542+
if ( PHP_VERSION_ID < 80500 ) {
543+
$cache_property->setAccessible( true );
544+
}
542545
$cache_data = $cache_property->getValue( $this->cache );
543546
$cache_data['xml-group']['item1'] = $xml_object;
544547
$cache_property->setValue( $this->cache, $cache_data );

0 commit comments

Comments
 (0)