Merge pull request #5022 from Rudloff/feature/test_api

Add API tests
This commit is contained in:
Hypolite Petovan 2018-05-16 08:25:11 -04:00 committed by GitHub
commit ce75177d4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 5383 additions and 21 deletions

View file

@ -54,7 +54,7 @@ define('API_METHOD_POST', 'POST,PUT');
define('API_METHOD_DELETE', 'POST,DELETE');
$API = [];
$called_api = null;
$called_api = [];
/**
* It is not sufficient to use local_user() to check whether someone is allowed to use the API,
@ -2200,7 +2200,7 @@ function api_statuses_repeat($type)
}
// this should output the last post (the one we just posted).
$called_api = null;
$called_api = [];
return api_status_show($type);
}
@ -2716,7 +2716,7 @@ function api_convert_item($item)
*
* @param string $body
*
* @return array|false
* @return array
*/
function api_get_attachments(&$body)
{
@ -2727,7 +2727,7 @@ function api_get_attachments(&$body)
$ret = preg_match_all("/\[img\]([$URLSearchString]*)\[\/img\]/ism", $text, $images);
if (!$ret) {
return false;
return [];
}
$attachments = [];