test: detects parent setUp not being called
authorAntoine Musso <hashar@free.fr>
Mon, 22 Oct 2012 23:53:51 +0000 (01:53 +0200)
committerAntoine Musso <hashar@free.fr>
Wed, 5 Dec 2012 15:44:41 +0000 (16:44 +0100)
commit5b9f76aef7ce60846a3820bd170aa09a3a6c12e6
tree446a8e23147d2d82ce9738184a2cd86280ac621b
parent904bebbd37bec50bf52356c45c618b533007481b
test: detects parent setUp not being called

Our test classes often overload MediaWikiTestCase::setUp() but forget to
call their parent. This patch makes MediaWikiTestCase to flag whenever
its own setUp() is called and then simply assert it got called. Any
class failing the assertion is missing a call to its parent setup which
is easily fixed by adding: parent::setUp().

It would be nice to find a similar trick for tearDown().

Change-Id: Ia2afed6052eb3863d6c8e68c551cf03b33bb4be9
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/parser/NewParserTest.php