mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/9983] Add a test for destroy.
PHPBB3-9983
This commit is contained in:
parent
8595b1f560
commit
dd36b128e8
2 changed files with 29 additions and 0 deletions
23
tests/cache/common_test_case.php
vendored
23
tests/cache/common_test_case.php
vendored
|
@ -38,4 +38,27 @@ abstract class phpbb_cache_common_test_case extends phpbb_database_test_case
|
||||||
|
|
||||||
$this->assertSame(false, $this->driver->get('test_key'));
|
$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')
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
6
tests/cache/null_driver_test.php
vendored
6
tests/cache/null_driver_test.php
vendored
|
@ -39,6 +39,12 @@ class phpbb_cache_null_driver_test extends phpbb_database_test_case
|
||||||
$this->driver->purge();
|
$this->driver->purge();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_destroy()
|
||||||
|
{
|
||||||
|
// does nothing
|
||||||
|
$this->driver->destroy('foo');
|
||||||
|
}
|
||||||
|
|
||||||
public function test_cache_sql()
|
public function test_cache_sql()
|
||||||
{
|
{
|
||||||
global $db, $cache;
|
global $db, $cache;
|
||||||
|
|
Loading…
Add table
Reference in a new issue