Fix and standardize Doxygen tags
[lhc/web/wiklou.git] / tests / phpunit / includes / MergeHistoryTest.php
index 0c1a7a8..22f6fa6 100644 (file)
@@ -8,7 +8,7 @@ class MergeHistoryTest extends MediaWikiTestCase {
        /**
         * Make some pages to work with
         */
-       public function addDBData() {
+       public function addDBDataOnce() {
                // Pages that won't actually be merged
                $this->insertPage( 'Test' );
                $this->insertPage( 'Test2' );
@@ -21,10 +21,10 @@ class MergeHistoryTest extends MediaWikiTestCase {
        /**
         * @dataProvider provideIsValidMerge
         * @covers MergeHistory::isValidMerge
-        * @param $source string Source page
-        * @param $dest string Destination page
-        * @param $timestamp string|bool Timestamp up to which revisions are merged (or false for all)
-        * @param $error string|bool Expected error for test (or true for no error)
+        * @param string $source Source page
+        * @param string $dest Destination page
+        * @param string|bool $timestamp Timestamp up to which revisions are merged (or false for all)
+        * @param string|bool $error Expected error for test (or true for no error)
         */
        public function testIsValidMerge( $source, $dest, $timestamp, $error ) {
                $this->setMwGlobals( 'wgContentHandlerUseDB', false );
@@ -42,23 +42,23 @@ class MergeHistoryTest extends MediaWikiTestCase {
        }
 
        public static function provideIsValidMerge() {
-               return array(
+               return [
                        // for MergeHistory::isValidMerge
-                       array( 'Test', 'Test2', false, true ),
+                       [ 'Test', 'Test2', false, true ],
                        // Although this timestamp is after the latest timestamp of both pages,
                        // MergeHistory should select the latest source timestamp up to this which should
                        // still work for the merge.
-                       array( 'Test', 'Test2', strtotime( 'tomorrow' ), true ),
-                       array( 'Test', 'Test', false, 'mergehistory-fail-self-merge' ),
-                       array( 'Nonexistant', 'Test2', false, 'mergehistory-fail-invalid-source' ),
-                       array( 'Test', 'Nonexistant', false, 'mergehistory-fail-invalid-dest' ),
-                       array(
+                       [ 'Test', 'Test2', strtotime( 'tomorrow' ), true ],
+                       [ 'Test', 'Test', false, 'mergehistory-fail-self-merge' ],
+                       [ 'Nonexistant', 'Test2', false, 'mergehistory-fail-invalid-source' ],
+                       [ 'Test', 'Nonexistant', false, 'mergehistory-fail-invalid-dest' ],
+                       [
                                'Test',
                                'Test2',
                                'This is obviously an invalid timestamp',
                                'mergehistory-fail-bad-timestamp'
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
@@ -69,11 +69,11 @@ class MergeHistoryTest extends MediaWikiTestCase {
                $limit = MergeHistory::REVISION_LIMIT;
 
                $mh = $this->getMockBuilder( 'MergeHistory' )
-                       ->setMethods( array( 'getRevisionCount' ) )
-                       ->setConstructorArgs( array(
+                       ->setMethods( [ 'getRevisionCount' ] )
+                       ->setConstructorArgs( [
                                Title::newFromText( 'Test' ),
                                Title::newFromText( 'Test2' ),
-                       ) )
+                       ] )
                        ->getMock();
                $mh->expects( $this->once() )
                        ->method( 'getRevisionCount' )