本文整理匯總了PHP中rex::removeProperty方法的典型用法代碼示例。如果您正苦於以下問題:PHP rex::removeProperty方法的具體用法?PHP rex::removeProperty怎麽用?PHP rex::removeProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rex
的用法示例。
在下文中一共展示了rex::removeProperty方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testRexProperty
public function testRexProperty()
{
$key = 'aTestKey';
// initial test on empty config
$this->assertFalse(rex::hasProperty($key), 'the key does not exists at first');
$this->assertNull(rex::getProperty($key), 'getting non existing key returns null');
$this->assertEquals(rex::getProperty($key, 'defVal'), 'defVal', 'getting non existing key returns a given default');
$this->assertFalse(rex::removeProperty($key), 'remove non existing key returns false');
// test after setting a value
$this->assertFalse(rex::setProperty($key, 'aVal'), 'setting non-existant value returns false');
$this->assertEquals(rex::getProperty($key, 'defVal'), 'aVal', 'getting existing key returns its value');
$this->assertTrue(rex::hasProperty($key), 'setted value exists');
// test after re-setting a value
$this->assertTrue(rex::setProperty($key, 'aOtherVal'), 're-setting a value returns true');
$this->assertEquals(rex::getProperty($key, 'defaOtherVal'), 'aOtherVal', 'getting existing key returns its value');
// test after cleanup
$this->assertTrue(rex::removeProperty($key), 'remove a existing key returns true');
$this->assertFalse(rex::hasProperty($key), 'the key does not exists after removal');
$this->assertNull(rex::getProperty($key), 'getting non existing key returns null');
$this->assertEquals(rex::getProperty($key, 'defVal'), 'defVal', 'getting non existing key returns a given default');
}
示例2: tearDown
public function tearDown()
{
rex::removeProperty('myCoreProperty');
rex_addon::get('tests')->removeProperty('tests', 'myPackageProperty');
}