r90603 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90602‎ | r90603 | r90604 >
Date:21:02, 22 June 2011
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Readd r90538, this time with the missing global $wgHooks;
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,19 @@
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;var_dump($wgHooks);
 16+ $wgHooks['InterwikiLoadPrefix'][] = 'MediaWikiTestCase::disableInterwikis';
1517 }
1618
 19+ function tearDown() {
 20+ global $wgHooks;
 21+ $wgHooks = $this->hooks;
 22+ }
 23+
1724 /**
1825 * Test various forms of valid and invalid titles that can be supplied.
1926 */
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
r90606Kill var_dump from r90603reedy21:32, 22 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90538UploadTest::testTitleValidation accessed the database to fetch the interwikis....platonides17:41, 21 June 2011

Comments

#Comment by 😂 (talk | contribs)   21:08, 22 June 2011

Got a stray var_dump(), but otherwise looks ok now.

Status & tagging log