Revert "Fix testsuites for LogFormatter"
[lhc/web/wiklou.git] / tests / phpunit / includes / logging / DeleteLogFormatterTest.php
index f1d58fd..6648c31 100644 (file)
@@ -409,109 +409,6 @@ class DeleteLogFormatterTest extends LogFormatterTestCase {
         * @dataProvider provideSuppressRevisionLogDatabaseRows
         */
        public function testSuppressRevisionLogDatabaseRows( $row, $extra ) {
         * @dataProvider provideSuppressRevisionLogDatabaseRows
         */
        public function testSuppressRevisionLogDatabaseRows( $row, $extra ) {
-               $this->setMwGlobals(
-                       'wgGroupPermissions',
-                       [
-                               'oversight' => [
-                                       'viewsuppressed' => true,
-                                       'suppressionlog' => true,
-                               ],
-                       ]
-               );
-               $this->doTestLogFormatter( $row, $extra, [ 'oversight' ] );
-       }
-
-       /**
-        * Provide different rows from the logging table to test
-        * for backward compatibility.
-        * Do not change the existing data, just add a new database row
-        */
-       public static function provideSuppressRevisionLogDatabaseRowsNonPrivileged() {
-               return [
-                       // Current format
-                       [
-                               [
-                                       'type' => 'suppress',
-                                       'action' => 'revision',
-                                       'comment' => 'Suppress comment',
-                                       'namespace' => NS_MAIN,
-                                       'title' => 'Page',
-                                       'params' => [
-                                               '4::type' => 'archive',
-                                               '5::ids' => [ '1', '3', '4' ],
-                                               '6::ofield' => '1',
-                                               '7::nfield' => '10',
-                                       ],
-                               ],
-                               [
-                                       'text' => '(username removed) (log details removed)',
-                                       'api' => [
-                                               'type' => 'archive',
-                                               'ids' => [ '1', '3', '4' ],
-                                               'old' => [
-                                                       'bitmask' => 1,
-                                                       'content' => true,
-                                                       'comment' => false,
-                                                       'user' => false,
-                                                       'restricted' => false,
-                                               ],
-                                               'new' => [
-                                                       'bitmask' => 10,
-                                                       'content' => false,
-                                                       'comment' => true,
-                                                       'user' => false,
-                                                       'restricted' => true,
-                                               ],
-                                       ],
-                               ],
-                       ],
-
-                       // Legacy format
-                       [
-                               [
-                                       'type' => 'suppress',
-                                       'action' => 'revision',
-                                       'comment' => 'Suppress comment',
-                                       'namespace' => NS_MAIN,
-                                       'title' => 'Page',
-                                       'params' => [
-                                               'archive',
-                                               '1,3,4',
-                                               'ofield=1',
-                                               'nfield=10',
-                                       ],
-                               ],
-                               [
-                                       'legacy' => true,
-                                       'text' => '(username removed) (log details removed)',
-                                       'api' => [
-                                               'type' => 'archive',
-                                               'ids' => [ '1', '3', '4' ],
-                                               'old' => [
-                                                       'bitmask' => 1,
-                                                       'content' => true,
-                                                       'comment' => false,
-                                                       'user' => false,
-                                                       'restricted' => false,
-                                               ],
-                                               'new' => [
-                                                       'bitmask' => 10,
-                                                       'content' => false,
-                                                       'comment' => true,
-                                                       'user' => false,
-                                                       'restricted' => true,
-                                               ],
-                                       ],
-                               ],
-                       ],
-               ];
-       }
-
-       /**
-        * @dataProvider provideSuppressRevisionLogDatabaseRowsNonPrivileged
-        */
-       public function testSuppressRevisionLogDatabaseRowsNonPrivileged( $row, $extra ) {
-               $this->user = $this->getTestUser()->getUser();
                $this->doTestLogFormatter( $row, $extra );
        }
 
                $this->doTestLogFormatter( $row, $extra );
        }
 
@@ -626,107 +523,6 @@ class DeleteLogFormatterTest extends LogFormatterTestCase {
         * @dataProvider provideSuppressEventLogDatabaseRows
         */
        public function testSuppressEventLogDatabaseRows( $row, $extra ) {
         * @dataProvider provideSuppressEventLogDatabaseRows
         */
        public function testSuppressEventLogDatabaseRows( $row, $extra ) {
-               $this->setMwGlobals(
-                       'wgGroupPermissions',
-                       [
-                               'oversight' => [
-                                       'viewsuppressed' => true,
-                                       'suppressionlog' => true,
-                               ],
-                       ]
-               );
-               $this->doTestLogFormatter( $row, $extra, [ 'oversight' ] );
-       }
-
-       /**
-        * Provide different rows from the logging table to test
-        * for backward compatibility.
-        * Do not change the existing data, just add a new database row
-        */
-       public static function provideSuppressEventLogDatabaseRowsNonPrivileged() {
-               return [
-                       // Current format
-                       [
-                               [
-                                       'type' => 'suppress',
-                                       'action' => 'event',
-                                       'comment' => 'Suppress comment',
-                                       'namespace' => NS_MAIN,
-                                       'title' => 'Page',
-                                       'params' => [
-                                               '4::ids' => [ '1', '3', '4' ],
-                                               '5::ofield' => '1',
-                                               '6::nfield' => '10',
-                                       ],
-                               ],
-                               [
-                                       'text' => '(username removed) (log details removed)',
-                                       'api' => [
-                                               'type' => 'logging',
-                                               'ids' => [ '1', '3', '4' ],
-                                               'old' => [
-                                                       'bitmask' => 1,
-                                                       'content' => true,
-                                                       'comment' => false,
-                                                       'user' => false,
-                                                       'restricted' => false,
-                                               ],
-                                               'new' => [
-                                                       'bitmask' => 10,
-                                                       'content' => false,
-                                                       'comment' => true,
-                                                       'user' => false,
-                                                       'restricted' => true,
-                                               ],
-                                       ],
-                               ],
-                       ],
-
-                       // Legacy format
-                       [
-                               [
-                                       'type' => 'suppress',
-                                       'action' => 'event',
-                                       'comment' => 'Suppress comment',
-                                       'namespace' => NS_MAIN,
-                                       'title' => 'Page',
-                                       'params' => [
-                                               '1,3,4',
-                                               'ofield=1',
-                                               'nfield=10',
-                                       ],
-                               ],
-                               [
-                                       'legacy' => true,
-                                       'text' => '(username removed) (log details removed)',
-                                       'api' => [
-                                               'type' => 'logging',
-                                               'ids' => [ '1', '3', '4' ],
-                                               'old' => [
-                                                       'bitmask' => 1,
-                                                       'content' => true,
-                                                       'comment' => false,
-                                                       'user' => false,
-                                                       'restricted' => false,
-                                               ],
-                                               'new' => [
-                                                       'bitmask' => 10,
-                                                       'content' => false,
-                                                       'comment' => true,
-                                                       'user' => false,
-                                                       'restricted' => true,
-                                               ],
-                                       ],
-                               ],
-                       ],
-               ];
-       }
-
-       /**
-        * @dataProvider provideSuppressEventLogDatabaseRowsNonPrivileged
-        */
-       public function testSuppressEventLogDatabaseRowsNonPrivileged( $row, $extra ) {
-               $this->user = $this->getTestUser()->getUser();
                $this->doTestLogFormatter( $row, $extra );
        }
 
                $this->doTestLogFormatter( $row, $extra );
        }
 
@@ -776,65 +572,6 @@ class DeleteLogFormatterTest extends LogFormatterTestCase {
         * @dataProvider provideSuppressDeleteLogDatabaseRows
         */
        public function testSuppressDeleteLogDatabaseRows( $row, $extra ) {
         * @dataProvider provideSuppressDeleteLogDatabaseRows
         */
        public function testSuppressDeleteLogDatabaseRows( $row, $extra ) {
-               $this->setMwGlobals(
-                       'wgGroupPermissions',
-                       [
-                               'oversight' => [
-                                       'viewsuppressed' => true,
-                                       'suppressionlog' => true,
-                               ],
-                       ]
-               );
-               $this->doTestLogFormatter( $row, $extra, [ 'oversight' ] );
-       }
-
-       /**
-        * Provide different rows from the logging table to test
-        * for backward compatibility.
-        * Do not change the existing data, just add a new database row
-        */
-       public static function provideSuppressDeleteLogDatabaseRowsNonPrivileged() {
-               return [
-                       // Current format
-                       [
-                               [
-                                       'type' => 'suppress',
-                                       'action' => 'delete',
-                                       'comment' => 'delete comment',
-                                       'namespace' => NS_MAIN,
-                                       'title' => 'Page',
-                                       'params' => [],
-                               ],
-                               [
-                                       'text' => '(username removed) (log details removed)',
-                                       'api' => [],
-                               ],
-                       ],
-
-                       // Legacy format
-                       [
-                               [
-                                       'type' => 'suppress',
-                                       'action' => 'delete',
-                                       'comment' => 'delete comment',
-                                       'namespace' => NS_MAIN,
-                                       'title' => 'Page',
-                                       'params' => [],
-                               ],
-                               [
-                                       'legacy' => true,
-                                       'text' => '(username removed) (log details removed)',
-                                       'api' => [],
-                               ],
-                       ],
-               ];
-       }
-
-       /**
-        * @dataProvider provideSuppressDeleteLogDatabaseRowsNonPrivileged
-        */
-       public function testSuppressDeleteLogDatabaseRowsNonPrivileged( $row, $extra ) {
-               $this->user = $this->getTestUser()->getUser();
                $this->doTestLogFormatter( $row, $extra );
        }
 }
                $this->doTestLogFormatter( $row, $extra );
        }
 }