public function testHandlersOrder()
 {
     $config = array('name' => 'test', 'handlers' => array('testHandler' => 'TestHandler', 'nullHandler' => array('name' => 'Monolog\\Handler\\NullHandler')));
     $serviceManager = new ServiceManager();
     $factory = new MonologServiceFactory();
     /** @var \Monolog\Handler\TestHandler $handler */
     $handler = $factory->createHandler($serviceManager, new MonologOptions($config), array('name' => 'Monolog\\Handler\\TestHandler', 'args' => array('bubble' => false)));
     $serviceManager->setService('TestHandler', $handler);
     $serviceManager->setService('EnliteMonologOptions', new MonologOptions($config));
     $service = $factory->createService($serviceManager);
     $service->addError('HandleThis!');
     $handler1 = $service->popHandler();
     $this->assertInstanceOf('Monolog\\Handler\\TestHandler', $handler1);
     $handler2 = $service->popHandler();
     $this->assertInstanceOf('Monolog\\Handler\\NullHandler', $handler2);
     self::assertTrue($handler->hasErrorRecords());
 }
 private function createLogger($container, $requestedName)
 {
     $config = $this->getConfig($container);
     $factory = new MonologServiceFactory();
     return $factory->createLogger($container, new MonologOptions($config[$requestedName]));
 }