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

Commit 5ea1059

Browse files
committed
Merge branch 'hotfix/122'
Close #122
2 parents 3cd736a + 0cd9913 commit 5ea1059

File tree

3 files changed

+57
-18
lines changed

3 files changed

+57
-18
lines changed

CHANGELOG.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,20 @@
22

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

5-
## 2.8.0 - TBD
5+
## 2.7.4 - TBD
66

77
### Added
88

99
- Nothing.
1010

11-
### Deprecated
11+
### Changes
1212

13-
- Nothing.
14-
15-
### Removed
16-
17-
- Nothing.
18-
19-
### Fixed
20-
21-
- Nothing.
22-
23-
## 2.7.4 - TBD
24-
25-
### Added
26-
27-
- Nothing.
13+
- [#122](https://github.com/zendframework/zend-inputfilter/pull/122) maps the
14+
`Zend\InputFilter\InputFilterPluginManager` service to
15+
`Zend\InputFilter\InputFilterPluginManagerFactory`, and adds an alias from
16+
`InputFitlerPluginManager` to the fully qualified class name. This change
17+
allows you to request the service using either the original short name, or the
18+
fully qualified class name.
2819

2920
### Deprecated
3021

src/ConfigProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ public function __invoke()
2929
public function getDependencyConfig()
3030
{
3131
return [
32+
'aliases' => [
33+
'InputFilterManager' => InputFilterPluginManager::class,
34+
],
3235
'abstract_factories' => [
3336
InputFilterAbstractServiceFactory::class,
3437
],
3538
'factories' => [
36-
'InputFilterManager' => InputFilterPluginManagerFactory::class,
39+
InputFilterPluginManager::class => InputFilterPluginManagerFactory::class,
3740
],
3841
];
3942
}

test/ConfigProviderTest.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* @link http://github.com/zendframework/zend-inputfilter for the canonical source repository
4+
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
5+
* @license http://framework.zend.com/license/new-bsd New BSD License
6+
*/
7+
8+
namespace ZendTest\InputFilter;
9+
10+
use Zend\InputFilter\ConfigProvider;
11+
use Zend\InputFilter\InputFilterAbstractServiceFactory;
12+
use Zend\InputFilter\InputFilterPluginManager;
13+
use Zend\InputFilter\InputFilterPluginManagerFactory;
14+
15+
final class ConfigProviderTest extends \PHPUnit_Framework_TestCase
16+
{
17+
public function testProvidesExpectedConfiguration()
18+
{
19+
$provider = new ConfigProvider();
20+
21+
$expected = [
22+
'abstract_factories' => [
23+
InputFilterAbstractServiceFactory::class,
24+
],
25+
'aliases' => [
26+
'InputFilterManager' => InputFilterPluginManager::class,
27+
],
28+
'factories' => [
29+
InputFilterPluginManager::class => InputFilterPluginManagerFactory::class,
30+
],
31+
];
32+
33+
$this->assertEquals($expected, $provider->getDependencyConfig());
34+
}
35+
36+
public function testInvocationProvidesDependencyConfiguration()
37+
{
38+
$provider = new ConfigProvider();
39+
40+
$expected = [
41+
'dependencies' => $provider->getDependencyConfig(),
42+
];
43+
$this->assertEquals($expected, $provider());
44+
}
45+
}

0 commit comments

Comments
 (0)