aboutsummaryrefslogtreecommitdiffstats
path: root/tests/log
diff options
context:
space:
mode:
Diffstat (limited to 'tests/log')
-rw-r--r--tests/log/add_test.php4
-rw-r--r--tests/log/delete_test.php6
-rw-r--r--tests/log/function_add_log_test.php4
-rw-r--r--tests/log/function_view_log_test.php6
4 files changed, 11 insertions, 9 deletions
diff --git a/tests/log/add_test.php b/tests/log/add_test.php
index 604c8364dc..469d4ebd69 100644
--- a/tests/log/add_test.php
+++ b/tests/log/add_test.php
@@ -28,7 +28,7 @@ class phpbb_log_add_test extends phpbb_database_test_case
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
$lang = new \phpbb\language\language($lang_loader);
$user = new \phpbb\user($lang, '\phpbb\datetime');
- $auth = $this->getMock('\phpbb\auth\auth');
+ $auth = $this->createMock('\phpbb\auth\auth');
$log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
@@ -59,7 +59,7 @@ class phpbb_log_add_test extends phpbb_database_test_case
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
$lang = new \phpbb\language\language($lang_loader);
$user = new \phpbb\user($lang, '\phpbb\datetime');
- $auth = $this->getMock('\phpbb\auth\auth');
+ $auth = $this->createMock('\phpbb\auth\auth');
$log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
diff --git a/tests/log/delete_test.php b/tests/log/delete_test.php
index e8b75d01d9..fd8a2cb3df 100644
--- a/tests/log/delete_test.php
+++ b/tests/log/delete_test.php
@@ -20,9 +20,9 @@ class phpbb_log_delete_test extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/delete_log.xml');
}
- protected function setUp()
+ protected function setUp(): void
{
- global $phpbb_root_path, $phpEx, $db, $phpbb_dispatcher, $auth;
+ global $phpbb_root_path, $phpEx, $db, $phpbb_dispatcher, $auth, $user;
$db = $this->new_dbal();
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
@@ -30,7 +30,7 @@ class phpbb_log_delete_test extends phpbb_database_test_case
$lang = new \phpbb\language\language($lang_loader);
$user = new \phpbb\user($lang, '\phpbb\datetime');
$user->data['user_id'] = 1;
- $auth = $this->getMock('\phpbb\auth\auth');
+ $auth = $this->createMock('\phpbb\auth\auth');
$this->log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
diff --git a/tests/log/function_add_log_test.php b/tests/log/function_add_log_test.php
index 3b5537fc13..c3f1a0beba 100644
--- a/tests/log/function_add_log_test.php
+++ b/tests/log/function_add_log_test.php
@@ -159,11 +159,11 @@ class phpbb_log_function_add_log_test extends phpbb_database_test_case
$db = $this->new_dbal();
$cache = new phpbb_mock_cache;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
- $user = $this->getMock('\phpbb\user', array(), array(
+ $user = $this->createMock('\phpbb\user', array(), array(
new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
'\phpbb\datetime'
));
- $auth = $this->getMock('\phpbb\auth\auth');
+ $auth = $this->createMock('\phpbb\auth\auth');
$phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php
index ee9c3e5893..edab371769 100644
--- a/tests/log/function_view_log_test.php
+++ b/tests/log/function_view_log_test.php
@@ -274,7 +274,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
// Offset that will be returned from the function
'expected_returned' => 0,
// view_log parameters (see includes/functions_admin.php for docblock)
- // $log is ommited!
+ // $log is omitted!
'mod', 5, 0, 12, 45,
),
*/
@@ -378,7 +378,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
// Create auth mock
- $auth = $this->getMock('\phpbb\auth\auth');
+ $auth = $this->createMock('\phpbb\auth\auth');
$acl_get_map = array(
array('f_read', 23, true),
array('m_', 23, true),
@@ -411,6 +411,8 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
2 => 'plural (%d)',
),
);
+ $user->session_id = false;
+ $user->data['user_id'] = 10;
$phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);