public function testCreateService() { /** @var \PHPUnit_Framework_MockObject_MockObject|ControllerManager $cm */ $cm = $this->getMockBuilder('Zend\\Mvc\\Controller\\ControllerManager')->disableOriginalConstructor()->getMock(); $cm->expects($this->any())->method('getServiceLocator')->willReturn(new ServiceManagerMock(['config' => ['mail_options' => []], 'AcMailer\\Service\\ConfigMigrationService' => new ConfigMigrationService()])); $this->assertInstanceOf('AcMailer\\Controller\\ConfigMigrationController', $this->factory->createService($cm)); }