Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/config-provider-invokable' into release-3.0.0
Browse files Browse the repository at this point in the history
Fixes the ConfigProvider to ensure resolution of the RouterInterface.
  • Loading branch information
weierophinney committed Feb 6, 2018
2 parents 571c11c + 276a517 commit 36d8f3b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 3.0.0alpha2 - 2018-02-06

### Added

- Nothing.

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Fixes the `ConfigProvider` to alias `Zend\Expressive\Router\RouterInterface`
to `Zend\Expressive\Router\AuraRouter`, and to define the latter as an
invokable.

## 3.0.0alpha1 - 2018-02-06

### Added
Expand Down
5 changes: 4 additions & 1 deletion src/AuraRouter/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ public function __invoke() : array
public function getDependencies() : array
{
return [
'factories' => [
'aliases' => [
RouterInterface::class => AuraRouter::class,
],
'invokables' => [
AuraRouter::class => AuraRouter::class,
],
];
}
}
12 changes: 9 additions & 3 deletions test/AuraRouter/ConfigProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace ZendTest\Expressive\Router\AuraRouter;

use PHPUnit\Framework\TestCase;
use Zend\Expressive\Router\AuraRouter;
use Zend\Expressive\Router\AuraRouter\ConfigProvider;
use Zend\Expressive\Router\RouterInterface;

Expand Down Expand Up @@ -40,8 +41,13 @@ public function testReturnedArrayContainsDependencies(array $config) : void
{
$this->assertArrayHasKey('dependencies', $config);
$this->assertInternalType('array', $config['dependencies']);
$this->assertArrayHasKey('factories', $config['dependencies']);
$this->assertInternalType('array', $config['dependencies']['factories']);
$this->assertArrayHasKey(RouterInterface::class, $config['dependencies']['factories']);

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

$this->assertArrayHasKey('invokables', $config['dependencies']);
$this->assertInternalType('array', $config['dependencies']['invokables']);
$this->assertArrayHasKey(AuraRouter::class, $config['dependencies']['invokables']);
}
}

0 comments on commit 36d8f3b

Please sign in to comment.