mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/10875] Test for null cache driver and sql cache.
PHPBB3-10875
This commit is contained in:
parent
7bba09811c
commit
0c06ac466f
1 changed files with 29 additions and 0 deletions
29
tests/cache/cache_test.php
vendored
29
tests/cache/cache_test.php
vendored
|
@ -112,4 +112,33 @@ class phpbb_cache_test extends phpbb_database_test_case
|
|||
|
||||
$db->sql_close();
|
||||
}
|
||||
|
||||
public function test_null_cache_sql()
|
||||
{
|
||||
$driver = new phpbb_cache_driver_null($this->cache_dir);
|
||||
|
||||
global $db, $cache;
|
||||
$db = $this->new_dbal();
|
||||
$cache = new phpbb_cache_service($driver);
|
||||
|
||||
$sql = "SELECT * FROM phpbb_config
|
||||
WHERE config_name = 'foo'";
|
||||
$result = $db->sql_query($sql, 300);
|
||||
$first_result = $db->sql_fetchrow($result);
|
||||
$expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0);
|
||||
$this->assertEquals($expected, $first_result);
|
||||
|
||||
$sql = "DELETE FROM phpbb_config";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
// As null cache driver does not actually cache,
|
||||
// this should return no results
|
||||
$sql = "SELECT * FROM phpbb_config
|
||||
WHERE config_name = 'foo'";
|
||||
$result = $db->sql_query($sql, 300);
|
||||
|
||||
$this->assertSame(false, $db->sql_fetchrow($result));
|
||||
|
||||
$db->sql_close();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue