Example #1
0
 /**
  * @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);
 }
Example #2
0
 /**
  * @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);
 }
Example #3
0
 /**
  * @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);
 }
Example #4
0
 /**
  * @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);
 }
Example #5
0
 /**
  * @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);
 }
Example #7
0
 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);
 }
Example #8
0
 /**
  * @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);
 }
Example #9
0
 /**
  * @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);
 }
Example #10
0
 /**
  * @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);
 }
Example #11
0
 /**
  * @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);
 }
Example #12
0
 /**
  * @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);
 }
Example #13
0
 /**
  * @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);
 }
Example #14
0
 /**
  * @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);
 }
Example #15
0
 /**
  * @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);
 }
Example #16
0
 /**
  * @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);
 }
Example #17
0
 /**
  * @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'));
 }