Skip to content

Commit 15e0960

Browse files
committed
Fix PHP 8.5 deprecation in tests
1 parent b06e510 commit 15e0960

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

test/ArrayBufferTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public function testBuffer(int $items, int $threshold): void {
4040
$this->assertEquals($o, $item);
4141
}
4242
$prop = new \ReflectionProperty($buf, 'buffer');
43-
$prop->setAccessible(true);
43+
if(version_compare(PHP_VERSION, '8.1.0', '<')) {
44+
$prop->setAccessible(true); // deprecated since PHP 8.5, necessary for PHP <8.1
45+
}
4446
$this->assertCount($items > $threshold ? $items : 0, $prop->getValue($buf));
4547
}
4648
}

0 commit comments

Comments
 (0)