summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/upload
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/upload')
-rw-r--r--tests/phpunit/includes/upload/UploadFromUrlTest.php14
-rw-r--r--tests/phpunit/includes/upload/UploadStashTest.php6
-rw-r--r--tests/phpunit/includes/upload/UploadTest.php4
3 files changed, 13 insertions, 11 deletions
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() {