diff options
Diffstat (limited to 'tests/cache/cache_test.php')
| -rw-r--r-- | tests/cache/cache_test.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/cache/cache_test.php b/tests/cache/cache_test.php index 220fddfd25..463095f129 100644 --- a/tests/cache/cache_test.php +++ b/tests/cache/cache_test.php @@ -2,37 +2,39 @@ /** * * @package testing -* @version $Id$ * @copyright (c) 2010 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ -require_once 'test_framework/framework.php'; +require_once __DIR__ . '/../../phpBB/includes/functions.php'; class phpbb_cache_test extends phpbb_test_case { protected function tearDown() { - $iterator = new DirectoryIterator('cache/tmp'); + $iterator = new DirectoryIterator(__DIR__ . '/tmp'); foreach ($iterator as $file) { - if (is_file('cache/tmp/' . $file)) + if (is_file(__DIR__ . '/tmp/' . $file) && $file != '.gitkeep') { - unlink('cache/tmp/' . $file); + unlink(__DIR__ . '/tmp/' . $file); } } } - public function test_acm_file() + public function test_cache_driver_file() { - $acm = new phpbb_cache_driver_file('cache/tmp/'); - $acm->put('test_key', 'test_value'); - $acm->save(); - + 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', - $acm->get('test_key'), + $driver->get('test_key'), 'File ACM put and get' ); } |
