1
0
mirror of https://github.com/dannyvankooten/AltoRouter.git synced 2025-08-06 08:27:39 +02:00

update phpunit to latest version

This commit is contained in:
Danny van Kooten
2022-02-17 10:31:41 +01:00
parent f6fede4f94
commit 85c453b12c
3 changed files with 6 additions and 13 deletions

1
.gitignore vendored
View File

@@ -6,3 +6,4 @@ build
vendor vendor
composer.lock composer.lock
phpunit.xml phpunit.xml
.phpunit.result.cache

View File

@@ -23,9 +23,8 @@
"php": ">=5.6.0" "php": ">=5.6.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "5.7.*", "phpunit/phpunit": "9.5.*",
"codeclimate/php-test-reporter": "dev-master", "squizlabs/php_codesniffer": "3.6.2"
"squizlabs/php_codesniffer": "3.4.2"
}, },
"autoload": { "autoload": {
"classmap": ["AltoRouter.php"] "classmap": ["AltoRouter.php"]

View File

@@ -58,19 +58,11 @@ class AltoRouterTest extends PHPUnit\Framework\TestCase
* Sets up the fixture, for example, opens a network connection. * Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed. * This method is called before a test is executed.
*/ */
protected function setUp() protected function setUp() : void
{ {
$this->router = new AltoRouterDebug; $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 * @covers AltoRouter::getRoutes
*/ */
@@ -81,7 +73,7 @@ class AltoRouterTest extends PHPUnit\Framework\TestCase
$target = static function () { $target = static function () {
}; };
$this->assertInternalType('array', $this->router->getRoutes()); $this->assertIsArray($this->router->getRoutes());
// $this->assertIsArray($this->router->getRoutes()); // for phpunit 7.x // $this->assertIsArray($this->router->getRoutes()); // for phpunit 7.x
$this->router->map($method, $route, $target); $this->router->map($method, $route, $target);
$this->assertEquals([[$method, $route, $target, null]], $this->router->getRoutes()); $this->assertEquals([[$method, $route, $target, null]], $this->router->getRoutes());
@@ -134,6 +126,7 @@ class AltoRouterTest extends PHPUnit\Framework\TestCase
*/ */
public function testAddRoutesThrowsExceptionOnInvalidArgument() public function testAddRoutesThrowsExceptionOnInvalidArgument()
{ {
$this->expectException(RuntimeException::class);
$this->router->addRoutes(new stdClass); $this->router->addRoutes(new stdClass);
} }