Merge "Add type hint to ThumbnailRenderJob::hitThumbUrl"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 19 May 2017 19:40:45 +0000 (19:40 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 19 May 2017 19:40:46 +0000 (19:40 +0000)
maintenance/refreshLinks.php
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/PrefixSearchTest.php

index a6cd548..9f3552a 100644 (file)
@@ -278,6 +278,7 @@ class RefreshLinks extends Maintenance {
                        $page->getTitle(), /* $old = */ null, /* $recursive = */ false );
                foreach ( $updates as $update ) {
                        DeferredUpdates::addUpdate( $update );
+                       DeferredUpdates::doUpdates();
                }
        }
 
index bc9f97c..1114f2a 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+use Closure;
 use MediaWiki\Logger\LegacySpi;
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\Logger\MonologSpi;
@@ -737,6 +738,11 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                                        $GLOBALS[$globalKey] instanceof FauxRequest
                                ) {
                                        $this->mwGlobals[$globalKey] = clone $GLOBALS[$globalKey];
+                               } elseif ( $GLOBALS[$globalKey] instanceof Closure ) {
+                                       // Serializing Closure only gives a warning on HHVM while
+                                       // it throws an Exception on Zend.
+                                       // Workaround for https://github.com/facebook/hhvm/issues/6206
+                                       $this->mwGlobals[$globalKey] = $GLOBALS[$globalKey];
                                } else {
                                        try {
                                                $this->mwGlobals[$globalKey] = unserialize( serialize( $GLOBALS[$globalKey] ) );
index 31ee75b..a6cf14a 100644 (file)
@@ -210,6 +210,11 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
 
                $namespaces = isset( $case['namespaces'] ) ? $case['namespaces'] : [];
 
+               if ( wfGetDB( DB_REPLICA )->getType() === 'postgres' ) {
+                       // Postgres will sort lexicographically on utf8 code units (" " before "/")
+                       sort( $case['results'], SORT_STRING );
+               }
+
                $searcher = new StringPrefixSearch;
                $results = $searcher->search( $case['query'], 3, $namespaces );
                $this->assertEquals(
@@ -232,6 +237,11 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
                $searcher = new StringPrefixSearch;
                $results = $searcher->search( $case['query'], 3, $namespaces, 1 );
 
+               if ( wfGetDB( DB_REPLICA )->getType() === 'postgres' ) {
+                       // Postgres will sort lexicographically on utf8 code units (" " before "/")
+                       sort( $case['results'], SORT_STRING );
+               }
+
                // We don't expect the first result when offsetting
                array_shift( $case['results'] );
                // And sometimes we expect a different last result