r90538 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90537‎ | r90538 | r90539 >
Date:17:41, 21 June 2011
Author:platonides
Status:reverted
Tags:
Comment:
UploadTest::testTitleValidation accessed the database to fetch the interwikis.
phase3/includes/upload/UploadBase.php:620
phase3/tests/phpunit/includes/UploadTest.php:120
phase3/tests/phpunit/includes/UploadTest.php:55
phase3/tests/phpunit/includes/UploadTest.php:35

$wgContLang not needed, TitlePermissionTest.php changes the language, inheriting from MediaWikiLangTestCase
Modified paths:
  • /trunk/phase3/tests/phpunit/MediaWikiTestCase.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/TitlePermissionTest.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/UploadTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/MediaWikiTestCase.php
@@ -231,5 +231,9 @@
232232 MediaWikiPHPUnitCommand::$additionalOptions[$offset] = $value;
233233
234234 }
 235+
 236+ public static function disableInterwikis( $prefix, &$data ) {
 237+ return false;
 238+ }
235239 }
236240
Index: trunk/phase3/tests/phpunit/includes/UploadTest.php
@@ -7,12 +7,18 @@
88
99
1010 function setUp() {
11 - global $wgContLang;
 11+ global $wgHooks;
1212 parent::setUp();
13 - $wgContLang = Language::factory( 'en' );
 13+
1414 $this->upload = new UploadTestHandler;
 15+ $this->hooks = $wgHooks;
 16+ $wgHooks['InterwikiLoadPrefix'][] = 'MediaWikiTestCase::disableInterwikis';
1517 }
1618
 19+ function tearDown() {
 20+ $wgHooks = $this->hooks;
 21+ }
 22+
1723 /**
1824 * Test various forms of valid and invalid titles that can be supplied.
1925 */
Index: trunk/phase3/tests/phpunit/includes/TitlePermissionTest.php
@@ -3,7 +3,7 @@
44 /**
55 * @group Database
66 */
7 -class TitlePermissionTest extends MediaWikiTestCase {
 7+class TitlePermissionTest extends MediaWikiLangTestCase {
88 protected $title;
99 protected $user;
1010 protected $anonUser;
@@ -14,6 +14,7 @@
1515
1616 function setUp() {
1717 global $wgLocaltimezone, $wgLocalTZoffset, $wgMemc, $wgContLang, $wgLang;
 18+ parent::setUp();
1819
1920 if(!$wgMemc) {
2021 $wgMemc = new EmptyBagOStuff;
@@ -50,6 +51,10 @@
5152 }
5253 }
5354
 55+ function tearDown() {
 56+ parent::tearDown();
 57+ }
 58+
5459 function setUserPerm( $perm ) {
5560 if ( is_array( $perm ) ) {
5661 $this->user->mRights = $perm;

Follow-up revisions

RevisionCommit summaryAuthorDate
r90561Provisional revert of r90538. I can't replicate the failures, but CI's been c...demon00:01, 22 June 2011
r90603Readd r90538, this time with the missing global $wgHooks;platonides21:02, 22 June 2011

Status & tagging log