aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cache
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/cache_test.php38
-rw-r--r--tests/cache/tmp/.gitkeep0
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/cache/cache_test.php b/tests/cache/cache_test.php
new file mode 100644
index 0000000000..2f11267cba
--- /dev/null
+++ b/tests/cache/cache_test.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2010 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class phpbb_cache_test extends phpbb_test_case
+{
+ protected function tearDown()
+ {
+ $iterator = new DirectoryIterator(dirname(__FILE__) . '/tmp');
+ foreach ($iterator as $file)
+ {
+ if (is_file(dirname(__FILE__) . '/tmp/' . $file) && $file != '.gitkeep')
+ {
+ unlink(dirname(__FILE__) . '/tmp/' . $file);
+ }
+ }
+ }
+
+ public function test_cache_driver_file()
+ {
+ $driver = new phpbb_cache_driver_file(dirname(__FILE__) . '/tmp/');
+ $driver->put('test_key', 'test_value');
+ $driver->save();
+
+ $this->assertEquals(
+ 'test_value',
+ $driver->get('test_key'),
+ 'File ACM put and get'
+ );
+ }
+}
diff --git a/tests/cache/tmp/.gitkeep b/tests/cache/tmp/.gitkeep
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/cache/tmp/.gitkeep