tests: avoid sql queries in TitleTest
authorAntoine Musso <hashar@free.fr>
Thu, 21 Aug 2014 19:54:51 +0000 (21:54 +0200)
committerLegoktm <legoktm.wikipedia@gmail.com>
Fri, 22 Aug 2014 23:16:01 +0000 (23:16 +0000)
commite5eb717d251a007882a1e2703f9354c90d1e70e5
tree3b45201575990a7d9039e97bde805f73b6a626fb
parentf0f69d49f4e010d4aa34e6b6bc26070f64673f5c
tests: avoid sql queries in TitleTest

testIsAlwaysKnown was invoked on an interwiki link. To have the test
pass, we used addDBData() to inject the interwiki in the database.  This
end up being execute on each test when it is only needed for a single
assertion.

Instead of creating a Title, use Title::makeTitle() to populate the
interwiki, thus letting us avoid the database hits.

Random timing: 1.20s -> 150ms.

Change-Id: I63a4e7b9af5eacb7dc1de4b33b8e631e6c3f1fa6
tests/phpunit/includes/TitleTest.php