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/zendframework/zendframework#6021-di-abstract-fac…
Browse files Browse the repository at this point in the history
…tory-invalid-variable-name'

Close zendframework/zendframework#6021
  • Loading branch information
Ocramius committed Apr 3, 2014
2 parents 840ac1e + e9d1799 commit 25d94d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Di/DiAbstractServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $
return $this->get($requestedName, array());
}

return $this->get($serviceName, array());
return $this->get($name, array());
}

/**
Expand Down
12 changes: 12 additions & 0 deletions test/Di/DiAbstractServiceFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ public function testConstructor()
$this->assertInstanceOf('Zend\ServiceManager\Di\DiAbstractServiceFactory', $instance);
}

/**
* @group 6021
*
* @covers Zend\ServiceManager\Di\DiAbstractServiceFactory::createServiceWithName
* @covers Zend\ServiceManager\Di\DiAbstractServiceFactory::get
*/
public function testCreateServiceWithNameAndWithoutRequestName()
{
$foo = $this->diAbstractServiceFactory->createServiceWithName($this->mockServiceLocator, 'foo', null);
$this->assertEquals($this->fooInstance, $foo);
}

/**
* @covers Zend\ServiceManager\Di\DiAbstractServiceFactory::createServiceWithName
* @covers Zend\ServiceManager\Di\DiAbstractServiceFactory::get
Expand Down

0 comments on commit 25d94d4

Please sign in to comment.