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

Commit

Permalink
Merge branch 'hotfix/71' into release-2.7
Browse files Browse the repository at this point in the history
Close #71
  • Loading branch information
weierophinney committed Jan 19, 2016
2 parents c8d74ce + a31054d commit 846f8a4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 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.7.4 - TBD
## 2.7.4 - 2015-01-19

### Added

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

### Fixed

- Nothing.
- [#71](https://github.com/zendframework/zend-servicemanager/pull/71) fixes an edge case
with alias usage, whereby an alias of an alias was not being resolved to the
final service name.

## 2.7.3 - 2016-01-13

Expand Down
2 changes: 1 addition & 1 deletion src/ServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ protected function resolveAlias($cName)
}

$stack[$cName] = $cName;
$cName = $this->aliases[$cName];
$cName = $this->aliases[$this->canonicalizeName($cName)];
}

return $cName;
Expand Down
11 changes: 11 additions & 0 deletions test/ServiceManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,17 @@ public function testGetWithAlias()
$this->assertEquals('bar', $this->serviceManager->get('baz'));
}

/**
* @covers Zend\ServiceManager\ServiceManager::get
*/
public function testGetWithAliasofAliasWithCanonicalizedName()
{
$this->serviceManager->setService('Foo', 'Bar');
$this->serviceManager->setAlias('Baz', 'Foo');
$this->serviceManager->setAlias('Qux', 'Baz');
$this->assertEquals('Bar', $this->serviceManager->get('Qux'));
}

/**
* @covers Zend\ServiceManager\ServiceManager::get
*/
Expand Down

0 comments on commit 846f8a4

Please sign in to comment.