test: rework interwiki lookup in parser tests
authorAntoine Musso <hashar@free.fr>
Mon, 20 May 2013 13:21:02 +0000 (15:21 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 17 Jun 2013 20:58:42 +0000 (20:58 +0000)
commit35f802edd9211b083dabe9fb9563aa5057b4595e
treebfd83655eba3a7163ed6336b552abdec2dc51df2
parent82383beecffac38b51746802e7eedd4a78a215c4
test: rework interwiki lookup in parser tests

Some of our parser tests lookup interwikis.  This was originally done
(parser/parserTest.inc) by inserting a set of interwikis in the database
and was later lamely copy pasted in the PHPUnit wrapped test suite
(phpunit/includes/parser/NewParserTest.php).

Since that time, we had duplicate code and had the test hitting the
database to fetch interwiki.  Nowadays, we can trick the Interwiki
lookup class by using the InterwikiLoadPrefix hook, that let us skip
database lookup entirely (by having the hook returning false) and get
rid of the duplicate code.

The good old parserTests.php still pass the tests :-]

Change-Id: I36865e3890e08a05b8a6aaafa309a87556e235b9
tests/parser/parserTest.inc
tests/phpunit/includes/parser/NewParserTest.php