HomePhabricator

TitleBlacklistTest singleton can now be destroyed

Authored by hashar on Jan 23 2017, 10:58 AM.

Description

TitleBlacklistTest singleton can now be destroyed

The test suite set $wgTitleBlacklistSources with a fixture source of
directories. Unfortunately when running tests from MediaWiki core the
TitleBlacklist has already been set with empty value and thus setting
the global is a noop.

That later causes a test to fail because the blacklist is emtpy.

Add TitleBlacklistTest::destroySingleton() so a test can reset the
singleton when changing $wgTitleBlacklistSources.

Since that is solely for testing, throw an exception unless we had
MW_PHPUNIT_TEST defined.

Bug: T155980
Change-Id: I99c3185811ed7b2225953fa6960096985e97c4d2
(cherry picked from commit 8e09acc8042632266e7ab739694fd34952010ddf)

Details

Committed
hasharJan 24 2017, 9:44 AM
Parents
rETBL07eca420bcac: Whoops, track not trace
Branches
Unknown
Tags
Unknown
References
REL1_28, refs/changes/64/333864/1
ChangeId
I99c3185811ed7b2225953fa6960096985e97c4d2