tests: ensure parserTestRunner restores $wgParser
authorAntoine Musso <hashar@free.fr>
Mon, 11 Sep 2017 10:58:13 +0000 (12:58 +0200)
committerAntoine Musso <hashar@free.fr>
Mon, 11 Sep 2017 10:58:13 +0000 (12:58 +0200)
commit875fe1693c44b14da05639968f124d6050d27975
treea969f5e8750ec4442abc38626487b91028b7c527
parent2b288514620164215e7b7894e4ac8bf82fcee103
tests: ensure parserTestRunner restores $wgParser

ParserTestRunner::addArticle() set a dummy $wgParser to ease test
running. However if doEditContent() fails, it would abort and never
restore $wgParser.

Make sure the restoration is done even on exception.

I caught that one while running parser tests with Scribunto and Cite. My
setup lacked a luastandalone which causes Scribunto to throw an
exception. When the Cite tests are run, the MessageCache parser ended up
using $wgParser = ParserTestMockParser;

Change-Id: I33a0a5c1f40f197405d40b7925cc043342e6757e
tests/parser/ParserTestRunner.php