Example #1
0
 /**
  * test basic config getting/setting/deleting cycle
  */
 public function testSetDeleteConfig()
 {
     $this->_instance->set(Tinebase_Config::PAGETITLEPOSTFIX, 'phpunit');
     $this->assertEquals('phpunit', $this->_instance->{Tinebase_Config::PAGETITLEPOSTFIX}, 'could not set config');
     $this->_instance->delete(Tinebase_Config::PAGETITLEPOSTFIX, 'phpunit');
     $this->assertEquals('###PHPUNIT-NOTSET###', $this->_instance->get(Tinebase_Config::PAGETITLEPOSTFIX, '###PHPUNIT-NOTSET###'), 'config got not deleted');
     $this->assertFalse(isset($this->_instance->{Tinebase_Config::PAGETITLEPOSTFIX}), '__isset not working');
 }
 /**
  * test if config returns empty array if it's empty
  */
 public function testReturnEmptyValue()
 {
     // Hold original value for further tests of sieve.
     $keepOriginalValue = $this->_instance->get("sieve");
     // Ensure  sieve key is null
     $this->_instance->set("sieve", null);
     // If key is null it throws an exception, so return empty array if it's null.
     $this->assertTrue($this->_instance->get("sieve") instanceof Tinebase_Config_Struct);
     // Check common function of the getFunction
     $this->assertTrue(is_numeric($this->_instance->get("acceptedTermsVersion")));
     // restore value
     $this->_instance->set("sieve", $keepOriginalValue);
 }