aboutsummaryrefslogtreecommitdiffstats
path: root/tests/session
diff options
context:
space:
mode:
authorasperous <asperous2@gmail.com>2013-07-12 13:04:09 -0700
committerAndy Chase <asperous2@gmail.com>2013-07-22 11:07:45 -0700
commitaf3a4ee33a148c864c30d22a2031cfc7e1b7bcf3 (patch)
tree1b2c3419953b9f5b9b688c4082895954d19c815d /tests/session
parent13e4271c502152b8fa318422d808aabeb97e6c8c (diff)
downloadforums-af3a4ee33a148c864c30d22a2031cfc7e1b7bcf3.tar
forums-af3a4ee33a148c864c30d22a2031cfc7e1b7bcf3.tar.gz
forums-af3a4ee33a148c864c30d22a2031cfc7e1b7bcf3.tar.bz2
forums-af3a4ee33a148c864c30d22a2031cfc7e1b7bcf3.tar.xz
forums-af3a4ee33a148c864c30d22a2031cfc7e1b7bcf3.zip
[ticket/11620] Fixed check_ban_test errors with cache and ban warning message
PHPBB3-11620
Diffstat (limited to 'tests/session')
-rw-r--r--tests/session/check_ban_test.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/session/check_ban_test.php b/tests/session/check_ban_test.php
index 6795338f23..6ff688ee3d 100644
--- a/tests/session/check_ban_test.php
+++ b/tests/session/check_ban_test.php
@@ -38,14 +38,26 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case
// Change the global cache object for this test because
// the mock cache object does not hit the database as is
// needed for this test.
- global $cache;
- $old_cache = $cache;
- $cache = new phpbb_cache_driver_file();
+ global $cache, $config, $phpbb_root_path, $php_ext;
+ $cache = new phpbb_cache_service(
+ new phpbb_cache_driver_file(),
+ $config,
+ $this->db,
+ $phpbb_root_path,
+ $php_ext
+ );
- $is_banned =
- $session->check_ban($user_id, $user_ips, $user_email, $return);
+ try
+ {
+ $is_banned =
+ $session->check_ban($user_id, $user_ips, $user_email, $return);
+ } catch (PHPUnit_Framework_Error_Notice $e)
+ {
+ // User error was triggered, user must have been banned
+ $is_banned = true;
+ }
$this->assertEquals($should_be_banned, $is_banned, $test_msg);
- $cache = $old_cache;
+ $cache = new phpbb_mock_cache();
}
}