aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cache
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-11-30 12:28:13 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-11-30 12:28:13 -0500
commit0c06ac466f61cdab1c647cec23ea66ef70b2ad7e (patch)
treebfd39d8327b7cb5caa23759ef45b58565ea766fd /tests/cache
parent7bba09811c65acfd98ebf1e6626f59de7a16cbb3 (diff)
downloadforums-0c06ac466f61cdab1c647cec23ea66ef70b2ad7e.tar
forums-0c06ac466f61cdab1c647cec23ea66ef70b2ad7e.tar.gz
forums-0c06ac466f61cdab1c647cec23ea66ef70b2ad7e.tar.bz2
forums-0c06ac466f61cdab1c647cec23ea66ef70b2ad7e.tar.xz
forums-0c06ac466f61cdab1c647cec23ea66ef70b2ad7e.zip
[ticket/10875] Test for null cache driver and sql cache.
PHPBB3-10875
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/cache_test.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/cache/cache_test.php b/tests/cache/cache_test.php
index 40eef91d53..c904aa6c41 100644
--- a/tests/cache/cache_test.php
+++ b/tests/cache/cache_test.php
@@ -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();
+ }
}