mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-20 23:41:29 +02:00
[ticket/9687] Use cache driver instead of service
PHPBB3-9687
This commit is contained in:
@@ -36,18 +36,6 @@ class ban_manager_test extends \phpbb_session_test_case
|
||||
$config = new \phpbb\config\config([]);
|
||||
$phpbb_dispatcher = new \phpbb_mock_event_dispatcher();
|
||||
|
||||
// Change the global cache object for this test because
|
||||
// the mock cache object does not hit the database as is needed
|
||||
// for this test.
|
||||
$cache = new \phpbb\cache\service(
|
||||
new \phpbb\cache\driver\dummy(),
|
||||
$config,
|
||||
$this->db,
|
||||
$phpbb_dispatcher,
|
||||
$phpbb_root_path,
|
||||
$phpEx
|
||||
);
|
||||
|
||||
$phpbb_container = new \phpbb_mock_container_builder();
|
||||
$ban_type_email = new \phpbb\ban\type\email($this->db, 'phpbb_bans', 'phpbb_users', 'phpbb_sessions', 'phpbb_sessions_keys');
|
||||
$ban_type_user = new \phpbb\ban\type\user($this->db, 'phpbb_bans', 'phpbb_users', 'phpbb_sessions', 'phpbb_sessions_keys');
|
||||
@@ -60,7 +48,7 @@ class ban_manager_test extends \phpbb_session_test_case
|
||||
$collection->add('ban.type.user');
|
||||
$collection->add('ban.type.ip');
|
||||
|
||||
$this->ban_manager = new \phpbb\ban\manager($collection, $cache, $this->db, $user, 'phpbb_bans', 'phpbb_users');
|
||||
$this->ban_manager = new \phpbb\ban\manager($collection, new \phpbb\cache\driver\dummy(), $this->db, $user, 'phpbb_bans', 'phpbb_users');
|
||||
$phpbb_container->set('ban.manager', $this->ban_manager);
|
||||
$this->phpbb_container = $phpbb_container;
|
||||
}
|
||||
@@ -385,19 +373,7 @@ class ban_manager_test extends \phpbb_session_test_case
|
||||
$config = new \phpbb\config\config([]);
|
||||
$phpbb_dispatcher = new \phpbb_mock_event_dispatcher();
|
||||
|
||||
// Change the global cache object for this test because
|
||||
// the mock cache object does not hit the database as is needed
|
||||
// for this test.
|
||||
$cache = new \phpbb\cache\service(
|
||||
new \phpbb\cache\driver\dummy(),
|
||||
$config,
|
||||
$this->db,
|
||||
$phpbb_dispatcher,
|
||||
$phpbb_root_path,
|
||||
$phpEx
|
||||
);
|
||||
|
||||
$ban_manager = new \phpbb\ban\manager($collection, $cache, $this->db, $user, 'phpbb_bans', 'phpbb_users');
|
||||
$ban_manager = new \phpbb\ban\manager($collection, new \phpbb\cache\driver\dummy(), $this->db, $user, 'phpbb_bans', 'phpbb_users');
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
@@ -442,19 +418,7 @@ class ban_manager_test extends \phpbb_session_test_case
|
||||
$config = new \phpbb\config\config([]);
|
||||
$phpbb_dispatcher = new \phpbb_mock_event_dispatcher();
|
||||
|
||||
// Change the global cache object for this test because
|
||||
// the mock cache object does not hit the database as is needed
|
||||
// for this test.
|
||||
$cache = new \phpbb\cache\service(
|
||||
new \phpbb\cache\driver\dummy(),
|
||||
$config,
|
||||
$this->db,
|
||||
$phpbb_dispatcher,
|
||||
$phpbb_root_path,
|
||||
$phpEx
|
||||
);
|
||||
|
||||
$ban_manager = new \phpbb\ban\manager($collection, $cache, $this->db, $user, 'phpbb_bans', 'phpbb_users');
|
||||
$ban_manager = new \phpbb\ban\manager($collection, new \phpbb\cache\driver\dummy(), $this->db, $user, 'phpbb_bans', 'phpbb_users');
|
||||
|
||||
$start_time = new \DateTime();
|
||||
$start_time->setTimestamp(1000);
|
||||
|
@@ -62,7 +62,7 @@ class phpbb_functions_validate_user_email_test extends phpbb_database_test_case
|
||||
$collection->add('ban.type.user');
|
||||
$collection->add('ban.type.ip');
|
||||
|
||||
$ban_manager = new \phpbb\ban\manager($collection, $cache, $this->db, $this->user, 'phpbb_bans', 'phpbb_users');
|
||||
$ban_manager = new \phpbb\ban\manager($collection, $cache->get_driver(), $this->db, $this->user, 'phpbb_bans', 'phpbb_users');
|
||||
$phpbb_container->set('ban.manager', $ban_manager);
|
||||
}
|
||||
|
||||
|
@@ -87,7 +87,7 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case
|
||||
$collection->add('ban.type.user');
|
||||
$collection->add('ban.type.ip');
|
||||
|
||||
$ban_manager = new \phpbb\ban\manager($collection, $cache, $this->db, $user, 'phpbb_bans', 'phpbb_users');
|
||||
$ban_manager = new \phpbb\ban\manager($collection, $cache->get_driver(), $this->db, $user, 'phpbb_bans', 'phpbb_users');
|
||||
$phpbb_container->set('ban.manager', $ban_manager);
|
||||
}
|
||||
|
||||
|
@@ -109,15 +109,6 @@ class phpbb_session_testable_factory
|
||||
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
|
||||
$cache_service = new \phpbb\cache\service(
|
||||
$cache,
|
||||
$config,
|
||||
$db,
|
||||
$phpbb_dispatcher,
|
||||
$phpbb_root_path,
|
||||
$phpEx
|
||||
);
|
||||
|
||||
$ban_type_email = new \phpbb\ban\type\email($db, 'phpbb_bans', 'phpbb_users', 'phpbb_sessions', 'phpbb_sessions_keys');
|
||||
$ban_type_user = new \phpbb\ban\type\user($db, 'phpbb_bans', 'phpbb_users', 'phpbb_sessions', 'phpbb_sessions_keys');
|
||||
$ban_type_ip = new \phpbb\ban\type\ip($db, 'phpbb_bans', 'phpbb_users', 'phpbb_sessions', 'phpbb_sessions_keys');
|
||||
@@ -130,7 +121,7 @@ class phpbb_session_testable_factory
|
||||
$collection->add('ban.type.user');
|
||||
$collection->add('ban.type.ip');
|
||||
|
||||
$ban_manager = new \phpbb\ban\manager($collection, $cache_service, $db, $user,'phpbb_bans', 'phpbb_users');
|
||||
$ban_manager = new \phpbb\ban\manager($collection, $cache, $db, $user,'phpbb_bans', 'phpbb_users');
|
||||
$phpbb_container->set('ban.manager', $ban_manager);
|
||||
|
||||
$session = new phpbb_mock_session_testable;
|
||||
|
Reference in New Issue
Block a user