diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/config/config_test.php | 8 | ||||
-rw-r--r-- | tests/config/db_test.php | 14 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/config/config_test.php b/tests/config/config_test.php index 73a365c847..9c91d9eb87 100644 --- a/tests/config/config_test.php +++ b/tests/config/config_test.php @@ -109,4 +109,12 @@ class phpbb_config_test extends phpbb_test_case $config->increment('foo', 1); $this->assertEquals(27, $config['foo']); } + + public function test_delete() + { + $config = new phpbb_config(array('foo' => 'bar')); + + $config->delete('foo'); + $this->assertFalse(isset($config['foo'])); + } } diff --git a/tests/config/db_test.php b/tests/config/db_test.php index e0d5252f19..5bd5296e5a 100644 --- a/tests/config/db_test.php +++ b/tests/config/db_test.php @@ -125,4 +125,18 @@ class phpbb_config_db_test extends phpbb_database_test_case $this->config->increment('foobar', 3); $this->assertEquals(3, $this->config['foobar']);; } + + public function test_delete() + { + $this->assertTrue(isset($this->config['foo'])); + $this->config->delete('foo'); + $this->cache->checkVarUnset($this, 'foo'); + $this->assertFalse(isset($this->config['foo'])); + + // re-read config and populate cache + $cache2 = new phpbb_mock_cache; + $config2 = new phpbb_config_db($this->db, $cache2, 'phpbb_config'); + $cache2->checkVarUnset($this, 'foo'); + $this->assertFalse(isset($config2['foo'])); + } } |