Skip to content

Commit

Permalink
Relax test version restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
thg2k committed Jun 10, 2024
1 parent 8da7747 commit 9b708ce
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1690,19 +1690,31 @@ public function testBug10974(): void
public function testCountArrayShift(): void
{
if (PHP_VERSION_ID < 80000) {
$this->markTestSkipped('Test requires PHP 8.0.');
$errors = [
[
'Parameter #1 $var of function count expects array|Countable, array|false given.',
8,
],
[
'Parameter #1 $var of function count expects array|Countable, array|false given.',
16,
],
];
}
else {
$errors = [
[
'Parameter #1 $value of function count expects array|Countable, array|false given.',
8,
],
[
'Parameter #1 $value of function count expects array|Countable, array|false given.',
16,
],
];
}

$this->analyse([__DIR__ . '/data/count-array-shift.php'], [
[
'Parameter #1 $value of function count expects array|Countable, array|false given.',
8,
],
[
'Parameter #1 $value of function count expects array|Countable, array|false given.',
16,
],
]);
$this->analyse([__DIR__ . '/data/count-array-shift.php'], $errors);
}

}

0 comments on commit 9b708ce

Please sign in to comment.