예제 #1
0
 /**
  * test, if configuration overwrites default values
  *
  * @dataProvider providerTestFactory
  */
 public function testFactory($config)
 {
     $serviceManager = new ServiceManager();
     $serviceManager->setService('Config', $config);
     $factory = new ModuleOptionsFactory();
     $defaultOption = new ModuleOptions(array());
     $object = $factory->createService($serviceManager);
     $this->assertInstanceOf('Applications\\Options\\ModuleOptions', $object);
     if (isset($config['application_options'])) {
         $this->assertNotEquals($defaultOption->getAttachmentsMaxSize(), $object->getAttachmentsMaxSize());
         $this->assertEquals($config['application_options']['attachmentsMaxSize'], $object->getAttachmentsMaxSize());
     } else {
         $this->assertEquals($defaultOption->getAttachmentsMaxSize(), $object->getAttachmentsMaxSize());
     }
 }
예제 #2
0
 /**
  * @covers ::setAllowSubsequentAttachmentUpload
  * @covers ::getAllowSubsequentAttachmentUpload
  */
 public function testSetGetAllowSubsequentAttachmentUpload()
 {
     $this->assertFalse($this->options->getAllowSubsequentAttachmentUpload());
     $this->options->setAllowSubsequentAttachmentUpload(true);
     $this->assertTrue($this->options->getAllowSubsequentAttachmentUpload());
     $this->options->setAllowSubsequentAttachmentUpload('1');
     $this->assertTrue($this->options->getAllowSubsequentAttachmentUpload());
     $this->options->setAllowSubsequentAttachmentUpload(false);
     $this->assertFalse($this->options->getAllowSubsequentAttachmentUpload());
     $this->options->setAllowSubsequentAttachmentUpload('0');
     $this->assertFalse($this->options->getAllowSubsequentAttachmentUpload());
 }
예제 #3
0
 /**
  * @covers Applications\Options\ModuleOptions::getContactImageMaxSize
  * @covers Applications\Options\ModuleOptions::setContactImageMaxSize
  */
 public function testSetGetAllowedMimeTypes()
 {
     $mime = array('image', 'application/pdf');
     $this->options->setAllowedMimeTypes($mime);
     $this->assertEquals($mime, $this->options->getAllowedMimeTypes());
 }