1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

qa: add more specific unit test(s) for the oneOf detection

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
Maximilian Bösing 2022-06-12 02:53:04 +02:00
parent 6a73fbd1d2
commit 083da24551
No known key found for this signature in database
GPG Key ID: 9A8988C93CEC81A3

View File

@ -2066,6 +2066,9 @@ class AssertAnnotationTest extends TestCase
*/
function assertOneOf($input, array $values): void {}
/** @param "a" $value */
function consumeSpecificStringValue(string $value): void {}
/** @param literal-string $value */
function consumeLiteralStringValue(string $value): void {}
@ -2077,6 +2080,9 @@ class AssertAnnotationTest extends TestCase
$mixed;
assertOneOf($string, ["a"]);
consumeSpecificStringValue($string);
assertOneOf($string, ["a", "b", "c"]);
consumeLiteralStringValue($string);
assertOneOf($mixed, [1, 2, 3]);