Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
zendframework#6266 - Verifying that the service locator initializer i…
Browse files Browse the repository at this point in the history
…s registered and initializes `ServiceLocatorAwareInterface` objects
  • Loading branch information
Ocramius committed May 20, 2014
1 parent fa1dc47 commit 3db38f6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/ZendTest/Mvc/Service/ServiceManagerConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,23 @@ function () use ($instance) {

$this->services->get('service-manager-aware');
}

/**
* @group 6266
*/
public function testServiceLocatorInitializerIsUsedForServiceLocatorAwareObjects()
{
$instance = $this->getMock('Zend\ServiceManager\ServiceLocatorAwareInterface');

$instance->expects($this->once())->method('setServiceLocator')->with($this->services);

$this->services->setFactory(
'service-locator-aware',
function () use ($instance) {
return $instance;
}
);

$this->services->get('service-locator-aware');
}
}

0 comments on commit 3db38f6

Please sign in to comment.