Skip to content

Commit

Permalink
Merge pull request #4 from marcelthole/add-php8-support
Browse files Browse the repository at this point in the history
Bump dependencies to PHP8
  • Loading branch information
Ocramius authored Nov 27, 2020
2 parents a89e276 + 24c66f0 commit e9eab42
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 18 deletions.
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@ env:
matrix:
fast_finish: true
include:
- php: 7.1
- php: 7.3
env:
- DEPS=lowest
- php: 7.1
- php: 7.3
env:
- DEPS=latest
- CS_CHECK=true
- TEST_COVERAGE=true
- php: 7.2
- php: 7.4
env:
- DEPS=lowest
- php: 7.2
- php: 7.4
env:
- DEPS=latest
- php: 7.3
- php: nightly
env:
- COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
- DEPS=lowest
- php: 7.3
- php: nightly
env:
- COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
- DEPS=latest

before_install:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file, in reverse

### Added

- Nothing.
- [#4](https://github.com/mezzio/mezzio-laminasrouter/pull/4) Add PHP 8.0 support

### Changed

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
}
},
"require": {
"php": "^7.1",
"php": "^7.3 || ~8.0.0",
"fig/http-message-util": "^1.1.2",
"laminas/laminas-psr7bridge": "^0.2.2 || ^1.0.0",
"laminas/laminas-router": "^3.3.0",
"laminas/laminas-zendframework-bridge": "^1.0",
"mezzio/mezzio-router": "^3.0",
"mezzio/mezzio-router": "^3.2",
"psr/http-message": "^1.0.1"
},
"require-dev": {
"laminas/laminas-coding-standard": "~1.0.0",
"laminas/laminas-i18n": "^2.7.4",
"laminas/laminas-stratigility": "^3.0",
"malukenho/docheader": "^0.1.6",
"phpunit/phpunit": "^7.0.2"
"phpunit/phpunit": "^9.4.1"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion test/ImplicitMethodsIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Generator;
use Mezzio\Router\LaminasRouter;
use Mezzio\Router\RouterInterface;
use Mezzio\Router\Test\ImplicitMethodsIntegrationTest as RouterIntegrationTest;
use Mezzio\Router\Test\AbstractImplicitMethodsIntegrationTest as RouterIntegrationTest;

class ImplicitMethodsIntegrationTest extends RouterIntegrationTest
{
Expand Down
8 changes: 4 additions & 4 deletions test/LaminasRouter/ConfigProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function setUp() : void
public function testInvocationReturnsArray() : array
{
$config = ($this->provider)();
$this->assertInternalType('array', $config);
$this->assertIsArray($config);

return $config;
}
Expand All @@ -41,14 +41,14 @@ public function testInvocationReturnsArray() : array
public function testReturnedArrayContainsDependencies(array $config) : void
{
$this->assertArrayHasKey('dependencies', $config);
$this->assertInternalType('array', $config['dependencies']);
$this->assertIsArray($config['dependencies']);

$this->assertArrayHasKey('aliases', $config['dependencies']);
$this->assertInternalType('array', $config['dependencies']['aliases']);
$this->assertIsArray($config['dependencies']['aliases']);
$this->assertArrayHasKey(RouterInterface::class, $config['dependencies']['aliases']);

$this->assertArrayHasKey('invokables', $config['dependencies']);
$this->assertInternalType('array', $config['dependencies']['invokables']);
$this->assertIsArray($config['dependencies']['invokables']);
$this->assertArrayHasKey(LaminasRouter::class, $config['dependencies']['invokables']);
}
}
13 changes: 10 additions & 3 deletions test/LaminasRouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LaminasRouterTest extends TestCase
/** @var TreeRouteStack|ObjectProphecy */
private $laminasRouter;

protected function setUp()
protected function setUp(): void
{
$this->laminasRouter = $this->prophesize(TreeRouteStack::class);
}
Expand All @@ -51,7 +51,10 @@ private function getMiddleware() : MiddlewareInterface
public function testWillLazyInstantiateALaminasTreeRouteStackIfNoneIsProvidedToConstructor()
{
$router = new LaminasRouter();
$this->assertAttributeInstanceOf(TreeRouteStack::class, 'laminasRouter', $router);
$laminasRouter = \Closure::bind(function () {
return $this->laminasRouter;
}, $router, LaminasRouter::class)();
$this->assertInstanceOf(TreeRouteStack::class, $laminasRouter);
}

public function createRequestProphecy($requestMethod = RequestMethod::METHOD_GET)
Expand All @@ -77,7 +80,11 @@ public function testAddingRouteAggregatesInRouter()
$route = new Route('/foo', $this->getMiddleware(), [RequestMethod::METHOD_GET]);
$router = $this->getRouter();
$router->addRoute($route);
$this->assertAttributeContains($route, 'routesToInject', $router);

$routesToInject = \Closure::bind(function () {
return $this->routesToInject;
}, $router, LaminasRouter::class)();
$this->assertContains($route, $routesToInject);
}

/**
Expand Down

0 comments on commit e9eab42

Please sign in to comment.