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

Commit

Permalink
#83 - cyclic dependencies should eagerly cause a crash to prevent sil…
Browse files Browse the repository at this point in the history
…ly mistakes with aliases
  • Loading branch information
Ocramius committed Jan 26, 2016
1 parent fb359fb commit 3d8bd24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/CommonServiceLocatorBehaviorsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use stdClass;
use Zend\ServiceManager\Exception\ContainerModificationsNotAllowedException;
use Zend\ServiceManager\Exception\InvalidArgumentException;
use Zend\ServiceManager\Exception\InvalidServiceException;
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\ServiceManager\Factory\FactoryInterface;
Expand Down Expand Up @@ -790,15 +791,15 @@ public function testCanRetrieveParentContainerViaGetServiceLocatorWithDeprecatio
*/
public function testCrashesOnCyclicAliases()
{
$this->setExpectedException(InvalidServiceException::class);

$serviceManager = $this->createContainer([
'aliases' => [
'a' => 'b',
'b' => 'a',
],
]);

$this->setExpectedException(ServiceNotFoundException::class);

$serviceManager->get('b');
}
}

0 comments on commit 3d8bd24

Please sign in to comment.