diff --git a/composer.json b/composer.json index 76ea46d..aad99dd 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "psr/http-server-middleware": "^1.0" }, "require-dev": { - "phpunit/phpunit" : "^7.0", + "phpunit/phpunit" : "^7.5", "phpstan/phpstan": "^0.12", "phpstan/phpstan-phpunit": "^0.12", "roave/security-advisories": "dev-master", diff --git a/tests/RouteTest.php b/tests/RouteTest.php index 42dc328..169f479 100644 --- a/tests/RouteTest.php +++ b/tests/RouteTest.php @@ -20,7 +20,7 @@ public function testRouteSetsAndResolvesInvokableClassCallable(): void { $callable = new Controller; $route = new Route('GET', '/', $callable); - $this->assertInternalType('callable', $route->getCallable()); + $this->assertIsCallable($route->getCallable()); } /** @@ -32,7 +32,7 @@ public function testRouteSetsAndResolvesClassMethodCallable(): void { $callable = [new Controller, 'action']; $route = new Route('GET', '/', $callable); - $this->assertInternalType('callable', $route->getCallable()); + $this->assertIsCallable($route->getCallable()); } /** @@ -44,7 +44,7 @@ public function testRouteSetsAndResolvesNamedFunctionCallable(): void { $callable = 'League\Route\Fixture\namedFunctionCallable'; $route = new Route('GET', '/', $callable); - $this->assertInternalType('callable', $route->getCallable()); + $this->assertIsCallable($route->getCallable()); } /** diff --git a/tests/RouterTest.php b/tests/RouterTest.php index ba13008..268afaa 100644 --- a/tests/RouterTest.php +++ b/tests/RouterTest.php @@ -89,7 +89,11 @@ public function testNewPatternMatchesCanBeAddedAtRuntime(): void { $router = new Router; $router->addPatternMatcher('mockMatcher', '[a-zA-Z]'); - $matchers = $this->getObjectAttribute($router, 'patternMatchers'); + + $reflectionClass = new \ReflectionClass($router); + $reflectionProperty = $reflectionClass->getProperty('patternMatchers'); + $reflectionProperty->setAccessible(true); + $matchers = $reflectionProperty->getValue($router); $this->assertArrayHasKey('/{(.+?):mockMatcher}/', $matchers); $this->assertEquals('{$1:[a-zA-Z]}', $matchers['/{(.+?):mockMatcher}/']);