From: Antoine Musso Date: Sat, 28 May 2011 21:19:24 +0000 (+0000) Subject: Allow test to remove data from the database X-Git-Tag: 1.31.0-rc.0~29884 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=6d221bdabea7727c806c2f4606f2cd46dd5a173f;p=lhc%2Fweb%2Fwiklou.git Allow test to remove data from the database This new removeDBData() is run after the tests result. It is similar to the addDBData() method. --- diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 3363e3f349..10518445d1 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -59,6 +59,9 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { $this->addDBData(); parent::run( $result ); + + $this->removeDBData(); + } else { parent::run( $result ); } @@ -84,6 +87,12 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { * implement this method and do so */ function addDBData() {} + + /** + * Stub. If a test needs to remove data from the database. Called after + * test run. + */ + function removeDBData() {} private function addCoreDBData() {