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

Update tests for new callable-array shape

This commit is contained in:
RobChett 2023-05-15 01:58:04 +01:00 committed by robchett
parent 922e57d86b
commit df6b5fbb75
2 changed files with 2 additions and 2 deletions

View File

@ -480,7 +480,7 @@ class TypeParseTest extends TestCase
public function testTKeyedCallableArrayNonList(): void
{
$this->assertSame(
'callable-array{0: class-string, 1: string}',
'callable-array{class-string, string}',
(string)Type::parseString('callable-array{0: class-string, 1: string}'),
);
}

View File

@ -156,7 +156,7 @@ class ReconcilerTest extends TestCase
'nullableClassStringTruthy' => ['class-string<SomeClass>', new Truthy(), 'class-string<SomeClass>|null'],
'iterableToArray' => ['array<int, int>', new IsType(new TArray([Type::getArrayKey(), Type::getMixed()])), 'iterable<int, int>'],
'iterableToTraversable' => ['Traversable<int, int>', new IsType(new TNamedObject('Traversable')), 'iterable<int, int>'],
'callableToCallableArray' => ['callable-array{0: class-string|object, 1: string}', new IsType(new TArray([Type::getArrayKey(), Type::getMixed()])), 'callable'],
'callableToCallableArray' => ['callable-array{class-string|object, string}', new IsType(new TArray([Type::getArrayKey(), Type::getMixed()])), 'callable'],
'SmallKeyedArrayAndCallable' => ['array{test: string}', new IsType(new TKeyedArray(['test' => Type::getString()])), 'callable'],
'BigKeyedArrayAndCallable' => ['array{foo: string, test: string, thing: string}', new IsType(new TKeyedArray(['foo' => Type::getString(), 'test' => Type::getString(), 'thing' => Type::getString()])), 'callable'],
'callableOrArrayToCallableArray' => ['array<array-key, mixed>', new IsType(new TArray([Type::getArrayKey(), Type::getMixed()])), 'callable|array'],