API - /search #6274

- fixed: search result always return empty
- add hashtag search: friendica_tag params
- ApiTest & api.md updated
This commit is contained in:
root 2018-12-16 16:11:55 +00:00 committed by Hypolite Petovan
commit 939364f9a0
3 changed files with 49 additions and 22 deletions

View file

@ -1118,7 +1118,7 @@ class ApiTest extends DatabaseTest
*/
public function testApiStatusesUpdate()
{
$_GET['status'] = 'Status content';
$_GET['status'] = 'Status content #friendica';
$_GET['in_reply_to_status_id'] = -1;
$_GET['lat'] = 48;
$_GET['long'] = 7;
@ -1390,6 +1390,20 @@ class ApiTest extends DatabaseTest
}
}
/**
* Test the api_search() function with friendica_tag
* @return void
*/
public function testApiSearchWithFriendicaTag()
{
$_REQUEST['friendica_tag'] = 'friendica';
$result = api_search('json');
foreach ($result['status'] as $status) {
$this->assertStatus($status);
$this->assertContains('#friendica', $status['text'], null, true);
}
}
/**
* Test the api_search() function with an rpp parameter.
* @return void