Skip to content

Commit

Permalink
add tests for #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Roel Arents committed May 31, 2016
1 parent 5eeeb44 commit dfa57c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Factory/FormatterPluginManagerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public function testRetrieveFormatterInstance()
$formatterPluginManager = $formatterPluginManagerFactory->createService($serviceLocator);
$this->assertInstanceOf('MonologModule\Formatter\FormatterPluginManager', $formatterPluginManager);

// Assert that a ServiceLocatorInterface service has been injected.
// If it would be injected via the deprecated ServiceLocatorAwareInitializer, a E_USER_DEPRECATED would have been triggered.
$this->assertInstanceOf('Zend\ServiceManager\ServiceLocatorInterface', $formatterPluginManager->getServiceLocator());

$service = $formatterPluginManager->get('foo');
$this->assertInstanceOf('Monolog\Formatter\FormatterInterface', $service);
}
Expand Down
4 changes: 4 additions & 0 deletions tests/Factory/HandlerPluginManagerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ public function testRetrieveHandlerInstance()
$handlerPluginManager = $handlerPluginManagerFactory->createService($serviceLocator);
$this->assertInstanceOf('MonologModule\Handler\HandlerPluginManager', $handlerPluginManager);

// Assert that a ServiceLocatorInterface service has been injected.
// If it would be injected via the deprecated ServiceLocatorAwareInitializer, a E_USER_DEPRECATED would have been triggered.
$this->assertInstanceOf('Zend\ServiceManager\ServiceLocatorInterface', $formatterPluginManager->getServiceLocator());

$service = $handlerPluginManager->get('foo');
$this->assertInstanceOf('Monolog\Handler\HandlerInterface', $service);
}
Expand Down

0 comments on commit dfa57c0

Please sign in to comment.