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

Commit

Permalink
Merge branch 'hotfix/aliases'
Browse files Browse the repository at this point in the history
Close #69
Fixes #68
  • Loading branch information
weierophinney committed May 3, 2016
2 parents a393847 + 2c57dd8 commit 140f82e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
6 changes: 4 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.8.3 - TBD
## 2.8.3 - 2016-05-03

### Added

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

### Fixed

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

## 2.8.2 - 2016-05-01

Expand Down
4 changes: 1 addition & 3 deletions src/FormElementManager/FormElementManagerV2Polyfill.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ class FormElementManagerV2Polyfill extends AbstractPluginManager
'image' => Element\Image::class,
'month' => Element\Month::class,
'monthselect' => Element\MonthSelect::class,
'MonthSelect' => Element\MonthSelect::class,
'multiCheckbox' => Element\MultiCheckbox::class,
'multiCheckBox' => Element\MultiCheckbox::class,
'multicheckbox' => Element\MultiCheckbox::class,
'number' => Element\Number::class,
'password' => Element\Password::class,
'radio' => Element\Radio::class,
Expand Down
17 changes: 17 additions & 0 deletions test/FormElementManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,21 @@ public function testAddingInvokableCreatesAliasAndMapsClassToElementFactory()
$this->assertEquals(ElementFactory::class, $factories['zendtestformtestassetelementwithfilter']);
}
}

public function testAllAliasesShouldBeCanonicalized()
{
if (method_exists($this->manager, 'configure')) {
$this->markTestSkipped('Check canonicalized makes sense only on v2');
}

$r = new ReflectionProperty($this->manager, 'aliases');
$r->setAccessible(true);
$aliases = $r->getValue($this->manager);

foreach ($aliases as $name => $alias) {
$this->manager->get($name . ' ');
$this->manager->get(strtoupper($name));
$this->manager->get($name);
}
}
}

0 comments on commit 140f82e

Please sign in to comment.