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

Commit 2aa5a55

Browse files
committed
Merge branch 'hotfix/aliases' into develop
Forward port #69
2 parents fdbdccc + 2c57dd8 commit 2aa5a55

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All notable changes to this project will be documented in this file, in reverse
2020

2121
- Nothing.
2222

23-
## 2.8.3 - TBD
23+
## 2.8.3 - 2016-05-03
2424

2525
### Added
2626

@@ -37,7 +37,9 @@ All notable changes to this project will be documented in this file, in reverse
3737

3838
### Fixed
3939

40-
- Nothing.
40+
- [#69](https://github.com/zendframework/zend-form/pull/69) fixes aliases in the
41+
`FormElementManager` polyfill for zend-servicemanager v2 to ensure they are
42+
canonicalized correctly.
4143

4244
## 2.8.2 - 2016-05-01
4345

src/FormElementManager/FormElementManagerV2Polyfill.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ class FormElementManagerV2Polyfill extends AbstractPluginManager
5454
'image' => Element\Image::class,
5555
'month' => Element\Month::class,
5656
'monthselect' => Element\MonthSelect::class,
57-
'MonthSelect' => Element\MonthSelect::class,
58-
'multiCheckbox' => Element\MultiCheckbox::class,
59-
'multiCheckBox' => Element\MultiCheckbox::class,
57+
'multicheckbox' => Element\MultiCheckbox::class,
6058
'number' => Element\Number::class,
6159
'password' => Element\Password::class,
6260
'radio' => Element\Radio::class,

test/FormElementManagerTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,21 @@ public function testAddingInvokableCreatesAliasAndMapsClassToElementFactory()
221221
$this->assertEquals(ElementFactory::class, $factories['zendtestformtestassetelementwithfilter']);
222222
}
223223
}
224+
225+
public function testAllAliasesShouldBeCanonicalized()
226+
{
227+
if (method_exists($this->manager, 'configure')) {
228+
$this->markTestSkipped('Check canonicalized makes sense only on v2');
229+
}
230+
231+
$r = new ReflectionProperty($this->manager, 'aliases');
232+
$r->setAccessible(true);
233+
$aliases = $r->getValue($this->manager);
234+
235+
foreach ($aliases as $name => $alias) {
236+
$this->manager->get($name . ' ');
237+
$this->manager->get(strtoupper($name));
238+
$this->manager->get($name);
239+
}
240+
}
224241
}

0 commit comments

Comments
 (0)