mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
update tests
This commit is contained in:
parent
0d32203f9a
commit
d2be169ce5
@ -1149,7 +1149,7 @@ class ClosureTest extends TestCase
|
||||
|
||||
takesA($getAButReallyB());
|
||||
takesB($getAButReallyB());',
|
||||
'error_message' => 'ArgumentTypeCoercion - src' . DIRECTORY_SEPARATOR . 'somefile.php:13:28 - Argument 1 of takesB expects B, parent type A provided',
|
||||
'error_message' => 'ArgumentTypeCoercion - src' . DIRECTORY_SEPARATOR . 'somefile.php:13:28 - Argument 1 of takesB expects B, but parent type A provided',
|
||||
],
|
||||
'closureByRefUseToMixed' => [
|
||||
'<?php
|
||||
|
@ -1500,7 +1500,7 @@ class ReturnTypeTest extends TestCase
|
||||
|
||||
$res = map(function(int $i): string { return (string) $i; })([1,2,3]);
|
||||
',
|
||||
'error_message' => 'InvalidArgument - src' . DIRECTORY_SEPARATOR . 'somefile.php:13:54 - Argument 1 expects T:fn-map as mixed, int provided',
|
||||
'error_message' => 'InvalidArgument - src' . DIRECTORY_SEPARATOR . 'somefile.php:13:54 - Argument 1 expects T:fn-map as mixed, but int provided',
|
||||
],
|
||||
'cannotInferReturnClosureWithDifferentReturnTypes' => [
|
||||
'<?php
|
||||
|
@ -3936,7 +3936,7 @@ class ClassTemplateTest extends TestCase
|
||||
type($closure);
|
||||
}
|
||||
}',
|
||||
'error_message' => 'InvalidArgument - src' . DIRECTORY_SEPARATOR . 'somefile.php:20:34 - Argument 1 of type expects string, callable(State):(T:AlmostFooMap as mixed)&Foo provided',
|
||||
'error_message' => 'InvalidArgument - src' . DIRECTORY_SEPARATOR . 'somefile.php:20:34 - Argument 1 of type expects string, but callable(State):(T:AlmostFooMap as mixed)&Foo provided',
|
||||
],
|
||||
'templateWithNoReturn' => [
|
||||
'<?php
|
||||
@ -4118,7 +4118,7 @@ class ClassTemplateTest extends TestCase
|
||||
$mario = new CharacterRow(["id" => 5, "name" => "Mario", "height" => 3.5]);
|
||||
|
||||
$mario->ame = "Luigi";',
|
||||
'error_message' => 'InvalidArgument - src' . DIRECTORY_SEPARATOR . 'somefile.php:47:29 - Argument 1 of CharacterRow::__set expects "height"|"id"|"name", "ame" provided',
|
||||
'error_message' => 'InvalidArgument - src' . DIRECTORY_SEPARATOR . 'somefile.php:47:29 - Argument 1 of CharacterRow::__set expects "height"|"id"|"name", but "ame" provided',
|
||||
],
|
||||
'specialiseTypeBeforeReturning' => [
|
||||
'<?php
|
||||
|
@ -1519,7 +1519,7 @@ class TypeTest extends TestCase
|
||||
|
||||
function takesB(B $i): void {}',
|
||||
'error_message' => 'ArgumentTypeCoercion - src' . DIRECTORY_SEPARATOR . 'somefile.php:14:32 - Argument 1 of takesB expects B,'
|
||||
. ' parent type A&static provided',
|
||||
. ' but parent type A&static provided',
|
||||
],
|
||||
'intersectionTypeInterfaceCheckAfterInstanceof' => [
|
||||
'<?php
|
||||
@ -1540,7 +1540,7 @@ class TypeTest extends TestCase
|
||||
interface I {}
|
||||
|
||||
function takesI(I $i): void {}',
|
||||
'error_message' => 'InvalidArgument - src' . DIRECTORY_SEPARATOR . 'somefile.php:12:32 - Argument 1 of takesI expects I, A&static provided',
|
||||
'error_message' => 'InvalidArgument - src' . DIRECTORY_SEPARATOR . 'somefile.php:12:32 - Argument 1 of takesI expects I, but A&static provided',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
@ -3451,7 +3451,7 @@ class UnusedVariableTest extends TestCase
|
||||
$arr = [$a];
|
||||
takesArrayOfString($arr);
|
||||
}',
|
||||
'error_message' => 'MixedArgumentTypeCoercion - src' . DIRECTORY_SEPARATOR . 'somefile.php:12:44 - Argument 1 of takesArrayOfString expects array<array-key, string>, parent type array{mixed} provided. Consider improving the type at src' . DIRECTORY_SEPARATOR . 'somefile.php:10:41'
|
||||
'error_message' => 'MixedArgumentTypeCoercion - src' . DIRECTORY_SEPARATOR . 'somefile.php:12:44 - Argument 1 of takesArrayOfString expects array<array-key, string>, but parent type array{mixed} provided. Consider improving the type at src' . DIRECTORY_SEPARATOR . 'somefile.php:10:41'
|
||||
],
|
||||
'warnAboutUnusedVariableInTryReassignedInCatch' => [
|
||||
'<?php
|
||||
|
Loading…
x
Reference in New Issue
Block a user