1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-21 16:22:22 +02:00

[ticket/9983] Add a test for destroy.

PHPBB3-9983
This commit is contained in:
Oleg Pudeyev 2012-12-01 18:59:28 -05:00
parent 8595b1f560
commit dd36b128e8
2 changed files with 29 additions and 0 deletions

View File

@ -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')
);
}
}

View File

@ -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;