mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/16891] Add mock to purge extension manager cache in tests
PHPBB3-16891
This commit is contained in:
parent
3be1e3029e
commit
c4fcbc2cbd
1 changed files with 7 additions and 1 deletions
|
@ -256,6 +256,12 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||||
$container->set('migrator', $migrator);
|
$container->set('migrator', $migrator);
|
||||||
$container->set('dispatcher', $phpbb_dispatcher);
|
$container->set('dispatcher', $phpbb_dispatcher);
|
||||||
|
$cache = $this->getMockBuilder('\phpbb\cache\service')
|
||||||
|
->setConstructorArgs([$this->get_cache_driver(), $config, $this->db, $phpbb_dispatcher, $phpbb_root_path, $phpEx])
|
||||||
|
->setMethods(['deferred_purge'])
|
||||||
|
->getMock();
|
||||||
|
$cache->method('deferred_purge')
|
||||||
|
->willReturnCallback([$cache, 'purge']);
|
||||||
|
|
||||||
$extension_manager = new \phpbb\extension\manager(
|
$extension_manager = new \phpbb\extension\manager(
|
||||||
$container,
|
$container,
|
||||||
|
@ -265,7 +271,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
self::$config['table_prefix'] . 'ext',
|
self::$config['table_prefix'] . 'ext',
|
||||||
__DIR__ . '/',
|
__DIR__ . '/',
|
||||||
$phpEx,
|
$phpEx,
|
||||||
new \phpbb\cache\service($this->get_cache_driver(), $config, $this->db, $phpbb_dispatcher, $phpbb_root_path, $phpEx)
|
$cache
|
||||||
);
|
);
|
||||||
|
|
||||||
return $extension_manager;
|
return $extension_manager;
|
||||||
|
|
Loading…
Add table
Reference in a new issue