r62291 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62290‎ | r62291 | r62292 >
Date:05:35, 11 February 2010
Author:mah
Status:ok
Tags:
Comment:
follow-up r61355
Actually test UploadChunks code against Firefogg. Uploads work, but
feedback on the Firefogg side seems not too. Also, Firefogg makes a
complete upload, but then attempts more uploads.
Modified paths:
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)
  • /trunk/phase3/maintenance/tests/ApiSetup.php (modified) (history)
  • /trunk/phase3/maintenance/tests/ApiTest.php (modified) (history)
  • /trunk/phase3/maintenance/tests/UploadFromChunksTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/ApiSetup.php
@@ -10,10 +10,6 @@
1111 global $wgServerName, $wgServer, $wgContLang, $wgAuth, $wgScriptPath,
1212 $wgScriptExtension, $wgMemc, $wgRequest;
1313
14 - if($wgServerName == "localhost" || $wgServer == "http://localhost") {
15 - $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.
16 - 'be set in LocalSettings.php');
17 - }
1814 self::$apiUrl = $wgServer.$wgScriptPath."/api".$wgScriptExtension;
1915
2016 $wgMemc = new FakeMemCachedClient;
Index: trunk/phase3/maintenance/tests/ApiTest.php
@@ -5,6 +5,10 @@
66 class ApiTest extends ApiSetup {
77
88 function setup() {
 9+ if($wgServerName == "localhost" || $wgServer == "http://localhost") {
 10+ $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.
 11+ 'be set in LocalSettings.php');
 12+ }
913 parent::setup();
1014 }
1115
Index: trunk/phase3/maintenance/tests/UploadFromChunksTest.php
@@ -115,8 +115,7 @@
116116 'token' => $token,
117117 ));
118118
119 - $this->assertArrayHasKey("upload", $data);
120 - $this->assertArrayHasKey("uploadUrl", $data['upload']);
 119+ $this->assertArrayHasKey("uploadUrl", $data);
121120
122121 return array('data' => $data, 'session' => $_SESSION, 'token' => $token);
123122 }
@@ -131,7 +130,7 @@
132131 $wgUser = User::newFromName(self::$userName);
133132 $token = $wgUser->editToken();
134133
135 - $url = $data['upload']['uploadUrl'];
 134+ $url = $data['uploadUrl'];
136135 $params = wfCgiToArray(substr($url, strpos($url, "?")));
137136
138137 for($i=0;$i<10;$i++) {
Index: trunk/phase3/includes/api/ApiUpload.php
@@ -138,7 +138,15 @@
139139
140140 // Cleanup any temporary mess
141141 $this->mUpload->cleanupTempFile();
142 - $this->getResult()->addValue( null, $this->getModuleName(), $result );
 142+
 143+ if( $this->mParams['enablechunks'] ) {
 144+ foreach ($result as $key => $value) {
 145+ if($value === null) $value = "";
 146+ $this->getResult()->addValue( null, $key, $value );
 147+ }
 148+ } else {
 149+ $this->getResult()->addValue( null, $this->getModuleName(), $result );
 150+ }
143151 }
144152
145153 protected function performUpload() {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61355UploadChunks added from js2 branch. Refactored. Still needs to be...mah04:37, 22 January 2010

Status & tagging log