From 63601400e476c6cf43d985f3e7b9864681695ed4 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 18 Jan 2013 16:46:04 +0100 Subject: Update to MediaWiki 1.20.2 this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024 --- tests/phpunit/includes/upload/UploadFromUrlTest.php | 14 +++++++------- tests/phpunit/includes/upload/UploadStashTest.php | 6 +++--- tests/phpunit/includes/upload/UploadTest.php | 4 +++- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'tests/phpunit/includes/upload') diff --git a/tests/phpunit/includes/upload/UploadFromUrlTest.php b/tests/phpunit/includes/upload/UploadFromUrlTest.php index d56cce31..f66c387b 100644 --- a/tests/phpunit/includes/upload/UploadFromUrlTest.php +++ b/tests/phpunit/includes/upload/UploadFromUrlTest.php @@ -20,7 +20,7 @@ class UploadFromUrlTest extends ApiTestCase { } } - protected function doApiRequest( $params, $unused = null, $appendModule = false, $user = null ) { + protected function doApiRequest( Array $params, Array $unused = null, $appendModule = false, User $user = null ) { $sessionId = session_id(); session_write_close(); @@ -228,11 +228,11 @@ class UploadFromUrlTest extends ApiTestCase { $talk = $this->user->user->getTalkPage(); if ( $talk->exists() ) { - $a = new Article( $talk ); - $a->doDeleteArticle( '' ); + $page = WikiPage::factory( $talk ); + $page->doDeleteArticle( '' ); } - $this->assertFalse( (bool)$talk->getArticleId( Title::GAID_FOR_UPDATE ), 'User talk does not exist' ); + $this->assertFalse( (bool)$talk->getArticleID( Title::GAID_FOR_UPDATE ), 'User talk does not exist' ); $data = $this->doApiRequest( array( 'action' => 'upload', @@ -249,7 +249,7 @@ class UploadFromUrlTest extends ApiTestCase { $job->run(); $this->assertTrue( wfLocalFile( 'UploadFromUrlTest.png' )->exists() ); - $this->assertTrue( (bool)$talk->getArticleId( Title::GAID_FOR_UPDATE ), 'User talk exists' ); + $this->assertTrue( (bool)$talk->getArticleID( Title::GAID_FOR_UPDATE ), 'User talk exists' ); $this->deleteFile( 'UploadFromUrlTest.png' ); @@ -341,8 +341,8 @@ class UploadFromUrlTest extends ApiTestCase { $file = wfFindFile( $name, array( 'ignoreRedirect' => true ) ); $empty = ""; FileDeleteForm::doDelete( $t, $file, $empty, "none", true ); - $a = new Article ( $t ); - $a->doDeleteArticle( "testing" ); + $page = WikiPage::factory( $t ); + $page->doDeleteArticle( "testing" ); } $t = Title::newFromText( $name, NS_FILE ); diff --git a/tests/phpunit/includes/upload/UploadStashTest.php b/tests/phpunit/includes/upload/UploadStashTest.php index c9dbb138..66fafaaf 100644 --- a/tests/phpunit/includes/upload/UploadStashTest.php +++ b/tests/phpunit/includes/upload/UploadStashTest.php @@ -12,17 +12,17 @@ class UploadStashTest extends MediaWikiTestCase { parent::setUp(); // Setup a file for bug 29408 - $this->bug29408File = dirname( __FILE__ ) . '/bug29408'; + $this->bug29408File = __DIR__ . '/bug29408'; file_put_contents( $this->bug29408File, "\x00" ); self::$users = array( - 'sysop' => new ApiTestUser( + 'sysop' => new TestUser( 'Uploadstashtestsysop', 'Upload Stash Test Sysop', 'upload_stash_test_sysop@example.com', array( 'sysop' ) ), - 'uploader' => new ApiTestUser( + 'uploader' => new TestUser( 'Uploadstashtestuser', 'Upload Stash Test User', 'upload_stash_test_user@example.com', diff --git a/tests/phpunit/includes/upload/UploadTest.php b/tests/phpunit/includes/upload/UploadTest.php index 4293d23b..6948f5b1 100644 --- a/tests/phpunit/includes/upload/UploadTest.php +++ b/tests/phpunit/includes/upload/UploadTest.php @@ -12,7 +12,9 @@ class UploadTest extends MediaWikiTestCase { $this->upload = new UploadTestHandler; $this->hooks = $wgHooks; - $wgHooks['InterwikiLoadPrefix'][] = 'MediaWikiTestCase::disableInterwikis'; + $wgHooks['InterwikiLoadPrefix'][] = function( $prefix, &$data ) { + return false; + }; } function tearDown() { -- cgit v1.2.2