diff options
author | Igor Wiedler <igor@wiedler.ch> | 2013-01-02 21:44:22 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2013-01-02 21:44:25 +0100 |
commit | 0483971f7786b10c3359dfbe4912501de0d6c7de (patch) | |
tree | 4d9377436c29a2b272505f7d9039d7110a48054d /tests | |
parent | c8c6eb46ec6eefe0e58aebcd44f4c69f5df4b065 (diff) | |
download | forums-0483971f7786b10c3359dfbe4912501de0d6c7de.tar forums-0483971f7786b10c3359dfbe4912501de0d6c7de.tar.gz forums-0483971f7786b10c3359dfbe4912501de0d6c7de.tar.bz2 forums-0483971f7786b10c3359dfbe4912501de0d6c7de.tar.xz forums-0483971f7786b10c3359dfbe4912501de0d6c7de.zip |
[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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 59979e035d..e346223a4b 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -262,7 +262,7 @@ class phpbb_functional_test_case extends phpbb_test_case $config['rand_seed_last_update'] = time() + 600; // Required by user_add - global $db, $cache, $phpbb_dispatcher; + global $db, $cache, $phpbb_dispatcher, $phpbb_container; $db = $this->get_db(); 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_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')) { require_once(__DIR__ . '/../../phpBB/includes/utf/utf_tools.php'); |