mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Make tests more resilient
This commit is contained in:
parent
fb1eba9b61
commit
2121f0485e
@ -609,8 +609,8 @@ class AnnotationTest extends TestCase
|
||||
$b = "goodbye";
|
||||
$c = "hello again";
|
||||
foo($a);
|
||||
foo($b);
|
||||
foo($c);',
|
||||
bar($b);
|
||||
bat($c);',
|
||||
'assertions' => [
|
||||
'$a' => 'string',
|
||||
'$b' => 'string',
|
||||
@ -1382,6 +1382,33 @@ class AnnotationTest extends TestCase
|
||||
foo(...[5]);',
|
||||
'error_message' => 'InvalidScalarArgument',
|
||||
],
|
||||
'spreadOperatorByRefAnnotationBadCall1' => [
|
||||
'<?php
|
||||
/** @param string &...$s */
|
||||
function foo(&...$s) : void {}
|
||||
|
||||
$a = 1;
|
||||
foo($a);',
|
||||
'error_message' => 'InvalidScalarArgument',
|
||||
],
|
||||
'spreadOperatorByRefAnnotationBadCall2' => [
|
||||
'<?php
|
||||
/** @param string ...&$s */
|
||||
function foo(&...$s) : void {}
|
||||
|
||||
$b = 2;
|
||||
foo($b);',
|
||||
'error_message' => 'InvalidScalarArgument',
|
||||
],
|
||||
'spreadOperatorByRefAnnotationBadCall3' => [
|
||||
'<?php
|
||||
/** @param string[] &$s */
|
||||
function foo(&...$s) : void {}
|
||||
|
||||
$c = 3;
|
||||
foo($c);',
|
||||
'error_message' => 'InvalidScalarArgument',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user