/** * 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()); } }
/** * @covers Applications\Options\ModuleOptions::getAttachmentsMaxSize * @covers Applications\Options\ModuleOptions::setAttachmentsMaxSize */ public function testSetGetAttachmentsMaxSize() { $this->options->setAttachmentsMaxSize(12345); $this->assertEquals(12345, $this->options->getAttachmentsMaxSize()); }