1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Restrict tests with PREG_UNMATCHED_AS_NULL to PHP >= 7.2

This commit is contained in:
ralila 2021-11-30 03:28:38 +01:00
parent fef41461ed
commit 9a7d0809d2

View File

@ -1339,7 +1339,7 @@ class FunctionCallTest extends TestCase
'$matches===' => 'array<array-key, array{string, int}>', '$matches===' => 'array<array-key, array{string, int}>',
], ],
], ],
'pregMatchWithFlagUnMatchedAsNull' => [ 'PHP72-pregMatchWithFlagUnmatchedAsNull' => [
'<?php '<?php
$r = preg_match("{foo}", "foo", $matches, PREG_UNMATCHED_AS_NULL);', $r = preg_match("{foo}", "foo", $matches, PREG_UNMATCHED_AS_NULL);',
'assertions' => [ 'assertions' => [
@ -1347,9 +1347,9 @@ class FunctionCallTest extends TestCase
'$matches===' => 'array<array-key, null|string>', '$matches===' => 'array<array-key, null|string>',
], ],
], ],
'pregMatchWithFlagOffsetCaptureAndUnMatchedAsNull' => [ 'PHP72-pregMatchWithFlagOffsetCaptureAndUnmatchedAsNull' => [
'<?php '<?php
$r = preg_match("{foo}", "foo", $matches, PREG_OFFSET_CAPTURE | PREG_UNMATCHED_AS_NULL);', $r = preg_match("{foo}", "foo", $matches, PREG_OFFSET_CAPTURE | PREG_UNMATCHED_AS_NULL);',
'assertions' => [ 'assertions' => [
'$r===' => '0|1|false', '$r===' => '0|1|false',
'$matches===' => 'array<array-key, array{null|string, int}>', '$matches===' => 'array<array-key, array{null|string, int}>',