Skip to content

Commit

Permalink
tests: fix tests for PHP >= 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed May 8, 2023
1 parent 23c085e commit 1ce182d
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions tests/unit/MersenneTwisterRNGIteratorAggregatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,35 @@ public function testSeed(): void

$iterator = new LimitIterator($innerIterator->getIterator(), 0, 10);

$expected = [
-7422378986580066014,
7607120784305990727,
5331760257347419712,
5165154706003526138,
-8892443392435847392,
8660855838641975931,
1718781808164485227,
-6527986301322975030,
7551637291286289549,
991259994952170583,
];
if (PHP_VERSION_ID > 80200) {
$expected = [
-7164592442489017949,
1156488629188684812,
485542414069413812,
4991960888567025878,
-3992582769147924007,
80909195086498431,
3606319436377249522,
3676952469447372555,
-6073565282896654821,
2823189994401802678,
];
}

if (PHP_VERSION_ID < 80200) {
$expected = [
-7422378986580066014,
7607120784305990727,
5331760257347419712,
5165154706003526138,
-8892443392435847392,
8660855838641975931,
1718781808164485227,
-6527986301322975030,
7551637291286289549,
991259994952170583,
];
}

self::assertSame($expected, iterator_to_array($iterator));

Expand Down

0 comments on commit 1ce182d

Please sign in to comment.