Skip to content

Commit

Permalink
changing assertions re: sebastianbergmann/phpunit#3368
Browse files Browse the repository at this point in the history
  • Loading branch information
SignpostMarv committed Dec 22, 2018
1 parent a4e77c2 commit 8e8b390
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions tests/daft-router/ImplementationTest.php
Expand Up @@ -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.
Expand All @@ -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!'
);
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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!'
);
Expand All @@ -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!'
);
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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'
);
Expand Down

0 comments on commit 8e8b390

Please sign in to comment.