From 00e24db95a91745789ed96e969e9bef73ba99f45 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Wed, 5 Mar 2014 14:25:18 -0600 Subject: [PATCH] [#4455] Updated Logger abstract factory to reflect MVC - Use LogWriterManager and LogProcessorManager services instead. - Added group annotations to tests --- library/Zend/Log/LoggerAbstractServiceFactory.php | 8 ++++---- .../ZendTest/Log/LoggerAbstractServiceFactoryTest.php | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/library/Zend/Log/LoggerAbstractServiceFactory.php b/library/Zend/Log/LoggerAbstractServiceFactory.php index 43bb6ebd0b2..4712ef07984 100644 --- a/library/Zend/Log/LoggerAbstractServiceFactory.php +++ b/library/Zend/Log/LoggerAbstractServiceFactory.php @@ -100,9 +100,9 @@ protected function processConfig(&$config, ServiceLocatorInterface $services) if ((!isset($config['writer_plugin_manager']) || ! $config['writer_plugin_manager'] instanceof AbstractPluginManager) - && $services->has('Zend\Log\WriterPluginManager') + && $services->has('LogWriterManager') ) { - $config['writer_plugin_manager'] = $services->get('Zend\Log\WriterPluginManager'); + $config['writer_plugin_manager'] = $services->get('LogWriterManager'); } if (isset($config['processor_plugin_manager']) @@ -114,9 +114,9 @@ protected function processConfig(&$config, ServiceLocatorInterface $services) if ((!isset($config['processor_plugin_manager']) || ! $config['processor_plugin_manager'] instanceof AbstractPluginManager) - && $services->has('Zend\Log\ProcessorPluginManager') + && $services->has('LogProcessorManager') ) { - $config['processor_plugin_manager'] = $services->get('Zend\Log\ProcessorPluginManager'); + $config['processor_plugin_manager'] = $services->get('LogProcessorManager'); } if (!isset($config['writers'])) { diff --git a/tests/ZendTest/Log/LoggerAbstractServiceFactoryTest.php b/tests/ZendTest/Log/LoggerAbstractServiceFactoryTest.php index eaee5630c30..6c96da000cf 100644 --- a/tests/ZendTest/Log/LoggerAbstractServiceFactoryTest.php +++ b/tests/ZendTest/Log/LoggerAbstractServiceFactoryTest.php @@ -131,6 +131,9 @@ public function testRetrievesDatabaseServiceFromServiceManagerWhenEncounteringDb $this->assertAttributeSame($db, 'db', $writer); } + /** + * @group 4455 + */ public function testWillInjectWriterPluginManagerIfAvailable() { $writers = new WriterPluginManager(); @@ -140,7 +143,7 @@ public function testWillInjectWriterPluginManagerIfAvailable() $services = new ServiceManager(new ServiceManagerConfig(array( 'abstract_factories' => array('Zend\Log\LoggerAbstractServiceFactory'), ))); - $services->setService('Zend\Log\WriterPluginManager', $writers); + $services->setService('LogWriterManager', $writers); $services->setService('Config', array( 'log' => array( 'Application\Frontend' => array( @@ -156,6 +159,9 @@ public function testWillInjectWriterPluginManagerIfAvailable() $this->assertSame($mockWriter, $writer); } + /** + * @group 4455 + */ public function testWillInjectProcessorPluginManagerIfAvailable() { $processors = new ProcessorPluginManager(); @@ -165,7 +171,7 @@ public function testWillInjectProcessorPluginManagerIfAvailable() $services = new ServiceManager(new ServiceManagerConfig(array( 'abstract_factories' => array('Zend\Log\LoggerAbstractServiceFactory'), ))); - $services->setService('Zend\Log\ProcessorPluginManager', $processors); + $services->setService('LogProcessorManager', $processors); $services->setService('Config', array( 'log' => array( 'Application\Frontend' => array(