Skip to content

Commit 4efc904

Browse files
committed
Adjust test expectations for PHP 8.5
Signed-off-by: George Steel <george@net-glue.co.uk>
1 parent 9eb0ec2 commit 4efc904

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
cacheDirectory=".phpunit.cache"
88
displayDetailsOnAllIssues="true"
99
failOnAllIssues="true"
10+
failOnSkipped="false"
1011
>
1112
<testsuites>
1213
<testsuite name="laminas-filter Test Suite">

test/Compress/Bz2AdapterTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use function extension_loaded;
1414
use function range;
1515

16+
use const PHP_VERSION_ID;
17+
1618
final class Bz2AdapterTest extends TestCase
1719
{
1820
public function setUp(): void
@@ -60,6 +62,10 @@ public function testThatDifferentCompressionLevelsWillNotAffectFunctionality(int
6062

6163
public function testInvalidCompressionLevel(): void
6264
{
65+
if (PHP_VERSION_ID >= 80500) {
66+
$this->markTestSkipped('This test is a ValueError on PHP 8.5');
67+
}
68+
6369
/** @psalm-suppress InvalidArgument */
6470
$adapter = new Bz2Adapter([
6571
'blocksize' => 99,

test/ToIntTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use PHPUnit\Framework\TestCase;
1111

1212
use const PHP_INT_MAX;
13+
use const PHP_VERSION_ID;
1314

1415
final class ToIntTest extends TestCase
1516
{
@@ -32,7 +33,6 @@ public static function basicDataProvider(): array
3233
'Empty String' => ['', 0],
3334
'Negative Int' => [-1, -1],
3435
'Negative String' => ['-1', -1],
35-
'Massive Number' => ['9223372036854775807999', PHP_INT_MAX],
3636
];
3737
}
3838

@@ -43,4 +43,15 @@ public function testBasicBehaviour(mixed $input, mixed $expect): void
4343
self::assertSame($expect, $filter->filter($input));
4444
self::assertSame($expect, $filter->__invoke($input));
4545
}
46+
47+
public function testHugeNumbersAreTruncatedToIntMax(): void
48+
{
49+
if (PHP_VERSION_ID >= 80500) {
50+
$this->markTestSkipped('This is a warning on PHP 8.5');
51+
}
52+
53+
$huge = '9223372036854775807999';
54+
$filter = new ToInt();
55+
self::assertSame(PHP_INT_MAX, $filter->__invoke($huge));
56+
}
4657
}

0 commit comments

Comments
 (0)