コード例 #1
0
 public function testCreateService()
 {
     $sm = new ServiceManager();
     $sm->setService('Console', new Posix());
     $sm->setService('Config', []);
     $cm = $this->prophesize(ControllerManager::class);
     $cm->getServiceLocator()->willReturn($sm)->shouldBeCalled();
     $controller = $this->factory->createService($cm->reveal());
     $this->assertInstanceOf('Application\\Controller\\ConsoleController', $controller);
 }
コード例 #2
0
 public function testCreateService()
 {
     $sm = new ServiceManager();
     $sm->setService('Console', new Posix());
     $sm->setService('Config', []);
     $cm = new ControllerManager();
     $cm->setServiceLocator($sm);
     $controller = $this->factory->createService($cm);
     $this->assertInstanceOf('Application\\Controller\\ConsoleController', $controller);
 }