diff options
author | Igor Wiedler <igor@wiedler.ch> | 2011-01-09 23:58:27 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2011-01-09 23:58:27 +0100 |
commit | 95c683056b85399200e2caaa9aa65edc6843c16f (patch) | |
tree | ac11043ba149791a225d587e7a61e34db75a04f6 /tests/cache/cache_test.php | |
parent | 5373f8157d8a2619197702c3a00a6bb432ef3e25 (diff) | |
parent | 1aef7eb20ee195c7f21d6c5b78653b7c43e669ec (diff) | |
download | forums-95c683056b85399200e2caaa9aa65edc6843c16f.tar forums-95c683056b85399200e2caaa9aa65edc6843c16f.tar.gz forums-95c683056b85399200e2caaa9aa65edc6843c16f.tar.bz2 forums-95c683056b85399200e2caaa9aa65edc6843c16f.tar.xz forums-95c683056b85399200e2caaa9aa65edc6843c16f.zip |
Merge branch 'task/acm-refactor' into develop
Conflicts:
tests/bootstrap.php
Diffstat (limited to 'tests/cache/cache_test.php')
-rw-r--r-- | tests/cache/cache_test.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/cache/cache_test.php b/tests/cache/cache_test.php new file mode 100644 index 0000000000..463095f129 --- /dev/null +++ b/tests/cache/cache_test.php @@ -0,0 +1,41 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2010 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +require_once __DIR__ . '/../../phpBB/includes/functions.php'; + +class phpbb_cache_test extends phpbb_test_case +{ + protected function tearDown() + { + $iterator = new DirectoryIterator(__DIR__ . '/tmp'); + foreach ($iterator as $file) + { + if (is_file(__DIR__ . '/tmp/' . $file) && $file != '.gitkeep') + { + unlink(__DIR__ . '/tmp/' . $file); + } + } + } + + public function test_cache_driver_file() + { + global $phpEx; + $phpEx = 'txt'; // do not store files as .php + + $driver = new phpbb_cache_driver_file(__DIR__ . '/tmp/'); + $driver->put('test_key', 'test_value'); + $driver->save(); + + $this->assertEquals( + 'test_value', + $driver->get('test_key'), + 'File ACM put and get' + ); + } +} |