}
protected function doApiRequest( array $params, array $unused = null,
- $appendModule = false, User $user = null
+ $appendModule = false, User $user = null, $tokenType = null
) {
global $wgRequest;
$this->doApiRequest( [
'action' => 'upload',
] );
- } catch ( UsageException $e ) {
+ } catch ( ApiUsageException $e ) {
$exception = true;
$this->assertEquals( "The token parameter must be set", $e->getMessage() );
}
'action' => 'upload',
'token' => $token,
], $data );
- } catch ( UsageException $e ) {
+ } catch ( ApiUsageException $e ) {
$exception = true;
$this->assertEquals( "One of the parameters sessionkey, file, url is required",
$e->getMessage() );
'url' => 'http://www.example.com/test.png',
'token' => $token,
], $data );
- } catch ( UsageException $e ) {
+ } catch ( ApiUsageException $e ) {
$exception = true;
$this->assertEquals( "The filename parameter must be set", $e->getMessage() );
}
'filename' => 'UploadFromUrlTest.png',
'token' => $token,
], $data );
- } catch ( UsageException $e ) {
+ } catch ( ApiUsageException $e ) {
$exception = true;
$this->assertEquals( "Permission denied", $e->getMessage() );
}