// Cleanup any temporary mess
$this->mUpload->cleanupTempFile();
- $this->getResult()->addValue( null, $this->getModuleName(), $result );
+
+ if( $this->mParams['enablechunks'] ) {
+ foreach ($result as $key => $value) {
+ if($value === null) $value = "";
+ $this->getResult()->addValue( null, $key, $value );
+ }
+ } else {
+ $this->getResult()->addValue( null, $this->getModuleName(), $result );
+ }
}
protected function performUpload() {
global $wgServerName, $wgServer, $wgContLang, $wgAuth, $wgScriptPath,
$wgScriptExtension, $wgMemc, $wgRequest;
- if($wgServerName == "localhost" || $wgServer == "http://localhost") {
- $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.
- 'be set in LocalSettings.php');
- }
self::$apiUrl = $wgServer.$wgScriptPath."/api".$wgScriptExtension;
$wgMemc = new FakeMemCachedClient;
class ApiTest extends ApiSetup {
function setup() {
+ if($wgServerName == "localhost" || $wgServer == "http://localhost") {
+ $this->markTestIncomplete('This test needs $wgServerName and $wgServer to '.
+ 'be set in LocalSettings.php');
+ }
parent::setup();
}
'token' => $token,
));
- $this->assertArrayHasKey("upload", $data);
- $this->assertArrayHasKey("uploadUrl", $data['upload']);
+ $this->assertArrayHasKey("uploadUrl", $data);
return array('data' => $data, 'session' => $_SESSION, 'token' => $token);
}
$wgUser = User::newFromName(self::$userName);
$token = $wgUser->editToken();
- $url = $data['upload']['uploadUrl'];
+ $url = $data['uploadUrl'];
$params = wfCgiToArray(substr($url, strpos($url, "?")));
for($i=0;$i<10;$i++) {