mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/10714] Fix unit test because of events and moved files
PHPBB3-10714
This commit is contained in:
parent
2afbec5ac4
commit
d828ef93f2
3 changed files with 8 additions and 6 deletions
|
@ -38,9 +38,10 @@ class phpbb_log_add_test extends phpbb_database_test_case
|
|||
|
||||
public function test_log_add()
|
||||
{
|
||||
global $db;
|
||||
global $db, $phpbb_dispatcher;
|
||||
|
||||
$db = $this->new_dbal();
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
|
||||
$mode = 'critical';
|
||||
$user_id = ANONYMOUS;
|
||||
|
|
|
@ -142,7 +142,7 @@ class phpbb_log_function_add_log_test extends phpbb_database_test_case
|
|||
*/
|
||||
public function test_add_log_function($expected, $user_id, $mode, $required1, $additional1 = null, $additional2 = null, $additional3 = null)
|
||||
{
|
||||
global $db, $user;
|
||||
global $db, $user, $phpbb_dispatcher;
|
||||
|
||||
if ($expected)
|
||||
{
|
||||
|
@ -155,6 +155,7 @@ class phpbb_log_function_add_log_test extends phpbb_database_test_case
|
|||
}
|
||||
|
||||
$db = $this->new_dbal();
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
|
||||
$user->ip = 'user_ip';
|
||||
if ($user_id)
|
||||
|
|
|
@ -7,13 +7,12 @@
|
|||
*
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/auth.php';
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
|
||||
require_once dirname(__FILE__) . '/../../phpBB/includes/session.php';
|
||||
require_once dirname(__FILE__) . '/../mock_user.php';
|
||||
require_once dirname(__FILE__) . '/../mock/user.php';
|
||||
require_once dirname(__FILE__) . '/../mock/cache.php';
|
||||
|
||||
class phpbb_log_function_view_log_test extends phpbb_database_test_case
|
||||
|
@ -300,13 +299,14 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
|
|||
*/
|
||||
public function test_view_log_function($expected, $expected_returned, $mode, $log_count, $limit = 5, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_id ASC', $keywords = '')
|
||||
{
|
||||
global $cache, $db, $user, $auth;
|
||||
global $cache, $db, $user, $auth, $phpbb_dispatcher;
|
||||
|
||||
$db = $this->new_dbal();
|
||||
$cache = new phpbb_mock_cache;
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
|
||||
// Create auth mock
|
||||
$auth = $this->getMock('auth');
|
||||
$auth = $this->getMock('phpbb_auth');
|
||||
$acl_get_map = array(
|
||||
array('f_read', 23, true),
|
||||
array('m_', 23, true),
|
||||
|
|
Loading…
Add table
Reference in a new issue