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:
parent
6a73fbd1d2
commit
083da24551
@ -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]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user