File tree Expand file tree Collapse file tree 1 file changed +22
-11
lines changed
tests/PHPStan/Rules/Functions Expand file tree Collapse file tree 1 file changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -1690,19 +1690,30 @@ public function testBug10974(): void
1690
1690
public function testCountArrayShift (): void
1691
1691
{
1692
1692
if (PHP_VERSION_ID < 80000 ) {
1693
- $ this ->markTestSkipped ('Test requires PHP 8.0. ' );
1693
+ $ errors = [
1694
+ [
1695
+ 'Parameter #1 $var of function count expects array|Countable, array|false given. ' ,
1696
+ 8 ,
1697
+ ],
1698
+ [
1699
+ 'Parameter #1 $var of function count expects array|Countable, array|false given. ' ,
1700
+ 16 ,
1701
+ ],
1702
+ ];
1703
+ } else {
1704
+ $ errors = [
1705
+ [
1706
+ 'Parameter #1 $value of function count expects array|Countable, array|false given. ' ,
1707
+ 8 ,
1708
+ ],
1709
+ [
1710
+ 'Parameter #1 $value of function count expects array|Countable, array|false given. ' ,
1711
+ 16 ,
1712
+ ],
1713
+ ];
1694
1714
}
1695
1715
1696
- $ this ->analyse ([__DIR__ . '/data/count-array-shift.php ' ], [
1697
- [
1698
- 'Parameter #1 $value of function count expects array|Countable, array|false given. ' ,
1699
- 8 ,
1700
- ],
1701
- [
1702
- 'Parameter #1 $value of function count expects array|Countable, array|false given. ' ,
1703
- 16 ,
1704
- ],
1705
- ]);
1716
+ $ this ->analyse ([__DIR__ . '/data/count-array-shift.php ' ], $ errors );
1706
1717
}
1707
1718
1708
1719
}
You can’t perform that action at this time.
0 commit comments