diff options
Diffstat (limited to 'tests/log')
-rw-r--r-- | tests/log/add_test.php | 10 | ||||
-rw-r--r-- | tests/log/delete_test.php | 8 | ||||
-rw-r--r-- | tests/log/fixtures/delete_log.xml | 16 | ||||
-rw-r--r-- | tests/log/fixtures/empty_log.xml | 1 | ||||
-rw-r--r-- | tests/log/fixtures/full_log.xml | 12 | ||||
-rw-r--r-- | tests/log/function_add_log_test.php | 7 | ||||
-rw-r--r-- | tests/log/function_view_log_test.php | 19 |
7 files changed, 58 insertions, 15 deletions
diff --git a/tests/log/add_test.php b/tests/log/add_test.php index 29d3adaeb6..604c8364dc 100644 --- a/tests/log/add_test.php +++ b/tests/log/add_test.php @@ -11,8 +11,6 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; - class phpbb_log_add_test extends phpbb_database_test_case { public function getDataSet() @@ -27,7 +25,9 @@ class phpbb_log_add_test extends phpbb_database_test_case $db = $this->new_dbal(); $cache = new phpbb_mock_cache; $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $user = new \phpbb\user('\phpbb\datetime'); + $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'); $log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE); @@ -56,7 +56,9 @@ class phpbb_log_add_test extends phpbb_database_test_case $db = $this->new_dbal(); $cache = new phpbb_mock_cache; $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $user = new \phpbb\user('\phpbb\datetime'); + $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'); $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 ec43182a0c..e8b75d01d9 100644 --- a/tests/log/delete_test.php +++ b/tests/log/delete_test.php @@ -11,10 +11,6 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; -require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php'; -require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php'; - class phpbb_log_delete_test extends phpbb_database_test_case { protected $log; @@ -30,7 +26,9 @@ class phpbb_log_delete_test extends phpbb_database_test_case $db = $this->new_dbal(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $user = new \phpbb\user('\phpbb\datetime'); + $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'); $user->data['user_id'] = 1; $auth = $this->getMock('\phpbb\auth\auth'); diff --git a/tests/log/fixtures/delete_log.xml b/tests/log/fixtures/delete_log.xml index 4b2402102e..393c686f0c 100644 --- a/tests/log/fixtures/delete_log.xml +++ b/tests/log/fixtures/delete_log.xml @@ -6,6 +6,7 @@ <column>user_id</column> <column>forum_id</column> <column>topic_id</column> + <column>post_id</column> <column>reportee_id</column> <column>log_ip</column> <column>log_time</column> @@ -18,6 +19,7 @@ <value>0</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_INSTALL_INSTALLED</value> @@ -30,6 +32,7 @@ <value>0</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_KEY_NOT_EXISTS</value> @@ -42,6 +45,7 @@ <value>0</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_CRITICAL</value> @@ -54,6 +58,7 @@ <value>12</value> <value>34</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_MOD</value> @@ -66,6 +71,7 @@ <value>12</value> <value>45</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_MOD</value> @@ -78,6 +84,7 @@ <value>23</value> <value>56</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_MOD</value> @@ -90,6 +97,7 @@ <value>12</value> <value>45</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_MOD2</value> @@ -101,6 +109,7 @@ <value>1</value> <value>0</value> <value>0</value> + <value>0</value> <value>2</value> <value>127.0.0.1</value> <value>1</value> @@ -113,6 +122,7 @@ <value>1</value> <value>0</value> <value>0</value> + <value>0</value> <value>1</value> <value>127.0.0.1</value> <value>1</value> @@ -126,6 +136,7 @@ <value>0</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_SINGULAR_PLURAL</value> @@ -138,6 +149,7 @@ <value>15</value> <value>3</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_MOD3</value> @@ -150,6 +162,7 @@ <value>13</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value></value> @@ -162,6 +175,7 @@ <value>14</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value></value> @@ -174,6 +188,7 @@ <value>0</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value></value> @@ -186,6 +201,7 @@ <value>0</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value></value> diff --git a/tests/log/fixtures/empty_log.xml b/tests/log/fixtures/empty_log.xml index 261b6a622a..47fd639b17 100644 --- a/tests/log/fixtures/empty_log.xml +++ b/tests/log/fixtures/empty_log.xml @@ -6,6 +6,7 @@ <column>user_id</column> <column>forum_id</column> <column>topic_id</column> + <column>post_id</column> <column>reportee_id</column> <column>log_ip</column> <column>log_time</column> diff --git a/tests/log/fixtures/full_log.xml b/tests/log/fixtures/full_log.xml index ef35884444..5b9ded9ffb 100644 --- a/tests/log/fixtures/full_log.xml +++ b/tests/log/fixtures/full_log.xml @@ -6,6 +6,7 @@ <column>user_id</column> <column>forum_id</column> <column>topic_id</column> + <column>post_id</column> <column>reportee_id</column> <column>log_ip</column> <column>log_time</column> @@ -18,6 +19,7 @@ <value>0</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_INSTALL_INSTALLED</value> @@ -30,6 +32,7 @@ <value>0</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_KEY_NOT_EXISTS</value> @@ -42,6 +45,7 @@ <value>0</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_CRITICAL</value> @@ -54,6 +58,7 @@ <value>12</value> <value>34</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_MOD</value> @@ -66,6 +71,7 @@ <value>12</value> <value>45</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_MOD</value> @@ -78,6 +84,7 @@ <value>23</value> <value>56</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_MOD</value> @@ -90,6 +97,7 @@ <value>12</value> <value>45</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_MOD2</value> @@ -101,6 +109,7 @@ <value>1</value> <value>0</value> <value>0</value> + <value>0</value> <value>2</value> <value>127.0.0.1</value> <value>1</value> @@ -113,6 +122,7 @@ <value>1</value> <value>0</value> <value>0</value> + <value>0</value> <value>1</value> <value>127.0.0.1</value> <value>1</value> @@ -126,6 +136,7 @@ <value>0</value> <value>0</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_SINGULAR_PLURAL</value> @@ -138,6 +149,7 @@ <value>15</value> <value>3</value> <value>0</value> + <value>0</value> <value>127.0.0.1</value> <value>1</value> <value>LOG_MOD3</value> diff --git a/tests/log/function_add_log_test.php b/tests/log/function_add_log_test.php index 63e468498e..3b5537fc13 100644 --- a/tests/log/function_add_log_test.php +++ b/tests/log/function_add_log_test.php @@ -11,8 +11,6 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; - class phpbb_log_function_add_log_test extends phpbb_database_test_case { public function getDataSet() @@ -161,7 +159,10 @@ 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('\phpbb\datetime')); + $user = $this->getMock('\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'); $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 02e0b3912f..ee9c3e5893 100644 --- a/tests/log/function_view_log_test.php +++ b/tests/log/function_view_log_test.php @@ -11,10 +11,7 @@ * */ -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__) . '/../mock/user.php'; require_once dirname(__FILE__) . '/../mock/cache.php'; @@ -46,6 +43,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 0, 'topic_id' => 0, + 'post_id' => 0, 'viewforum' => '', 'action' => 'LOG_INSTALL_INSTALLED 3.1.0-dev', @@ -65,6 +63,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 0, 'topic_id' => 0, + 'post_id' => 0, 'viewforum' => '', 'action' => '{LOG KEY NOT EXISTS}<br />additional_data', @@ -84,6 +83,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 0, 'topic_id' => 0, + 'post_id' => 0, 'viewforum' => '', 'action' => '{LOG CRITICAL}<br />critical data', @@ -103,10 +103,12 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 12, 'topic_id' => 34, + 'post_id' => 0, 'viewforum' => '', 'action' => '{LOG MOD}', 'viewtopic' => '', + 'viewpost' => '', 'viewlogs' => '', ), 5 => array( @@ -124,10 +126,12 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 12, 'topic_id' => 45, + 'post_id' => 0, 'viewforum' => '', 'action' => '{LOG MOD}', 'viewtopic' => '', + 'viewpost' => '', 'viewlogs' => '', ), 6 => array( @@ -145,10 +149,12 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 23, 'topic_id' => 56, + 'post_id' => 0, 'viewforum' => append_sid("phpBB/viewforum.$phpEx", 'f=23'), 'action' => '{LOG MOD}', 'viewtopic' => append_sid("phpBB/viewtopic.$phpEx", 'f=23&t=56'), + 'viewpost' => '', 'viewlogs' => append_sid("phpBB/mcp.$phpEx", 'i=logs&mode=topic_logs&t=56'), ), 7 => array( @@ -166,10 +172,12 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 12, 'topic_id' => 45, + 'post_id' => 0, 'viewforum' => '', 'action' => 'LOG_MOD2', 'viewtopic' => '', + 'viewpost' => '', 'viewlogs' => '', ), 8 => array( @@ -187,6 +195,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 0, 'topic_id' => 0, + 'post_id' => 0, 'viewforum' => '', 'action' => 'LOG_USER admin', @@ -206,6 +215,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 0, 'topic_id' => 0, + 'post_id' => 0, 'viewforum' => '', 'action' => 'LOG_USER guest', @@ -225,6 +235,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 0, 'topic_id' => 0, + 'post_id' => 0, 'viewforum' => '', 'action' => 'LOG_SINGULAR_PLURAL 2', @@ -244,10 +255,12 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case 'time' => 1, 'forum_id' => 15, 'topic_id' => 3, + 'post_id' => 0, 'viewforum' => '', 'action' => 'LOG_MOD3 guest ', 'viewtopic' => '', + 'viewpost' => '', 'viewlogs' => '', ), ); |