diff --git a/tests/daft-router/ImplementationTest.php b/tests/daft-router/ImplementationTest.php index cca2833..13ee1af 100644 --- a/tests/daft-router/ImplementationTest.php +++ b/tests/daft-router/ImplementationTest.php @@ -240,7 +240,7 @@ public function testSources(string $className) : void */ $sources = $className::DaftRouterRouteAndMiddlewareSources(); - static::assertInternalType('array', $sources); + static::assertIsArray($sources); /** * this is here just for vimeo/psalm. @@ -266,8 +266,7 @@ public function testSources(string $className) : void /* * this is inside here because of a bug in phpstan/phpstan or phpstan/phpstan-phpunit */ - static::assertInternalType( - 'int', + static::assertIsInt( $prevKey, 'Sources must be listed with integer keys!' ); @@ -279,7 +278,7 @@ public function testSources(string $className) : void */ $prevKey = $prevKey; - static::assertInternalType('int', $k, 'Sources must be listed with integer keys!'); + static::assertIsInt($k, 'Sources must be listed with integer keys!'); /** * this is here just for vimeo/psalm. @@ -301,7 +300,7 @@ public function testSources(string $className) : void ); } - static::assertInternalType('string', $sources[$k]); + static::assertIsString($sources[$k]); /** * this is here just for vimeo/psalm. @@ -342,7 +341,7 @@ public function testRoutes(string $className) : void $routes = $className::DaftRouterRoutes(); foreach (array_keys($routes) as $uri) { - static::assertInternalType('string', $uri, 'route keys must be strings!'); + static::assertIsString($uri, 'route keys must be strings!'); /** * this is here just for vimeo/psalm. @@ -359,8 +358,7 @@ public function testRoutes(string $className) : void $routesToCheck = $routes[$uri]; - static::assertInternalType( - 'array', + static::assertIsArray( $routesToCheck, 'All route uris must be specified with an array of HTTP methods!' ); @@ -379,13 +377,11 @@ public function testRoutes(string $className) : void * @var string|false $v */ foreach ($routesToCheck as $k => $v) { - static::assertInternalType( - 'integer', + static::assertIsInt( $k, 'All http methods must be specified with numeric indices!' ); - static::assertInternalType( - 'string', + static::assertIsString( $v, 'All http methods must be specified as an array of strings!' ); @@ -484,7 +480,7 @@ public function testMiddlware(string $className) : void * @var string|false $uriPrefix */ foreach ($className::DaftRouterRoutePrefixExceptions() as $uriPrefix) { - static::assertInternalType('string', $uriPrefix); + static::assertIsString($uriPrefix); /** * this is here just for vimeo/psalm. @@ -621,8 +617,8 @@ public function testCompilerExcludesMiddleware( $notPresentWithUri ); - static::assertInternalType('array', $present); // this is here just for vimeo/psalm - static::assertInternalType('array', $notPresent); // this is here just for vimeo/psalm + static::assertIsArray($present); // this is here just for vimeo/psalm + static::assertIsArray($notPresent); // this is here just for vimeo/psalm /** * this is here just for vimeo/psalm. @@ -670,8 +666,7 @@ public function testCompilerExcludesMiddleware( */ $route = array_pop($dispatchedPresent); - static::assertInternalType( - 'string', + static::assertIsString( $route, 'Last entry from a dispatcher should be a string' );