Support the creation of special pages with services injected
[lhc/web/wiklou.git] / tests / phpunit / includes / MergeHistoryTest.php
index 54db581..f546dc2 100644 (file)
@@ -27,7 +27,12 @@ class MergeHistoryTest extends MediaWikiTestCase {
         * @param string|bool $error Expected error for test (or true for no error)
         */
        public function testIsValidMerge( $source, $dest, $timestamp, $error ) {
-               $this->setMwGlobals( 'wgContentHandlerUseDB', false );
+               if ( $timestamp === 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.
+                       $timestamp = time() + ( 24 * 3600 );
+               }
                $mh = new MergeHistory(
                        Title::newFromText( $source ),
                        Title::newFromText( $dest ),
@@ -45,10 +50,8 @@ class MergeHistoryTest extends MediaWikiTestCase {
                return [
                        // for MergeHistory::isValidMerge
                        [ '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.
-                       [ 'Test', 'Test2', strtotime( 'tomorrow' ), true ],
+                       // Timestamp of `true` is a placeholder for "in the future""
+                       [ 'Test', 'Test2', true, true ],
                        [ 'Test', 'Test', false, 'mergehistory-fail-self-merge' ],
                        [ 'Nonexistant', 'Test2', false, 'mergehistory-fail-invalid-source' ],
                        [ 'Test', 'Nonexistant', false, 'mergehistory-fail-invalid-dest' ],