From: aude Date: Sun, 24 Nov 2013 00:46:49 +0000 (+0100) Subject: Make setUp and tearDown protected in tests X-Git-Tag: 1.31.0-rc.0~17874^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=71cf107f99e54d73c6e7f00d37c34eaf78df38a7;p=lhc%2Fweb%2Fwiklou.git Make setUp and tearDown protected in tests These are protected in the parent MediaWikiTestCase and PHPUnit_Framework_TestCase. No good reason to make them public. Change-Id: I45ecc0e4209f0c3b27e63a550112e4e0ddf6e530 --- diff --git a/tests/phpunit/includes/RevisionStorageTest.php b/tests/phpunit/includes/RevisionStorageTest.php index 90ef553795..7e275a5891 100644 --- a/tests/phpunit/includes/RevisionStorageTest.php +++ b/tests/phpunit/includes/RevisionStorageTest.php @@ -56,7 +56,7 @@ class RevisionStorageTest extends MediaWikiTestCase { } } - public function tearDown() { + protected function tearDown() { global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; parent::tearDown(); diff --git a/tests/phpunit/includes/SpecialPageTest.php b/tests/phpunit/includes/SpecialPageTest.php index a29d527dd9..65057a5702 100644 --- a/tests/phpunit/includes/SpecialPageTest.php +++ b/tests/phpunit/includes/SpecialPageTest.php @@ -10,7 +10,7 @@ */ class SpecialPageTest extends MediaWikiTestCase { - public function setUp() { + protected function setUp() { parent::setUp(); $this->setMwGlobals( array( diff --git a/tests/phpunit/includes/TitleMethodsTest.php b/tests/phpunit/includes/TitleMethodsTest.php index 3079d73a37..55a17ac3dd 100644 --- a/tests/phpunit/includes/TitleMethodsTest.php +++ b/tests/phpunit/includes/TitleMethodsTest.php @@ -9,7 +9,7 @@ */ class TitleMethodsTest extends MediaWikiTestCase { - public function setUp() { + protected function setUp() { global $wgContLang; parent::setUp(); @@ -33,7 +33,7 @@ class TitleMethodsTest extends MediaWikiTestCase { $wgContLang->resetNamespaces(); # reset namespace cache } - public function tearDown() { + protected function tearDown() { global $wgContLang; parent::tearDown(); diff --git a/tests/phpunit/includes/api/ApiEditPageTest.php b/tests/phpunit/includes/api/ApiEditPageTest.php index 8fe08e10b6..2709d52d19 100644 --- a/tests/phpunit/includes/api/ApiEditPageTest.php +++ b/tests/phpunit/includes/api/ApiEditPageTest.php @@ -13,7 +13,7 @@ */ class ApiEditPageTest extends ApiTestCase { - public function setUp() { + protected function setUp() { global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; parent::setUp(); @@ -30,7 +30,7 @@ class ApiEditPageTest extends ApiTestCase { $this->doLogin(); } - public function tearDown() { + protected function tearDown() { global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; unset( $wgExtraNamespaces[12312] ); diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php index aedf594d26..d1c214aeac 100644 --- a/tests/phpunit/includes/content/ContentHandlerTest.php +++ b/tests/phpunit/includes/content/ContentHandlerTest.php @@ -10,7 +10,7 @@ */ class ContentHandlerTest extends MediaWikiTestCase { - public function setUp() { + protected function setUp() { global $wgContLang; parent::setUp(); @@ -38,7 +38,7 @@ class ContentHandlerTest extends MediaWikiTestCase { $wgContLang->resetNamespaces(); } - public function tearDown() { + protected function tearDown() { global $wgContLang; // Reset namespace cache diff --git a/tests/phpunit/includes/content/WikitextContentHandlerTest.php b/tests/phpunit/includes/content/WikitextContentHandlerTest.php index 7c62dcad24..73b975baa8 100644 --- a/tests/phpunit/includes/content/WikitextContentHandlerTest.php +++ b/tests/phpunit/includes/content/WikitextContentHandlerTest.php @@ -10,7 +10,7 @@ class WikitextContentHandlerTest extends MediaWikiLangTestCase { */ var $handler; - public function setUp() { + protected function setUp() { parent::setUp(); $this->handler = ContentHandler::getForModelID( CONTENT_MODEL_WIKITEXT ); diff --git a/tests/phpunit/includes/diff/DifferenceEngineTest.php b/tests/phpunit/includes/diff/DifferenceEngineTest.php index 5c3f36a627..f95eb5e8f6 100644 --- a/tests/phpunit/includes/diff/DifferenceEngineTest.php +++ b/tests/phpunit/includes/diff/DifferenceEngineTest.php @@ -16,7 +16,7 @@ class DifferenceEngineTest extends MediaWikiTestCase { private static $revisions; - public function setUp() { + protected function setUp() { parent::setUp(); $title = $this->getTitle(); diff --git a/tests/phpunit/includes/parser/TidyTest.php b/tests/phpunit/includes/parser/TidyTest.php index d2ab4d3e13..12aac6916c 100644 --- a/tests/phpunit/includes/parser/TidyTest.php +++ b/tests/phpunit/includes/parser/TidyTest.php @@ -4,7 +4,8 @@ * @group Parser */ class TidyTest extends MediaWikiTestCase { - public function setUp() { + + protected function setUp() { parent::setUp(); $check = MWTidy::tidy( '' ); if ( strpos( $check, '