mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-09 04:48:53 +00:00
[ticket/11305] Mock container for cache driver in functional create_user()
create_user has calls to fetch the cache driver from the container. This PR mocks the container and returns a null cache driver in that case. PHPBB3-11305
This commit is contained in:
parent
c8c6eb46ec
commit
0483971f77
1 changed files with 9 additions and 1 deletions
|
@ -262,7 +262,7 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
$config['rand_seed_last_update'] = time() + 600;
|
$config['rand_seed_last_update'] = time() + 600;
|
||||||
|
|
||||||
// Required by user_add
|
// Required by user_add
|
||||||
global $db, $cache, $phpbb_dispatcher;
|
global $db, $cache, $phpbb_dispatcher, $phpbb_container;
|
||||||
$db = $this->get_db();
|
$db = $this->get_db();
|
||||||
if (!function_exists('phpbb_mock_null_cache'))
|
if (!function_exists('phpbb_mock_null_cache'))
|
||||||
{
|
{
|
||||||
|
@ -270,6 +270,14 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
}
|
}
|
||||||
$cache = new phpbb_mock_null_cache;
|
$cache = new phpbb_mock_null_cache;
|
||||||
|
|
||||||
|
$cache_driver = new phpbb_cache_driver_null();
|
||||||
|
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
|
||||||
|
$phpbb_container
|
||||||
|
->expects($this->any())
|
||||||
|
->method('get')
|
||||||
|
->with('cache.driver')
|
||||||
|
->will($this->returnValue($cache_driver));
|
||||||
|
|
||||||
if (!function_exists('utf_clean_string'))
|
if (!function_exists('utf_clean_string'))
|
||||||
{
|
{
|
||||||
require_once(__DIR__ . '/../../phpBB/includes/utf/utf_tools.php');
|
require_once(__DIR__ . '/../../phpBB/includes/utf/utf_tools.php');
|
||||||
|
|
Loading…
Add table
Reference in a new issue