aboutsummaryrefslogtreecommitdiffstats
path: root/tests/log
diff options
context:
space:
mode:
authorNicofuma <github@nicofuma.fr>2014-04-26 00:42:24 +0200
committerNicofuma <github@nicofuma.fr>2014-04-26 00:42:24 +0200
commit3d1569d38594cb06a9d8a9baa3f64a37ac8c9b43 (patch)
tree8841fb5f9002af931ae2510dfcdc1c2a4744194a /tests/log
parent2991918bac1656bbc97dd7b1b2b335af24c11d18 (diff)
downloadforums-3d1569d38594cb06a9d8a9baa3f64a37ac8c9b43.tar
forums-3d1569d38594cb06a9d8a9baa3f64a37ac8c9b43.tar.gz
forums-3d1569d38594cb06a9d8a9baa3f64a37ac8c9b43.tar.bz2
forums-3d1569d38594cb06a9d8a9baa3f64a37ac8c9b43.tar.xz
forums-3d1569d38594cb06a9d8a9baa3f64a37ac8c9b43.zip
[ticket/12444] Adding regression test
PHPBB3-12444
Diffstat (limited to 'tests/log')
-rw-r--r--tests/log/fixtures/full_log.xml36
-rw-r--r--tests/log/function_view_log_test.php27
2 files changed, 51 insertions, 12 deletions
diff --git a/tests/log/fixtures/full_log.xml b/tests/log/fixtures/full_log.xml
index 4e5538d5a9..4e59dc93f6 100644
--- a/tests/log/fixtures/full_log.xml
+++ b/tests/log/fixtures/full_log.xml
@@ -83,18 +83,18 @@
<value>LOG_MOD</value>
<value></value>
</row>
- <row>
- <value>7</value>
- <value>1</value>
- <value>1</value>
- <value>12</value>
- <value>45</value>
- <value>0</value>
- <value>127.0.0.1</value>
- <value>1</value>
- <value>LOG_MOD2</value>
- <value></value>
- </row>
+ <row>
+ <value>7</value>
+ <value>1</value>
+ <value>1</value>
+ <value>12</value>
+ <value>45</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD2</value>
+ <value></value>
+ </row>
<row>
<value>8</value>
<value>3</value>
@@ -131,6 +131,18 @@
<value>LOG_SINGULAR_PLURAL</value>
<value>a:1:{i:0;i:2;}</value>
</row>
+ <row>
+ <value>11</value>
+ <value>1</value>
+ <value>1</value>
+ <value>15</value>
+ <value>3</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD3</value>
+ <value>a:1:{i:0;s:5:"guest";}</value>
+ </row>
</table>
<table name="phpbb_users">
<column>user_id</column>
diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php
index 2f64459062..542d0adf9d 100644
--- a/tests/log/function_view_log_test.php
+++ b/tests/log/function_view_log_test.php
@@ -225,6 +225,27 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'viewforum' => '',
'action' => 'LOG_SINGULAR_PLURAL 2',
),
+ 11 => array(
+ 'id' => 11,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => 'Anonymous',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 15,
+ 'topic_id' => 3,
+
+ 'viewforum' => '',
+ 'action' => 'LOG_MOD3 guest ',
+ 'viewtopic' => '',
+ 'viewlogs' => '',
+ ),
);
$test_cases = array(
@@ -310,6 +331,11 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'expected_returned' => 0,
'user', false, 5, 0, 0, 0, 0, 0, 'l.log_id ASC', 'plural',
),
+ array(
+ 'expected' => array(11),
+ 'expected_returned' => 0,
+ 'mod', 0, 5, 0, 15, 3,
+ ),
);
foreach ($test_cases as $case => $case_data)
@@ -362,6 +388,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'LOG_INSTALL_INSTALLED' => 'installed: %s',
'LOG_USER' => 'User<br /> %s',
'LOG_MOD2' => 'Mod2',
+ 'LOG_MOD3' => 'Mod3: %1$s, %2$s',
'LOG_SINGULAR_PLURAL' => array(
1 => 'singular',
2 => 'plural (%d)',