2021-08-08 10:39:54 +02:00
|
|
|
<?php
|
2021-09-23 19:29:15 +02:00
|
|
|
namespace Psalm\Tests\Internal\Codebase;
|
2021-08-08 10:39:54 +02:00
|
|
|
|
|
|
|
use Psalm\Internal\Codebase\InternalCallMapHandler;
|
|
|
|
|
|
|
|
class InternalCallMapHandlerTest extends \Psalm\Tests\TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @covers InternalCallMapHandler::getCallMap
|
|
|
|
*/
|
|
|
|
public function testGetcallmapReturnsAValidCallmap(): void
|
|
|
|
{
|
|
|
|
$callMap = InternalCallMapHandler::getCallMap();
|
|
|
|
self::assertArrayKeysAreStrings($callMap, "Returned CallMap has non-string keys");
|
|
|
|
self::assertArrayValuesAreArrays($callMap, "Returned CallMap has non-array values");
|
|
|
|
foreach ($callMap as $function => $signature) {
|
|
|
|
self::assertArrayKeysAreZeroOrString($signature, "Function " . $function . " in returned CallMap has invalid keys");
|
|
|
|
self::assertArrayValuesAreStrings($signature, "Function " . $function . " in returned CallMap has non-string values");
|
|
|
|
foreach ($signature as $type) {
|
|
|
|
self::assertStringIsParsableType($type, "Function " . $function . " in returned CallMap contains invalid type declaration " . $type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|