1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

[task/acm-refactor] Refactor the ACM classes to have a common interface.

They are now refered to as cache drivers rather than ACM classes. The
additional utility functions from the original cache class have been
moved to the cache_service. The class loader is now instantiated without
a cache instance and passed one as soon as it is constructed to allow
autoloading the cache classes.

PHPBB3-9983
This commit is contained in:
Igor Wiedler
2010-11-03 18:35:31 +01:00
parent 36e95f939d
commit 9329b16ab1
23 changed files with 415 additions and 102 deletions

39
tests/cache/cache_test.php vendored Normal file
View File

@@ -0,0 +1,39 @@
<?php
/**
*
* @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';
class phpbb_cache_test extends phpbb_test_case
{
protected function tearDown()
{
$iterator = new DirectoryIterator('cache/tmp');
foreach ($iterator as $file)
{
if (is_file('cache/tmp/' . $file))
{
unlink('cache/tmp/' . $file);
}
}
}
public function test_acm_file()
{
$acm = new phpbb_cache_driver_file('cache/tmp/');
$acm->put('test_key', 'test_value');
$acm->save();
$this->assertEquals(
'test_value',
$acm->get('test_key'),
'File ACM put and get'
);
}
}