本文整理汇总了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');
}