3 class RightsLogFormatterTest
extends LogFormatterTestCase
{
6 * Provide different rows from the logging table to test
7 * for backward compatibility.
8 * Do not change the existing data, just add a new database row
10 public static function provideRightsLogDatabaseRows() {
17 'comment' => 'rights comment',
19 'user_text' => 'Sysop',
20 'namespace' => NS_USER
,
24 '5::newgroups' => [ 'sysop', 'bureaucrat' ],
28 'text' => 'Sysop changed group membership for User from (none) to '
29 . 'administrator and bureaucrat',
32 'newgroups' => [ 'sysop', 'bureaucrat' ],
42 'comment' => 'rights comment',
44 'user_text' => 'Sysop',
45 'namespace' => NS_USER
,
54 'text' => 'Sysop changed group membership for User from (none) to '
55 . 'administrator and bureaucrat',
58 'newgroups' => [ 'sysop', 'bureaucrat' ],
68 'comment' => 'rights comment',
70 'user_text' => 'Sysop',
71 'namespace' => NS_USER
,
77 'text' => 'Sysop changed group membership for User',
85 * @dataProvider provideRightsLogDatabaseRows
87 public function testRightsLogDatabaseRows( $row, $extra ) {
88 $this->doTestLogFormatter( $row, $extra );
92 * Provide different rows from the logging table to test
93 * for backward compatibility.
94 * Do not change the existing data, just add a new database row
96 public static function provideAutopromoteLogDatabaseRows() {
102 'action' => 'autopromote',
103 'comment' => 'rights comment',
105 'user_text' => 'Sysop',
106 'namespace' => NS_USER
,
109 '4::oldgroups' => [ 'sysop' ],
110 '5::newgroups' => [ 'sysop', 'bureaucrat' ],
114 'text' => 'Sysop was automatically promoted from administrator to '
115 . 'administrator and bureaucrat',
117 'oldgroups' => [ 'sysop' ],
118 'newgroups' => [ 'sysop', 'bureaucrat' ],
127 'action' => 'autopromote',
128 'comment' => 'rights comment',
130 'user_text' => 'Sysop',
131 'namespace' => NS_USER
,
140 'text' => 'Sysop was automatically promoted from administrator to '
141 . 'administrator and bureaucrat',
143 'oldgroups' => [ 'sysop' ],
144 'newgroups' => [ 'sysop', 'bureaucrat' ],
152 * @dataProvider provideAutopromoteLogDatabaseRows
154 public function testAutopromoteLogDatabaseRows( $row, $extra ) {
155 $this->doTestLogFormatter( $row, $extra );