mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +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:
@@ -10,8 +10,6 @@
|
||||
|
||||
require_once __DIR__ . '/cache_mock.php';
|
||||
|
||||
require_once __DIR__ . '/../../phpBB/includes/class_loader.php';
|
||||
|
||||
class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
@@ -63,8 +61,16 @@ class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
|
||||
|
||||
public function test_resolve_cached()
|
||||
{
|
||||
$cache = new phpbb_cache_mock;
|
||||
$cache->put('class_loader', array('phpbb_a_cached_name' => 'a/cached_name'));
|
||||
$cacheMap = array('class_loader' => array('phpbb_a_cached_name' => 'a/cached_name'));
|
||||
|
||||
$cache = $this->getMock('phpbb_cache_driver_interface',
|
||||
array('get', 'put', 'load', 'unload', 'save', 'tidy', 'purge', 'destroy', '_exists',
|
||||
'sql_load', 'sql_save', 'sql_exists', 'sql_fetchrow', 'sql_fetchfield', 'sql_rowseek', 'sql_freeresult'));
|
||||
$cache->expects($this->any())
|
||||
->method('get')
|
||||
->will($this->returnCallback(function($var_name) use ($cacheMap) {
|
||||
return $cacheMap[$var_name];
|
||||
}));
|
||||
|
||||
$prefix = __DIR__ . '/';
|
||||
$class_loader = new phpbb_class_loader($prefix, '.php', $cache);
|
||||
|
Reference in New Issue
Block a user