for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace DoctrineORMModuleTest\Yuml;
use DoctrineORMModule\Yuml\YumlController;
use DoctrineORMModule\Yuml\YumlControllerFactory;
use Zend\ServiceManager\AbstractPluginManager;
use Zend\ServiceManager\ServiceLocatorInterface;
class YumlControllerFactoryTest extends \PHPUnit_Framework_TestCase
{
public function testCreateService()
$config = [
'zenddevelopertools' => [
'toolbar' => [
'enabled' => true
]
];
$serviceLocator = $this->getMockBuilder(ServiceLocatorInterface::class)
->getMock();
$pluginManager = $this->getMockBuilder(AbstractPluginManager::class)
->disableOriginalConstructor()
$serviceLocator->expects(static::any())->method('get')->with('config')->willReturn($config);
$pluginManager->expects(static::once())
->method('getServiceLocator')
->willReturn($serviceLocator);
$factory = new YumlControllerFactory();
$controller = $factory->createService($pluginManager);
static::assertInstanceOf(YumlController::class, $controller);
}