コード例 #1
0
ファイル: OptionsTest.php プロジェクト: peteraba/dm-common
 /**
  * @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);
 }
コード例 #2
0
ファイル: QueueItemTest.php プロジェクト: peteraba/dm-mailer
 /**
  * @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);
 }
コード例 #3
0
ファイル: MessageTest.php プロジェクト: peteraba/dm-mailercli
 /**
  * @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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #6
0
 /**
  * @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);
 }
コード例 #7
0
ファイル: MessageTest.php プロジェクト: peteraba/dm-tinymce
 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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #13
0
ファイル: SubscriberTest.php プロジェクト: peteraba/dm-mailer
 /**
  * @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);
 }
コード例 #14
0
ファイル: SubscriberTest.php プロジェクト: peteraba/dm-mailer
 /**
  * @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);
 }
コード例 #15
0
ファイル: QueueTest.php プロジェクト: peteraba/dm-mailer
 /**
  * @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);
 }
コード例 #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);
 }
コード例 #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);
 }
コード例 #18
0
 /**
  * @covers DmTest\ServiceManager\ServiceLocatorDummy
  */
 public function testHasReturnsTrueForSetKeys()
 {
     $this->sut->set('StdClass', new \StdClass());
     $this->assertTrue($this->sut->has('StdClass'));
 }