aboutsummaryrefslogtreecommitdiffstats
path: root/tests/log
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-03-24 17:02:56 +0100
committerJoas Schilling <nickvergessen@gmx.de>2012-08-21 12:12:39 +0200
commit1e00c697b766d1a8695c8e058334efe1dd3dbb7e (patch)
tree8e25fd52f5cf0cc7de00464ede1f8104d133cc8b /tests/log
parent325827c40f778ef7efd3c195706cb0b1fb28805b (diff)
downloadforums-1e00c697b766d1a8695c8e058334efe1dd3dbb7e.tar
forums-1e00c697b766d1a8695c8e058334efe1dd3dbb7e.tar.gz
forums-1e00c697b766d1a8695c8e058334efe1dd3dbb7e.tar.bz2
forums-1e00c697b766d1a8695c8e058334efe1dd3dbb7e.tar.xz
forums-1e00c697b766d1a8695c8e058334efe1dd3dbb7e.zip
[ticket/10714] Add docblock for the test cases
PHPBB3-10714
Diffstat (limited to 'tests/log')
-rw-r--r--tests/log/function_add_log_test.php29
-rw-r--r--tests/log/function_view_log_test.php50
2 files changed, 54 insertions, 25 deletions
diff --git a/tests/log/function_add_log_test.php b/tests/log/function_add_log_test.php
index 1f54f66d2d..e7b3c4335f 100644
--- a/tests/log/function_add_log_test.php
+++ b/tests/log/function_add_log_test.php
@@ -19,6 +19,35 @@ class phpbb_log_function_add_log_test extends phpbb_database_test_case
public static function test_add_log_function_data()
{
return array(
+ /**
+ * Case documentation
+ array(
+ // Row that is in the database afterwards
+ array(
+ 'user_id' => ANONYMOUS,
+ 'log_type' => LOG_MOD,
+ 'log_operation' => 'LOG_MOD_ADDITIONAL',
+ // log_data will be serialized
+ 'log_data' => array(
+ 'argument3',
+ ),
+ 'reportee_id' => 0,
+ 'forum_id' => 56,
+ 'topic_id' => 78,
+ ),
+ // user_id Can also be false, than ANONYMOUS is used
+ false,
+ // log_mode Used to determinate the log_type
+ 'mod',
+ // Followed by some additional arguments
+ // forum_id, topic_id and reportee_id are specified before log_operation
+ // The rest is specified afterwards.
+ 56,
+ 78,
+ 'LOG_MOD_ADDITIONAL', // log_operation
+ 'argument3',
+ ),
+ */
array(
array(
'user_id' => 2,
diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php
index 7c44413330..78bc2843a8 100644
--- a/tests/log/function_view_log_test.php
+++ b/tests/log/function_view_log_test.php
@@ -210,77 +210,77 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
);
$test_cases = array(
+ /**
+ * Case documentation
+ array(
+ // Array of datasets that should be in $log after running the function
+ 'expected' => array(5, 7),
+ // Offset that will be returned form the function
+ 'expected_returned' => 0,
+ // view_log parameters (see includes/functions_admin.php for docblock)
+ // $log is ommited!
+ 'mod', 5, 0, 12, 45,
+ ),
+ */
array(
'expected' => array(1, 2),
'expected_returned' => 0,
- false,
- 'admin',
+ 'admin', false,
),
array(
'expected' => array(1),
'expected_returned' => 0,
- false,
- 'admin', 1,
+ 'admin', false, 1,
),
array(
'expected' => array(2),
'expected_returned' => 1,
- false,
- 'admin', 1, 1,
+ 'admin', false, 1, 1,
),
array(
'expected' => array(2),
'expected_returned' => 1,
- 0,
- 'admin', 1, 1,
+ 'admin', 0, 1, 1,
),
array(
'expected' => array(2),
'expected_returned' => 1,
- 0,
- 'admin', 1, 5,
+ 'admin', 0, 1, 5,
),
array(
'expected' => array(3),
'expected_returned' => 0,
- false,
- 'critical',
+ 'critical', false,
),
array(
'expected' => array(),
'expected_returned' => null,
- false,
- 'mode_does_not_exist',
+ 'mode_does_not_exist', false,
),
array(
'expected' => array(4, 5, 7),
'expected_returned' => 0,
- 0,
- 'mod', 5, 0, 12,
+ 'mod', 0, 5, 0, 12,
),
array(
'expected' => array(5, 7),
'expected_returned' => 0,
- 0,
- 'mod', 5, 0, 12, 45,
+ 'mod', 0, 5, 0, 12, 45,
),
array(
'expected' => array(6),
'expected_returned' => 0,
- 0,
- 'mod', 5, 0, 23,
+ 'mod', 0, 5, 0, 23,
),
array(
'expected' => array(8),
'expected_returned' => 0,
- 0,
- 'user', 5, 0, 0, 0, 2,
+ 'user', 0, 5, 0, 0, 0, 2,
),
array(
'expected' => array(8, 9),
'expected_returned' => 0,
- 0,
- 'users',
+ 'users', 0,
),
);
@@ -298,7 +298,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
/**
* @dataProvider test_view_log_function_data
*/
- public function test_view_log_function($expected, $expected_returned, $log_count, $mode, $limit = 5, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_id ASC', $keywords = '')
+ 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;