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

Commit

Permalink
Merge branch 'hotfix/35'
Browse files Browse the repository at this point in the history
Close #35
Close #32
Fixes #31
  • Loading branch information
weierophinney committed Jun 11, 2016
2 parents f1bcbbe + 4d02e96 commit 2e0a354
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

## 2.7.2 - TBD
## 2.7.2 - 2016-06-11

### Added

Expand All @@ -19,7 +19,8 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- Nothing.
- [#35](https://github.com/zendframework/zend-navigation/pull/35) fixes errors
in the `ConfigProvider` that prevented its use.

## 2.7.1 - 2016-04-08

Expand Down
8 changes: 5 additions & 3 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class ConfigProvider
{
/**
* Return general-purpose zend-i18n configuration.
* Return general-purpose zend-navigation configuration.
*
* @return array
*/
Expand All @@ -36,10 +36,12 @@ public function getDependencyConfig()
'navigation' => Navigation::class,
],
'delegators' => [
'ViewHelperManager' => [ View\ViewHelperManagerDelegatorFactory::class ],
'ViewHelperManager' => [
View\ViewHelperManagerDelegatorFactory::class,
],
],
'factories' => [
Navigation::class => Service/DefaultNavigationFactory::class,
Navigation::class => Service\DefaultNavigationFactory::class,
],
];
}
Expand Down
48 changes: 48 additions & 0 deletions test/ConfigProviderTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* @link http://github.com/zendframework/zend-navigation for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace ZendTest\Navigation;

use Zend\Navigation\ConfigProvider;
use Zend\Navigation\Navigation;
use Zend\Navigation\Service;
use Zend\Navigation\View;

class ConfigProviderTest extends \PHPUnit_Framework_TestCase
{
private $config = [
'abstract_factories' => [
Service\NavigationAbstractServiceFactory::class,
],
'aliases' => [
'navigation' => Navigation::class,
],
'delegators' => [
'ViewHelperManager' => [
View\ViewHelperManagerDelegatorFactory::class,
],
],
'factories' => [
Navigation::class => Service\DefaultNavigationFactory::class,
],
];

public function testProvidesExpectedConfiguration()
{
$provider = new ConfigProvider();
$this->assertEquals($this->config, $provider->getDependencyConfig());
return $provider;
}

/**
* @depends testProvidesExpectedConfiguration
*/
public function testInvocationProvidesDependencyConfiguration(ConfigProvider $provider)
{
$this->assertEquals(['dependencies' => $provider->getDependencyConfig()], $provider());
}
}

0 comments on commit 2e0a354

Please sign in to comment.