public function testNullLoggerIsNotUsedIfAnotherLoggerProvided()
 {
     $builder = new ServiceManagerBuilder(array('service_manager' => array('invokables' => array('Logger' => 'PPI\\FrameworkTest\\ServiceManager\\MyLogger'))));
     $serviceManager = $builder->build($this->getAppParameters());
     $this->assertTrue($serviceManager->has('logger'));
     $this->assertInstanceOf('Psr\\Log\\NullLogger', $serviceManager->get('logger'));
 }
示例#2
0
 /**
  * Creates and initializes a ServiceManager instance.
  *
  * @return ServiceManager The compiled service manager
  */
 protected function buildServiceManager()
 {
     // ServiceManager creation
     $serviceManager = new ServiceManagerBuilder($this->getConfigManager()->getMergedConfig());
     $serviceManager->build($this->getAppParameters());
     $serviceManager->set('app', $this);
     return $serviceManager;
 }