Skip to content

Commit

Permalink
Rebase adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Apr 12, 2013
1 parent 21285ff commit 99ed3a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions library/Zend/ServiceManager/ServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,13 @@ public function addAbstractFactory($factory, $topOfStack = true)
*/
public function addDelegator($serviceName, $delegatorFactoryName)
{
if (!isset($this->delegators[$this->canonicalizeName($serviceName)])) {
$this->delegators[$this->canonicalizeName($serviceName)] = array();
$cName = $this->canonicalizeName($serviceName);

if (!isset($this->delegators[$cName])) {
$this->delegators[$cName] = array();
}

$this->delegators[$this->canonicalizeName($serviceName)][] = $delegatorFactoryName;
$this->delegators[$cName][] = $delegatorFactoryName;

return $this;
}
Expand Down
4 changes: 3 additions & 1 deletion tests/ZendTest/ServiceManager/ServiceManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ public function testUsesDelegatorWhenAvailable()

$delegator
->expects($this->once())
->method('createDelegateWithName')
->method('createDelegatorWithName')
->with(
$this->serviceManager,
'fooservice',
Expand All @@ -762,6 +762,8 @@ public function testUsesDelegatorWhenAvailable()
)
->will($this->returnValue($delegator));

//die(var_dump($this->serviceManager));

$this->assertSame($delegator, $this->serviceManager->create('foo-service'));
}

Expand Down

0 comments on commit 99ed3a5

Please sign in to comment.