/** * @covers DmCommon\Factory\Helper\Options */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $serviceLocator->set('config', []); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmCommon\\Helper\\Options', $result); }
/** * @covers DmMailer\Factory\Manager\QueueItem */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $serviceLocator->set('request', $serviceLocator->get('Zend\\Http\\PhpEnvironment\\Request')); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmMailer\\Manager\\QueueItem', $result); }
/** * @covers DmMailerCli\Factory\Controller\Queue */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $serviceLocator->set('DmMailer\\Log', $serviceLocator->get('Zend\\Log\\Logger')); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmMailerCli\\Controller\\MessageController', $result); }
/** * @covers DmCommon\Factory\Service\ErrorHandler */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $serviceLocator->set('DmCommon\\Exception\\Log', $serviceLocator->get('Zend\\Log\\Logger')); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmCommon\\Service\\ErrorHandler', $result); }
/** * @covers DmMailerApi\Factory\Controller\Subscriber */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $serviceLocator->set('DmCommon\\Exception\\Log', $serviceLocator->get('Zend\\Log\\Logger')); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmMailerApi\\Controller\\SubscriberController', $result); }
/** * @covers DmMailerAdmin\Factory\Service\SessionGuard */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $serviceLocator->set('zfcuser_auth_service', $serviceLocator->get('Zend\\Authentication\\AuthenticationService')); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmMailerAdmin\\Service\\SessionGuard', $result); }
public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $helperOptionsStub = $this->getMock('DmTinymce\\Helper\\Options', ['getTinymceLang'], [[]]); $serviceLocator->set('DmTinymce\\Helper\\Options', $helperOptionsStub); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmMailerAdmin\\Controller\\MessageController', $result); }
/** * @covers DmImporter\Factory\Controller\Subscriber */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $serviceLocator->set('Doctrine\\ORM\\EntityManager', $this->getConnectionMock()); $serviceLocator->set('DmMailer\\Log', $this->getLoggerStub()); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmImporter\\Controller\\Subscriber', $result); }
/** * @covers DmFileman\Factory\Controller\ListFactory */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $fileManager = $serviceLocator->get('DmFileman\\Service\\FileManager\\FileManager'); $serviceLocator->set('DmFileman\\Service\\FileManager', $fileManager); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmFileman\\Controller\\ListController', $result); }
/** * @covers DmFileman\Factory\InputFilter\UploadFile */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $optionsHelper = $this->getMock('DmFileman\\Helper\\Options', ['getExtensions', 'getMaxSize'], [], '', false); $serviceLocator->set('DmFileman\\Helper\\Options', $optionsHelper); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmFileman\\InputFilter\\UploadFile', $result); }
/** * @covers DmMailerAdmin\Factory\Controller\Template */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $userTextStub = $serviceLocator->get('DmCommon\\View\\Helper\\UserText'); $serviceLocator->set('DmMailerAdmin\\View\\Helper\\UserText', $userTextStub); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmMailerAdmin\\Controller\\TemplateController', $result); }
/** * @covers DmMailer\Factory\Service\MailThrottle */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $optionsStub = $this->getMock('DmMailer\\Helper\\Options', ['getThrottle'], [], '', false); $optionsStub->expects($this->any())->method('getThrottle')->willReturn([]); $serviceLocator->set('DmMailer\\Helper\\Options', $optionsStub); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmMailer\\Service\\MailThrottle', $result); }
/** * @covers DmMailer\Factory\Form\Subscriber */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $campaignRepoStub = $this->getMock('DmMailer\\Repository\\Campaign', ['getSelectOptions'], [], '', false); $campaignRepoStub->expects($this->any())->method('getSelectOptions')->willReturn([]); $serviceLocator->set('DmMailer\\Repository\\Campaign', $campaignRepoStub); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmMailer\\Form\\SubscriberForm', $result); }
/** * @covers DmMailer\Factory\Repository\Subscriber */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $repositoryStub = $this->getMock('DmMailer\\Entity\\Subscriber', ['setEntity', 'setHelper'], [], '', false); $entityManagerStub = $this->getMock('Doctrine\\ORM\\EntityManager', ['getRepository'], [], '', false); $entityManagerStub->expects($this->any())->method('getRepository')->willReturn($repositoryStub); $serviceLocator->set('Doctrine\\ORM\\EntityManager', $entityManagerStub); $result = $this->sut->createService($serviceLocator); $this->assertSame($repositoryStub, $result); }
/** * @covers DmMailer\Factory\Service\Queue */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $sxStub = $this->getMock('SxMail\\SxMail', [], [], '', false); $sxMailStub = $this->getMock('SxMail\\Service\\SxMail', ['prepare'], [], '', false); $sxMailStub->expects($this->any())->method('prepare')->willReturn($sxStub); $serviceLocator->set('SxMail\\Service\\SxMail', $sxMailStub); $serviceLocator->set('DmCommon\\Log', $serviceLocator->get('Zend\\Log\\Logger')); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmMailer\\Service\\Queue', $result); }
/** * @covers DmFileman\Factory\Service\Thumbnailer */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $optionsStub = $this->getMockBuilder('DmFileman\\Helper\\Options')->setMethods(['getThumbsOptions'])->disableOriginalConstructor()->getMock(); $optionsStub->expects($this->any())->method('getThumbsOptions')->willReturn([]); $serviceLocator->set('DmFileman\\Helper\\Options', $optionsStub); $imagineStub = $this->getMockBuilder('Imagine\\Gd\\Imagine')->setMethods([])->disableAutoload()->getMock(); $serviceLocator->set('Imagine\\Gd\\Imagine', $imagineStub); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmFileman\\Service\\Thumbnailer\\Thumbnailer', $result); }
/** * @covers DmFileman\Factory\Controller\DeleteFile */ public function testCreateService() { $serviceLocator = new ServiceLocatorDummy($this); $fileManager = $serviceLocator->get('DmFileman\\Service\\FileManager\\FileManager'); $serviceLocator->set('DmFileman\\Service\\FileManager', $fileManager); $thumbnailer = $serviceLocator->get('DmFileman\\Service\\Thumbnailer\\Thumbnailer'); $serviceLocator->set('DmFileman\\Service\\Thumbnailer', $thumbnailer); $userText = $serviceLocator->get('DmCommon\\View\\Helper\\UserText'); $serviceLocator->set('DmFileman\\View\\Helper\\UserText', $userText); $result = $this->sut->createService($serviceLocator); $this->assertInstanceOf('DmFileman\\Controller\\DeleteFileController', $result); }
/** * @covers DmTest\ServiceManager\ServiceLocatorDummy */ public function testHasReturnsTrueForSetKeys() { $this->sut->set('StdClass', new \StdClass()); $this->assertTrue($this->sut->has('StdClass')); }