mirror of
https://github.com/danog/psalm.git
synced 2024-12-17 11:56:59 +01:00
96056d329f
Convert deltafile format to new style proposed by weirdan Modify CallMapTest to use new format Modify InternalCallMapHandler to use new format Move assertions to base testcase
25 lines
1.0 KiB
PHP
25 lines
1.0 KiB
PHP
<?php
|
|
namespace Psalm\Tests\Internal;
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
}
|