Ejemplo n.º 1
0
 /**
  * test, if configuration overwrites default values
  *
  * @dataProvider providerTestFactory
  * @covers Jobs\Factory\ModuleOptionsFactory
  */
 public function testFactory($config)
 {
     $serviceManager = $this->getMockBuilder('\\Zend\\ServiceManager\\ServiceManager')->disableOriginalConstructor()->getMock();
     if (isset($config['core_options'])) {
         $coreOptions = new \Core\Options\ModuleOptions($config['core_options']);
         $serviceManager->expects($this->exactly(2))->method('get')->withConsecutive(array('Config'), array('Core/Options'))->will($this->onConsecutiveCalls($config, $coreOptions));
     } else {
         $serviceManager->expects($this->once())->method('get')->with('Config')->willReturn($config);
     }
     $factory = new ModuleOptionsFactory();
     $defaultOption = new ModuleOptions(array());
     $object = $factory->createService($serviceManager);
     $this->assertInstanceOf('Jobs\\Options\\ModuleOptions', $object);
     if (isset($config['jobs_options'])) {
         $this->assertNotEquals($defaultOption->getMultipostingApprovalMail(), $object->getMultipostingApprovalMail());
         $this->assertEquals($config['jobs_options']['multipostingApprovalMail'], $object->getMultipostingApprovalMail());
     } else {
         $this->assertEquals($config['core_options']['system_message_email'], $object->getMultipostingApprovalMail());
     }
 }
Ejemplo n.º 2
0
 /**
  * @covers Jobs\Options\ModuleOptions::getCompanyLogoMimeType
  * @covers Jobs\Options\ModuleOptions::setCompanyLogoMimeType
  */
 public function testSetGetCompanyLogoMimeType()
 {
     $mime = array("text/plain");
     $this->options->setCompanyLogoMimeType($mime);
     $this->assertEquals($mime, $this->options->getCompanyLogoMimeType());
 }