Matthias Mullie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/309977

Change subject: Get rid of call to no longer existing method
......................................................................

Get rid of call to no longer existing method

ParserTest::setupInterwikis() has been removed in
6117fb244fc63b2e9f4d70a1e3d467032f386f2a as part of a large
parser tests refactor.

We only need a minor detail of that parser test suite, so it
seems to make most sense to just mostly copy this part of the
parser test suite, since we're not interested in the rest of it.

Change-Id: I117c45a8ec29293207544a5ead97e1e6c9fef2b2
---
M tests/phpunit/UploadWizardConfigTest.php
1 file changed, 28 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/77/309977/1

diff --git a/tests/phpunit/UploadWizardConfigTest.php 
b/tests/phpunit/UploadWizardConfigTest.php
index d8a24db..b29bf09 100644
--- a/tests/phpunit/UploadWizardConfigTest.php
+++ b/tests/phpunit/UploadWizardConfigTest.php
@@ -6,6 +6,34 @@
  */
 
 class UploadWizardConfigTest extends MediaWikiTestCase {
+       public function setUp() {
+               parent::setUp();
+
+               // insert a interwiki prefixes for testing inter-language links.
+               // This is based on ParserTestRunner::setupInterwikis, which 
does
+               // exactly the same (but with more prefixes) for parser tests.
+               Hooks::register( 'InterwikiLoadPrefix', function ( $prefix, 
&$iwData ) {
+                       static $testInterwikis = [
+                               'es' => [
+                                       'iw_url' => 
'http://es.wikipedia.org/wiki/$1',
+                                       'iw_api' => '',
+                                       'iw_wikiid' => '',
+                                       'iw_local' => 1 ],
+                       ];
+                       if ( array_key_exists( $prefix, $testInterwikis ) ) {
+                               $iwData = $testInterwikis[$prefix];
+                       }
+
+                       // We only want to rely on the above fixtures
+                       return false;
+               } );
+       }
+
+       public function tearDown() {
+               parent::tearDown();
+
+               Hooks::clear( 'InterwikiLoadPrefix' );
+       }
 
        public function objRefProvider() {
                return [
@@ -39,7 +67,6 @@
                $objRef, $expectedResult
        ) {
                global $wgUploadWizardConfig;
-               ParserTest::setupInterwikis();
 
                $this->setMwGlobals( [
                        'wgUploadWizardConfig' => array_merge( 
$wgUploadWizardConfig, [

-- 
To view, visit https://gerrit.wikimedia.org/r/309977
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I117c45a8ec29293207544a5ead97e1e6c9fef2b2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to