diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-01 18:59:28 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-01 18:59:28 -0500 |
commit | dd36b128e80112ba47ae51dca47702209e8aac18 (patch) | |
tree | 8842013219da5cc98986bdc0e53415eba8a8b0c1 /tests/cache | |
parent | 8595b1f56018d0bfac0b83ac1511175c88a8b9cb (diff) | |
download | forums-dd36b128e80112ba47ae51dca47702209e8aac18.tar forums-dd36b128e80112ba47ae51dca47702209e8aac18.tar.gz forums-dd36b128e80112ba47ae51dca47702209e8aac18.tar.bz2 forums-dd36b128e80112ba47ae51dca47702209e8aac18.tar.xz forums-dd36b128e80112ba47ae51dca47702209e8aac18.zip |
[ticket/9983] Add a test for destroy.
PHPBB3-9983
Diffstat (limited to 'tests/cache')
-rw-r--r-- | tests/cache/common_test_case.php | 23 | ||||
-rw-r--r-- | tests/cache/null_driver_test.php | 6 |
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/cache/common_test_case.php b/tests/cache/common_test_case.php index 5c387d98a1..45cf80e424 100644 --- a/tests/cache/common_test_case.php +++ b/tests/cache/common_test_case.php @@ -38,4 +38,27 @@ abstract class phpbb_cache_common_test_case extends phpbb_database_test_case $this->assertSame(false, $this->driver->get('test_key')); } + + public function test_destroy() + { + $this->driver->put('first_key', 'first_value'); + $this->driver->put('second_key', 'second_value'); + + $this->assertEquals( + 'first_value', + $this->driver->get('first_key') + ); + $this->assertEquals( + 'second_value', + $this->driver->get('second_key') + ); + + $this->driver->destroy('first_key'); + + $this->assertFalse($this->driver->_exists('first_key')); + $this->assertEquals( + 'second_value', + $this->driver->get('second_key') + ); + } } diff --git a/tests/cache/null_driver_test.php b/tests/cache/null_driver_test.php index 1e8b254294..86553d4dc5 100644 --- a/tests/cache/null_driver_test.php +++ b/tests/cache/null_driver_test.php @@ -39,6 +39,12 @@ class phpbb_cache_null_driver_test extends phpbb_database_test_case $this->driver->purge(); } + public function test_destroy() + { + // does nothing + $this->driver->destroy('foo'); + } + public function test_cache_sql() { global $db, $cache; |