http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83375
Revision: 83375 Author: maxsem Date: 2011-03-06 09:01:19 +0000 (Sun, 06 Mar 2011) Log Message: ----------- Fixed fatals in UploadFromUrlTest. It still fails though Modified Paths: -------------- trunk/phase3/tests/phpunit/includes/UploadFromUrlTest.php Modified: trunk/phase3/tests/phpunit/includes/UploadFromUrlTest.php =================================================================== --- trunk/phase3/tests/phpunit/includes/UploadFromUrlTest.php 2011-03-06 08:15:49 UTC (rev 83374) +++ trunk/phase3/tests/phpunit/includes/UploadFromUrlTest.php 2011-03-06 09:01:19 UTC (rev 83375) @@ -4,6 +4,7 @@ /** * @group Broken + * @group Upload */ class UploadFromUrlTest extends ApiTestSetup { @@ -52,8 +53,8 @@ public function testLogin() { $data = $this->doApiRequest( array( 'action' => 'login', - 'lgname' => self::$userName, - 'lgpassword' => self::$passWord ) ); + 'lgname' => $this->user->userName, + 'lgpassword' => $this->user->passWord ) ); $this->assertArrayHasKey( "login", $data[0] ); $this->assertArrayHasKey( "result", $data[0]['login'] ); $this->assertEquals( "NeedToken", $data[0]['login']['result'] ); @@ -62,8 +63,8 @@ $data = $this->doApiRequest( array( 'action' => 'login', "lgtoken" => $token, - "lgname" => self::$userName, - "lgpassword" => self::$passWord ) ); + 'lgname' => $this->user->userName, + 'lgpassword' => $this->user->passWord ) ); $this->assertArrayHasKey( "login", $data[0] ); $this->assertArrayHasKey( "result", $data[0]['login'] ); @@ -78,7 +79,7 @@ * @depends testClearQueue */ public function testSetupUrlDownload( $data ) { - $token = self::$user->editToken(); + $token = $this->user->editToken(); $exception = false; try { @@ -117,7 +118,7 @@ } $this->assertTrue( $exception, "Got exception" ); - self::$user->removeGroup( 'sysop' ); + $this->user->removeGroup( 'sysop' ); $exception = false; try { $this->doApiRequest( array( @@ -132,7 +133,7 @@ } $this->assertTrue( $exception, "Got exception" ); - self::$user->addGroup( 'sysop' ); + $this->user->addGroup( 'sysop' ); $data = $this->doApiRequest( array( 'action' => 'upload', 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', @@ -152,9 +153,9 @@ * @depends testClearQueue */ public function testAsyncUpload( $data ) { - $token = self::$user->editToken(); + $token = $this->user->editToken(); - self::$user->addGroup( 'users' ); + $this->user->addGroup( 'users' ); $data = $this->doAsyncUpload( $token, true ); $this->assertEquals( $data[0]['upload']['result'], 'Success' ); @@ -171,9 +172,9 @@ * @depends testClearQueue */ public function testAsyncUploadWarning( $data ) { - $token = self::$user->editToken(); + $token = $this->user->editToken(); - self::$user->addGroup( 'users' ); + $this->user->addGroup( 'users' ); $data = $this->doAsyncUpload( $token ); @@ -202,12 +203,12 @@ * @depends testClearQueue */ public function testSyncDownload( $data ) { - $token = self::$user->editToken(); + $token = $this->user->editToken(); $job = Job::pop(); $this->assertFalse( $job, 'Starting with an empty jobqueue' ); - self::$user->addGroup( 'users' ); + $this->user->addGroup( 'users' ); $data = $this->doApiRequest( array( 'action' => 'upload', 'filename' => 'UploadFromUrlTest.png', @@ -226,9 +227,9 @@ } public function testLeaveMessage() { - $token = self::$user->editToken(); + $token = $this->user->user->editToken(); - $talk = self::$user->getTalkPage(); + $talk = $this->user->user->getTalkPage(); if ( $talk->exists() ) { $a = new Article( $talk ); $a->doDeleteArticle( '' ); _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs