本文整理匯總了PHP中Tinebase_Config::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tinebase_Config::set方法的具體用法?PHP Tinebase_Config::set怎麽用?PHP Tinebase_Config::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tinebase_Config
的用法示例。
在下文中一共展示了Tinebase_Config::set方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testSetDeleteConfig
/**
* 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');
}
示例2: testReturnEmptyValue
/**
* 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);
}