Index: trunk/phase3/maintenance/tests/ApiSetup.php |
— | — | @@ -10,10 +10,6 @@ |
11 | 11 | global $wgServerName, $wgServer, $wgContLang, $wgAuth, $wgScriptPath, |
12 | 12 | $wgScriptExtension, $wgMemc, $wgRequest; |
13 | 13 | |
14 | | - if($wgServerName == "localhost" || $wgServer == "http://localhost") { |
15 | | - $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '. |
16 | | - 'be set in LocalSettings.php'); |
17 | | - } |
18 | 14 | self::$apiUrl = $wgServer.$wgScriptPath."/api".$wgScriptExtension; |
19 | 15 | |
20 | 16 | $wgMemc = new FakeMemCachedClient; |
Index: trunk/phase3/maintenance/tests/ApiTest.php |
— | — | @@ -5,6 +5,10 @@ |
6 | 6 | class ApiTest extends ApiSetup { |
7 | 7 | |
8 | 8 | 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 | + } |
9 | 13 | parent::setup(); |
10 | 14 | } |
11 | 15 | |
Index: trunk/phase3/maintenance/tests/UploadFromChunksTest.php |
— | — | @@ -115,8 +115,7 @@ |
116 | 116 | 'token' => $token, |
117 | 117 | )); |
118 | 118 | |
119 | | - $this->assertArrayHasKey("upload", $data); |
120 | | - $this->assertArrayHasKey("uploadUrl", $data['upload']); |
| 119 | + $this->assertArrayHasKey("uploadUrl", $data); |
121 | 120 | |
122 | 121 | return array('data' => $data, 'session' => $_SESSION, 'token' => $token); |
123 | 122 | } |
— | — | @@ -131,7 +130,7 @@ |
132 | 131 | $wgUser = User::newFromName(self::$userName); |
133 | 132 | $token = $wgUser->editToken(); |
134 | 133 | |
135 | | - $url = $data['upload']['uploadUrl']; |
| 134 | + $url = $data['uploadUrl']; |
136 | 135 | $params = wfCgiToArray(substr($url, strpos($url, "?"))); |
137 | 136 | |
138 | 137 | for($i=0;$i<10;$i++) { |
Index: trunk/phase3/includes/api/ApiUpload.php |
— | — | @@ -138,7 +138,15 @@ |
139 | 139 | |
140 | 140 | // Cleanup any temporary mess |
141 | 141 | $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 | + } |
143 | 151 | } |
144 | 152 | |
145 | 153 | protected function performUpload() { |