Index: trunk/phase3/tests/phpunit/includes/UploadFromUrlTest.php |
— | — | @@ -4,6 +4,7 @@ |
5 | 5 | |
6 | 6 | /** |
7 | 7 | * @group Broken |
| 8 | + * @group Upload |
8 | 9 | */ |
9 | 10 | class UploadFromUrlTest extends ApiTestSetup { |
10 | 11 | |
— | — | @@ -52,8 +53,8 @@ |
53 | 54 | public function testLogin() { |
54 | 55 | $data = $this->doApiRequest( array( |
55 | 56 | 'action' => 'login', |
56 | | - 'lgname' => self::$userName, |
57 | | - 'lgpassword' => self::$passWord ) ); |
| 57 | + 'lgname' => $this->user->userName, |
| 58 | + 'lgpassword' => $this->user->passWord ) ); |
58 | 59 | $this->assertArrayHasKey( "login", $data[0] ); |
59 | 60 | $this->assertArrayHasKey( "result", $data[0]['login'] ); |
60 | 61 | $this->assertEquals( "NeedToken", $data[0]['login']['result'] ); |
— | — | @@ -62,8 +63,8 @@ |
63 | 64 | $data = $this->doApiRequest( array( |
64 | 65 | 'action' => 'login', |
65 | 66 | "lgtoken" => $token, |
66 | | - "lgname" => self::$userName, |
67 | | - "lgpassword" => self::$passWord ) ); |
| 67 | + 'lgname' => $this->user->userName, |
| 68 | + 'lgpassword' => $this->user->passWord ) ); |
68 | 69 | |
69 | 70 | $this->assertArrayHasKey( "login", $data[0] ); |
70 | 71 | $this->assertArrayHasKey( "result", $data[0]['login'] ); |
— | — | @@ -78,7 +79,7 @@ |
79 | 80 | * @depends testClearQueue |
80 | 81 | */ |
81 | 82 | public function testSetupUrlDownload( $data ) { |
82 | | - $token = self::$user->editToken(); |
| 83 | + $token = $this->user->editToken(); |
83 | 84 | $exception = false; |
84 | 85 | |
85 | 86 | try { |
— | — | @@ -117,7 +118,7 @@ |
118 | 119 | } |
119 | 120 | $this->assertTrue( $exception, "Got exception" ); |
120 | 121 | |
121 | | - self::$user->removeGroup( 'sysop' ); |
| 122 | + $this->user->removeGroup( 'sysop' ); |
122 | 123 | $exception = false; |
123 | 124 | try { |
124 | 125 | $this->doApiRequest( array( |
— | — | @@ -132,7 +133,7 @@ |
133 | 134 | } |
134 | 135 | $this->assertTrue( $exception, "Got exception" ); |
135 | 136 | |
136 | | - self::$user->addGroup( 'sysop' ); |
| 137 | + $this->user->addGroup( 'sysop' ); |
137 | 138 | $data = $this->doApiRequest( array( |
138 | 139 | 'action' => 'upload', |
139 | 140 | 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', |
— | — | @@ -152,9 +153,9 @@ |
153 | 154 | * @depends testClearQueue |
154 | 155 | */ |
155 | 156 | public function testAsyncUpload( $data ) { |
156 | | - $token = self::$user->editToken(); |
| 157 | + $token = $this->user->editToken(); |
157 | 158 | |
158 | | - self::$user->addGroup( 'users' ); |
| 159 | + $this->user->addGroup( 'users' ); |
159 | 160 | |
160 | 161 | $data = $this->doAsyncUpload( $token, true ); |
161 | 162 | $this->assertEquals( $data[0]['upload']['result'], 'Success' ); |
— | — | @@ -171,9 +172,9 @@ |
172 | 173 | * @depends testClearQueue |
173 | 174 | */ |
174 | 175 | public function testAsyncUploadWarning( $data ) { |
175 | | - $token = self::$user->editToken(); |
| 176 | + $token = $this->user->editToken(); |
176 | 177 | |
177 | | - self::$user->addGroup( 'users' ); |
| 178 | + $this->user->addGroup( 'users' ); |
178 | 179 | |
179 | 180 | |
180 | 181 | $data = $this->doAsyncUpload( $token ); |
— | — | @@ -202,12 +203,12 @@ |
203 | 204 | * @depends testClearQueue |
204 | 205 | */ |
205 | 206 | public function testSyncDownload( $data ) { |
206 | | - $token = self::$user->editToken(); |
| 207 | + $token = $this->user->editToken(); |
207 | 208 | |
208 | 209 | $job = Job::pop(); |
209 | 210 | $this->assertFalse( $job, 'Starting with an empty jobqueue' ); |
210 | 211 | |
211 | | - self::$user->addGroup( 'users' ); |
| 212 | + $this->user->addGroup( 'users' ); |
212 | 213 | $data = $this->doApiRequest( array( |
213 | 214 | 'action' => 'upload', |
214 | 215 | 'filename' => 'UploadFromUrlTest.png', |
— | — | @@ -226,9 +227,9 @@ |
227 | 228 | } |
228 | 229 | |
229 | 230 | public function testLeaveMessage() { |
230 | | - $token = self::$user->editToken(); |
| 231 | + $token = $this->user->user->editToken(); |
231 | 232 | |
232 | | - $talk = self::$user->getTalkPage(); |
| 233 | + $talk = $this->user->user->getTalkPage(); |
233 | 234 | if ( $talk->exists() ) { |
234 | 235 | $a = new Article( $talk ); |
235 | 236 | $a->doDeleteArticle( '' ); |