From 85c453b12cb3d76a27726056d1ce21a510506438 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Thu, 17 Feb 2022 10:31:41 +0100 Subject: [PATCH] update phpunit to latest version --- .gitignore | 1 + composer.json | 5 ++--- tests/AltoRouterTest.php | 13 +++---------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 0200a71..68c8265 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ build vendor composer.lock phpunit.xml +.phpunit.result.cache \ No newline at end of file diff --git a/composer.json b/composer.json index 285aeaf..05bcb40 100644 --- a/composer.json +++ b/composer.json @@ -23,9 +23,8 @@ "php": ">=5.6.0" }, "require-dev": { - "phpunit/phpunit": "5.7.*", - "codeclimate/php-test-reporter": "dev-master", - "squizlabs/php_codesniffer": "3.4.2" + "phpunit/phpunit": "9.5.*", + "squizlabs/php_codesniffer": "3.6.2" }, "autoload": { "classmap": ["AltoRouter.php"] diff --git a/tests/AltoRouterTest.php b/tests/AltoRouterTest.php index 4c125e3..f4b54ce 100644 --- a/tests/AltoRouterTest.php +++ b/tests/AltoRouterTest.php @@ -58,19 +58,11 @@ class AltoRouterTest extends PHPUnit\Framework\TestCase * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ - protected function setUp() + protected function setUp() : void { $this->router = new AltoRouterDebug; } - /** - * Tears down the fixture, for example, closes a network connection. - * This method is called after a test is executed. - */ - protected function tearDown() - { - } - /** * @covers AltoRouter::getRoutes */ @@ -81,7 +73,7 @@ class AltoRouterTest extends PHPUnit\Framework\TestCase $target = static function () { }; - $this->assertInternalType('array', $this->router->getRoutes()); + $this->assertIsArray($this->router->getRoutes()); // $this->assertIsArray($this->router->getRoutes()); // for phpunit 7.x $this->router->map($method, $route, $target); $this->assertEquals([[$method, $route, $target, null]], $this->router->getRoutes()); @@ -134,6 +126,7 @@ class AltoRouterTest extends PHPUnit\Framework\TestCase */ public function testAddRoutesThrowsExceptionOnInvalidArgument() { + $this->expectException(RuntimeException::class); $this->router->addRoutes(new stdClass); }