Commit graph

10 commits

Author SHA1 Message Date
Aryeh Gregor
7fb4a95563 Remove unneeded overrideMwServices/resetServices
Change-Id: If6cbdec05b8f310ef3a0b4649aaa16d9fb80a047
2019-08-29 14:26:18 +03:00
Thiemo Kreuz
8a4e15db7f Add missing newline between <?php and namespace/use section
The rest of the codebase is using this code formatting standard.

Change-Id: I4d2ba61757a7e28d40096d9dc5915005c340d4f2
2019-06-03 13:36:48 +00:00
jenkins-bot
7bbcff92f9 Merge "Hard deprecate Interwiki static methods" 2018-06-09 09:33:09 +00:00
Kunal Mehta
6c4cbfd736 Enable InterwikiTest::testDatabaseStorage()
The patch mentioned in the skip message was never merged, but the test
passes now.

Change-Id: Ifa28fbf1d8967fc3dac0f81032ef3f2439efb86c
2018-06-07 11:44:30 -07:00
Kunal Mehta
c2b506a59f Hard deprecate Interwiki static methods
Change-Id: I803df3ef90bf6b602e85ae48f25745f4dc6aab3a
2018-06-07 11:40:46 -07:00
Umherirrender
45da581551 Use ::class to resolve class names in tests
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
2018-01-26 22:49:13 +01:00
Timo Tijhof
0548f1902c Interwiki: Don't override interwiki map order
The ksort() here was causing the order to be enforced as
alphabetical instead of preserving the original order.

The order usually doesn't matter, except with regards to handling
of duplicates. Due to Parsoid normalising external links to interwiki
links, it has to do a reverse lookup. In doing so it has to decide
which one to prefer. It currently picks the first match from the
API request for meta=siteinfo&siprop=interwikimap, which didn't
match the defined order in the actual Interwiki map due to ksort()
being called in getAllPrefixes().

Sort in this function was originally introduced in 2010 with
commit 844e7c83e4 (2011; r92528; T21838), which is otherwise unrelated
and left no rationale.

The existing unit tests needed to be adjusted slightly as they
assumed alphabetical order. While it appeared they were also defined
in alphabetical order, this was merely the order of the variable
creation. The effective order is preserved within locals and globals,
but overall globals come before locals.

Also removed the duplicate test for Hash and CDB in InterwikiTest
that belongs in ClassicInterwikiLookupTest instead.

Bug: T145337
Change-Id: I7348748801cbdf16c6ceea5b0654fc174b79707e
2017-04-25 15:38:32 -07:00
Yuriy Shnitkovskiy
85a52faa37 Removed deprecated usages of Interwiki methods in core
Change-Id: Ibd25968660466c44189ccb01df1d8bec6e1b207c
2017-01-10 12:19:31 +02:00
daniel
025f15a208 Factor InterwikiLookup out of Interwiki class.
This keeps the existing app logic for looking up interwiki information
intact in ClassicInterwikiLookup. The idea is to seamlessly switch to a new
implementation when it becomes available, while also allowing us to
switch back in case of problems.

Change-Id: I7d7424345d0ce3ce90ba284006ee9615e3d99baa
2016-05-18 11:57:32 +02:00
daniel
ff764440da Introduce InterwikiTest
This test class verifies that Interwiki currectly handles information
from the database, CDB files, and plain arrays. This is intended to
allow confident refactoring when implementing T113034.

Bug: T113034
Change-Id: I2b68d11e3e946d81fa5f5f65a28fc399e7936c0f
2016-04-23 21:44:59 +02:00