From 6d221bdabea7727c806c2f4606f2cd46dd5a173f Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 28 May 2011 21:19:24 +0000 Subject: [PATCH] Allow test to remove data from the database This new removeDBData() is run after the tests result. It is similar to the addDBData() method. --- tests/phpunit/MediaWikiTestCase.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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() { -- 2.20.1