Mirate API\SavedSearches tests

This commit is contained in:
Philipp Holzer 2021-11-12 22:15:43 +01:00
parent de1e839a2b
commit 23939cd0f1
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
2 changed files with 22 additions and 14 deletions

View file

@ -3532,18 +3532,4 @@ class ApiTest extends FixtureTest
{
$this->markTestIncomplete();
}
/**
* Test the api_saved_searches_list() function.
*
* @return void
*/
public function testApiSavedSearchesList()
{
// $result = api_saved_searches_list('json');
// self::assertEquals(1, $result['terms'][0]['id']);
// self::assertEquals(1, $result['terms'][0]['id_str']);
// self::assertEquals('Saved search', $result['terms'][0]['name']);
// self::assertEquals('Saved search', $result['terms'][0]['query']);
}
}

View file

@ -0,0 +1,22 @@
<?php
namespace Friendica\Test\src\Module\Api\Twitter;
use Friendica\Module\Api\Twitter\SavedSearches;
use Friendica\Test\src\Module\Api\ApiTest;
use Friendica\Test\Util\ApiResponseDouble;
class SavedSearchesTest extends ApiTest
{
public function test()
{
SavedSearches::rawContent(['extension' => 'json']);
$result = json_decode(ApiResponseDouble::getOutput());
self::assertEquals(1, $result[0]->id);
self::assertEquals(1, $result[0]->id_str);
self::assertEquals('Saved search', $result[0]->name);
self::assertEquals('Saved search', $result[0]->query);
}
}