6 namespace Friendica\Test\legacy;
9 use Friendica\Core\Config\Capability\IManageConfigValues;
11 use Friendica\Module\Api\ApiResponse;
12 use Friendica\Module\BaseApi;
13 use Friendica\Security\BasicAuth;
14 use Friendica\Test\FixtureTest;
15 use Friendica\Util\Arrays;
16 use Friendica\Util\DateTimeFormat;
17 use Monolog\Handler\TestHandler;
19 require_once __DIR__ . '/../../include/api.php';
22 * Tests for the API functions.
24 * Functions that use header() need to be tested in a separate process.
25 * @see https://phpunit.de/manual/5.7/en/appendixes.annotations.html#appendixes.annotations.runTestsInSeparateProcesses
27 * @backupGlobals enabled
29 class ApiTest extends FixtureTest
32 * @var TestHandler Can handle log-outputs
39 protected $friendUser;
43 protected $wrongUserId;
48 /** @var IManageConfigValues */
52 * Create variables used by tests.
54 protected function setUp() : void
56 global $API, $called_api;
62 /** @var IManageConfigValues $config */
63 $this->config = $this->dice->create(IManageConfigValues::class);
65 $this->config->set('system', 'url', 'http://localhost');
66 $this->config->set('system', 'hostname', 'localhost');
67 $this->config->set('system', 'worker_dont_fork', true);
70 $this->config->set('config', 'hostname', 'localhost');
71 $this->config->set('system', 'throttle_limit_day', 100);
72 $this->config->set('system', 'throttle_limit_week', 100);
73 $this->config->set('system', 'throttle_limit_month', 100);
74 $this->config->set('system', 'theme', 'system_theme');
78 $this->app = DI::app();
80 DI::args()->setArgc(1);
82 // User data that the test database is populated with
85 'name' => 'Self contact',
86 'nick' => 'selfcontact',
87 'nurl' => 'http://localhost/profile/selfcontact'
91 'name' => 'Friend contact',
92 'nick' => 'friendcontact',
93 'nurl' => 'http://localhost/profile/friendcontact'
97 'name' => 'othercontact',
98 'nick' => 'othercontact',
99 'nurl' => 'http://localhost/profile/othercontact'
102 // User ID that we know is not in the database
103 $this->wrongUserId = 666;
105 DI::session()->start();
107 // Most API require login so we force the session
109 'authenticated' => true,
110 'uid' => $this->selfUser['id']
112 BasicAuth::setCurrentUserID($this->selfUser['id']);
116 * Assert that an user array contains expected keys.
118 * @param array $user User array
122 private function assertSelfUser(array $user)
124 self::assertEquals($this->selfUser['id'], $user['uid']);
125 self::assertEquals($this->selfUser['id'], $user['cid']);
126 self::assertEquals(1, $user['self']);
127 self::assertEquals('DFRN', $user['location']);
128 self::assertEquals($this->selfUser['name'], $user['name']);
129 self::assertEquals($this->selfUser['nick'], $user['screen_name']);
130 self::assertEquals('dfrn', $user['network']);
131 self::assertTrue($user['verified']);
135 * Assert that an user array contains expected keys.
137 * @param array $user User array
141 private function assertOtherUser(array $user = [])
143 self::assertEquals($this->otherUser['id'], $user['id']);
144 self::assertEquals($this->otherUser['id'], $user['id_str']);
145 self::assertEquals($this->otherUser['name'], $user['name']);
146 self::assertEquals($this->otherUser['nick'], $user['screen_name']);
147 self::assertFalse($user['verified']);
151 * Assert that a status array contains expected keys.
153 * @param array $status Status array
157 private function assertStatus(array $status = [])
159 self::assertIsString($status['text'] ?? '');
160 self::assertIsInt($status['id'] ?? '');
161 // We could probably do more checks here.
165 * Assert that a list array contains expected keys.
167 * @param array $list List array
171 private function assertList(array $list = [])
173 self::assertIsString($list['name']);
174 self::assertIsInt($list['id']);
175 self::assertIsString('string', $list['id_str']);
176 self::assertContains($list['mode'], ['public', 'private']);
177 // We could probably do more checks here.
181 * Assert that the string is XML and contain the root element.
183 * @param string $result XML string
184 * @param string $root_element Root element name
188 private function assertXml($result = '', $root_element = '')
190 self::assertStringStartsWith('<?xml version="1.0"?>', $result);
191 self::assertStringContainsString('<' . $root_element, $result);
192 // We could probably do more checks here.
196 * Test the api_user() function.
200 public function testApiUser()
202 self::assertEquals($this->selfUser['id'], BaseApi::getCurrentUserID());
206 * Test the api_user() function with an unallowed user.
210 public function testApiUserWithUnallowedUser()
212 // self::assertEquals(false, api_user());
216 * Test the api_source() function.
220 public function testApiSource()
222 self::assertEquals('api', BasicAuth::getCurrentApplicationToken()['name']);
226 * Test the api_source() function with a Twidere user agent.
230 public function testApiSourceWithTwidere()
232 $_SERVER['HTTP_USER_AGENT'] = 'Twidere';
233 self::assertEquals('Twidere', BasicAuth::getCurrentApplicationToken()['name']);
237 * Test the api_source() function with a GET parameter.
241 public function testApiSourceWithGet()
243 $_REQUEST['source'] = 'source_name';
244 self::assertEquals('source_name', BasicAuth::getCurrentApplicationToken()['name']);
248 * Test the api_date() function.
252 public function testApiDate()
254 self::assertEquals('Wed Oct 10 00:00:00 +0000 1990', DateTimeFormat::utc('1990-10-10', DateTimeFormat::API));
258 * Test the api_register_func() function.
262 public function testApiRegisterFunc()
274 self::assertTrue(is_callable($API['api_path']['func']));
278 * Test the BasicAuth::getCurrentUserID() function without any login.
280 * @runInSeparateProcess
281 * @preserveGlobalState disabled
282 * @preserveGlobalState disabled
284 public function testApiLoginWithoutLogin()
286 BasicAuth::setCurrentUserID();
287 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
288 BasicAuth::getCurrentUserID(true);
292 * Test the BasicAuth::getCurrentUserID() function with a bad login.
294 * @runInSeparateProcess
295 * @preserveGlobalState disabled
296 * @preserveGlobalState disabled
298 public function testApiLoginWithBadLogin()
300 BasicAuth::setCurrentUserID();
301 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
302 $_SERVER['PHP_AUTH_USER'] = 'user@server';
303 BasicAuth::getCurrentUserID(true);
307 * Test the BasicAuth::getCurrentUserID() function with oAuth.
311 public function testApiLoginWithOauth()
313 $this->markTestIncomplete('Can we test this easily?');
317 * Test the BasicAuth::getCurrentUserID() function with authentication provided by an addon.
321 public function testApiLoginWithAddonAuth()
323 $this->markTestIncomplete('Can we test this easily?');
327 * Test the BasicAuth::getCurrentUserID() function with a correct login.
329 * @runInSeparateProcess
330 * @preserveGlobalState disabled
331 * @doesNotPerformAssertions
333 public function testApiLoginWithCorrectLogin()
335 BasicAuth::setCurrentUserID();
336 $_SERVER['PHP_AUTH_USER'] = 'Test user';
337 $_SERVER['PHP_AUTH_PW'] = 'password';
338 BasicAuth::getCurrentUserID(true);
342 * Test the BasicAuth::getCurrentUserID() function with a remote user.
344 * @runInSeparateProcess
345 * @preserveGlobalState disabled
347 public function testApiLoginWithRemoteUser()
349 BasicAuth::setCurrentUserID();
350 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
351 $_SERVER['REDIRECT_REMOTE_USER'] = '123456dXNlcjpwYXNzd29yZA==';
352 BasicAuth::getCurrentUserID(true);
356 * Test the api_call() function.
358 * @runInSeparateProcess
359 * @preserveGlobalState disabled
361 public function testApiCall()
365 'method' => 'method',
366 'func' => function () {
367 return ['data' => ['some_data']];
370 $_SERVER['REQUEST_METHOD'] = 'method';
371 $_SERVER['QUERY_STRING'] = 'pagename=api_path';
372 $_GET['callback'] = 'callback_name';
375 'callback_name(["some_data"])',
376 api_call('api_path', 'json')
381 * Test the api_call() function with the profiled enabled.
383 * @runInSeparateProcess
384 * @preserveGlobalState disabled
386 public function testApiCallWithProfiler()
390 'method' => 'method',
391 'func' => function () {
392 return ['data' => ['some_data']];
396 $_SERVER['REQUEST_METHOD'] = 'method';
397 $_SERVER['QUERY_STRING'] = 'pagename=api_path';
399 $this->config->set('system', 'profiler', true);
400 $this->config->set('rendertime', 'callstack', true);
401 $this->app->callstack = [
402 'database' => ['some_function' => 200],
403 'database_write' => ['some_function' => 200],
404 'cache' => ['some_function' => 200],
405 'cache_write' => ['some_function' => 200],
406 'network' => ['some_function' => 200]
411 api_call('api_path', 'json')
416 * Test the api_call() function with a JSON result.
418 * @runInSeparateProcess
419 * @preserveGlobalState disabled
421 public function testApiCallWithJson()
425 'method' => 'method',
426 'func' => function () {
427 return ['data' => ['some_data']];
430 $_SERVER['REQUEST_METHOD'] = 'method';
431 $_SERVER['QUERY_STRING'] = 'pagename=api_path.json';
435 api_call('api_path.json', 'json')
440 * Test the api_call() function with an XML result.
442 * @runInSeparateProcess
443 * @preserveGlobalState disabled
445 public function testApiCallWithXml()
449 'method' => 'method',
450 'func' => function () {
454 $_SERVER['REQUEST_METHOD'] = 'method';
455 $_SERVER['QUERY_STRING'] = 'pagename=api_path.xml';
457 $args = DI::args()->determine($_SERVER, $_GET);
461 api_call('api_path.xml', 'xml')
466 * Test the api_call() function with an RSS result.
468 * @runInSeparateProcess
469 * @preserveGlobalState disabled
471 public function testApiCallWithRss()
475 'method' => 'method',
476 'func' => function () {
480 $_SERVER['REQUEST_METHOD'] = 'method';
481 $_SERVER['QUERY_STRING'] = 'pagename=api_path.rss';
484 '<?xml version="1.0" encoding="UTF-8"?>' . "\n" .
486 api_call('api_path.rss', 'rss')
491 * Test the api_call() function with an Atom result.
493 * @runInSeparateProcess
494 * @preserveGlobalState disabled
496 public function testApiCallWithAtom()
500 'method' => 'method',
501 'func' => function () {
505 $_SERVER['REQUEST_METHOD'] = 'method';
506 $_SERVER['QUERY_STRING'] = 'pagename=api_path.atom';
509 '<?xml version="1.0" encoding="UTF-8"?>' . "\n" .
511 api_call('api_path.atom', 'atom')
516 * Test the api_rss_extra() function.
520 public function testApiRssExtra()
523 $user_info = ['url' => 'user_url', 'lang' => 'en'];
524 $result = api_rss_extra([], $user_info);
525 self::assertEquals($user_info, $result['$user']);
526 self::assertEquals($user_info['url'], $result['$rss']['alternate']);
527 self::assertArrayHasKey('self', $result['$rss']);
528 self::assertArrayHasKey('base', $result['$rss']);
529 self::assertArrayHasKey('updated', $result['$rss']);
530 self::assertArrayHasKey('atom_updated', $result['$rss']);
531 self::assertArrayHasKey('language', $result['$rss']);
532 self::assertArrayHasKey('logo', $result['$rss']);
537 * Test the api_rss_extra() function without any user info.
541 public function testApiRssExtraWithoutUserInfo()
544 $result = api_rss_extra([], null);
545 self::assertIsArray($result['$user']);
546 self::assertArrayHasKey('alternate', $result['$rss']);
547 self::assertArrayHasKey('self', $result['$rss']);
548 self::assertArrayHasKey('base', $result['$rss']);
549 self::assertArrayHasKey('updated', $result['$rss']);
550 self::assertArrayHasKey('atom_updated', $result['$rss']);
551 self::assertArrayHasKey('language', $result['$rss']);
552 self::assertArrayHasKey('logo', $result['$rss']);
557 * Test the api_get_user() function.
561 public function testApiGetUser()
563 // $user = api_get_user();
564 // self::assertSelfUser($user);
565 // self::assertEquals('708fa0', $user['profile_sidebar_fill_color']);
566 // self::assertEquals('6fdbe8', $user['profile_link_color']);
567 // self::assertEquals('ededed', $user['profile_background_color']);
571 * Test the api_get_user() function with a Frio schema.
575 public function testApiGetUserWithFrioSchema()
577 // $pConfig = $this->dice->create(IManagePersonalConfigValues::class);
578 // $pConfig->set($this->selfUser['id'], 'frio', 'schema', 'red');
579 // $user = api_get_user();
580 // self::assertSelfUser($user);
581 // self::assertEquals('708fa0', $user['profile_sidebar_fill_color']);
582 // self::assertEquals('6fdbe8', $user['profile_link_color']);
583 // self::assertEquals('ededed', $user['profile_background_color']);
587 * Test the api_get_user() function with an empty Frio schema.
591 public function testApiGetUserWithEmptyFrioSchema()
593 // $pConfig = $this->dice->create(IManagePersonalConfigValues::class);
594 // $pConfig->set($this->selfUser['id'], 'frio', 'schema', '---');
595 // $user = api_get_user();
596 // self::assertSelfUser($user);
597 // self::assertEquals('708fa0', $user['profile_sidebar_fill_color']);
598 // self::assertEquals('6fdbe8', $user['profile_link_color']);
599 // self::assertEquals('ededed', $user['profile_background_color']);
603 * Test the api_get_user() function with a custom Frio schema.
607 public function testApiGetUserWithCustomFrioSchema()
609 // $pConfig = $this->dice->create(IManagePersonalConfigValues::class);
610 // $pConfig->set($this->selfUser['id'], 'frio', 'schema', '---');
611 // $pConfig->set($this->selfUser['id'], 'frio', 'nav_bg', '#123456');
612 // $pConfig->set($this->selfUser['id'], 'frio', 'link_color', '#123456');
613 // $pConfig->set($this->selfUser['id'], 'frio', 'background_color', '#123456');
614 // $user = api_get_user();
615 // self::assertSelfUser($user);
616 // self::assertEquals('123456', $user['profile_sidebar_fill_color']);
617 // self::assertEquals('123456', $user['profile_link_color']);
618 // self::assertEquals('123456', $user['profile_background_color']);
622 * Test the api_get_user() function with an user that is not allowed to use the API.
624 * @runInSeparateProcess
625 * @preserveGlobalState disabled
627 public function testApiGetUserWithoutApiUser()
629 // api_get_user() with empty parameters is not used anymore
631 $_SERVER['PHP_AUTH_USER'] = 'Test user';
632 $_SERVER['PHP_AUTH_PW'] = 'password';
633 BasicAuth::setCurrentUserID();
634 self::assertFalse(api_get_user());
639 * Test the api_get_user() function with an user ID in a GET parameter.
643 public function testApiGetUserWithGetId()
645 // self::assertOtherUser(api_get_user());
649 * Test the api_get_user() function with a wrong user ID in a GET parameter.
653 public function testApiGetUserWithWrongGetId()
655 // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
656 // self::assertOtherUser(api_get_user());
660 * Test the api_get_user() function with an user name in a GET parameter.
664 public function testApiGetUserWithGetName()
666 // self::assertSelfUser(api_get_user());
670 * Test the api_get_user() function with a profile URL in a GET parameter.
674 public function testApiGetUserWithGetUrl()
676 // self::assertSelfUser(api_get_user());
680 * Test the api_get_user() function with an user ID in the API path.
684 public function testApiGetUserWithNumericCalledApi()
686 // global $called_api;
687 // $called_api = ['api_path'];
688 // DI::args()->setArgv(['', $this->otherUser['id'] . '.json']);
689 // self::assertOtherUser(api_get_user());
693 * Test the api_get_user() function with the $called_api global variable.
697 public function testApiGetUserWithCalledApi()
699 // global $called_api;
700 // $called_api = ['api', 'api_path'];
701 // self::assertSelfUser(api_get_user());
705 * Test the Arrays::walkRecursive() function.
709 public function testApiWalkRecursive()
714 Arrays::walkRecursive(
717 // Should we test this with a callback that actually does something?
725 * Test the Arrays::walkRecursive() function with an array.
729 public function testApiWalkRecursiveWithArray()
731 $array = [['item1'], ['item2']];
734 Arrays::walkRecursive(
737 // Should we test this with a callback that actually does something?
745 * Test the BaseApi::reformatXML() function.
749 public function testApiReformatXml()
753 self::assertTrue(ApiResponse::reformatXML($item, $key));
754 self::assertEquals('true', $item);
758 * Test the BaseApi::reformatXML() function with a statusnet_api key.
762 public function testApiReformatXmlWithStatusnetKey()
765 $key = 'statusnet_api';
766 self::assertTrue(ApiResponse::reformatXML($item, $key));
767 self::assertEquals('statusnet:api', $key);
771 * Test the BaseApi::reformatXML() function with a friendica_api key.
775 public function testApiReformatXmlWithFriendicaKey()
778 $key = 'friendica_api';
779 self::assertTrue(ApiResponse::reformatXML($item, $key));
780 self::assertEquals('friendica:api', $key);
784 * Test the BaseApi::createXML() function.
788 public function testApiCreateXml()
791 '<?xml version="1.0"?>' . "\n" .
792 '<root_element xmlns="http://api.twitter.com" xmlns:statusnet="http://status.net/schema/api/1/" ' .
793 'xmlns:friendica="http://friendi.ca/schema/api/1/" ' .
794 'xmlns:georss="http://www.georss.org/georss">' . "\n" .
795 ' <data>some_data</data>' . "\n" .
796 '</root_element>' . "\n",
797 DI::apiResponse()->createXML(['data' => ['some_data']], 'root_element')
802 * Test the BaseApi::createXML() function without any XML namespace.
806 public function testApiCreateXmlWithoutNamespaces()
809 '<?xml version="1.0"?>' . "\n" .
811 ' <data>some_data</data>' . "\n" .
813 DI::apiResponse()->createXML(['data' => ['some_data']], 'ok')
818 * Test the BaseApi::formatData() function.
822 public function testApiFormatData()
824 $data = ['some_data'];
825 self::assertEquals($data, DI::apiResponse()->formatData('root_element', 'json', $data));
829 * Test the BaseApi::formatData() function with an XML result.
833 public function testApiFormatDataWithXml()
836 '<?xml version="1.0"?>' . "\n" .
837 '<root_element xmlns="http://api.twitter.com" xmlns:statusnet="http://status.net/schema/api/1/" ' .
838 'xmlns:friendica="http://friendi.ca/schema/api/1/" ' .
839 'xmlns:georss="http://www.georss.org/georss">' . "\n" .
840 ' <data>some_data</data>' . "\n" .
841 '</root_element>' . "\n",
842 DI::apiResponse()->formatData('root_element', 'xml', ['data' => ['some_data']])
847 * Test the api_statuses_mediap() function.
851 public function testApiStatusesMediap()
854 DI::args()->setArgc(2);
862 'tmp_name' => $this->getTempImage(),
863 'name' => 'spacer.png',
864 'type' => 'image/png'
867 $_GET['status'] = '<b>Status content</b>';
869 $result = api_statuses_mediap('json');
870 self::assertStatus($result['status']);
875 * Test the api_statuses_mediap() function without an authenticated user.
879 public function testApiStatusesMediapWithoutAuthenticatedUser()
881 // $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
882 // BasicAuth::setCurrentUserID();
883 // $_SESSION['authenticated'] = false;
884 // api_statuses_mediap('json');
888 * Test the api_statuses_update() function.
892 public function testApiStatusesUpdate()
895 $_REQUEST['status'] = 'Status content #friendica';
896 $_REQUEST['in_reply_to_status_id'] = -1;
897 $_REQUEST['lat'] = 48;
898 $_REQUEST['long'] = 7;
905 'tmp_name' => $this->getTempImage(),
906 'name' => 'spacer.png',
907 'type' => 'image/png'
911 $result = api_statuses_update('json');
912 self::assertStatus($result['status']);
917 * Test the api_statuses_update() function with an HTML status.
921 public function testApiStatusesUpdateWithHtml()
924 $_REQUEST['htmlstatus'] = '<b>Status content</b>';
926 $result = api_statuses_update('json');
927 self::assertStatus($result['status']);
932 * Test the api_statuses_update() function without an authenticated user.
936 public function testApiStatusesUpdateWithoutAuthenticatedUser()
939 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
940 BasicAuth::setCurrentUserID();
941 $_SESSION['authenticated'] = false;
942 api_statuses_update('json');
947 * Test the api_statuses_update() function with a parent status.
951 public function testApiStatusesUpdateWithParent()
953 $this->markTestIncomplete('This triggers an exit() somewhere and kills PHPUnit.');
957 * Test the api_statuses_update() function with a media_ids parameter.
961 public function testApiStatusesUpdateWithMediaIds()
963 $this->markTestIncomplete();
967 * Test the api_statuses_update() function with the throttle limit reached.
971 public function testApiStatusesUpdateWithDayThrottleReached()
973 $this->markTestIncomplete();
979 * Test the api_statuses_repeat() function.
983 public function testApiStatusesRepeat()
985 // $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
986 // api_statuses_repeat('json');
990 * Test the api_statuses_repeat() function without an authenticated user.
994 public function testApiStatusesRepeatWithoutAuthenticatedUser()
996 // $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
997 // BasicAuth::setCurrentUserID();
998 // $_SESSION['authenticated'] = false;
999 // api_statuses_repeat('json');
1003 * Test the api_statuses_repeat() function with an ID.
1007 public function testApiStatusesRepeatWithId()
1009 // DI::args()->setArgv(['', '', '', 1]);
1010 // $result = api_statuses_repeat('json');
1011 // self::assertStatus($result['status']);
1013 // Also test with a shared status
1014 // DI::args()->setArgv(['', '', '', 5]);
1015 // $result = api_statuses_repeat('json');
1016 // self::assertStatus($result['status']);
1020 * Test the api_favorites_create_destroy() function.
1024 public function testApiFavoritesCreateDestroy()
1026 // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1027 // DI::args()->setArgv(['api', '1.1', 'favorites', 'create']);
1028 // api_favorites_create_destroy('json');
1032 * Test the api_favorites_create_destroy() function with an invalid ID.
1036 public function testApiFavoritesCreateDestroyWithInvalidId()
1038 // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1039 // DI::args()->setArgv(['api', '1.1', 'favorites', 'create', '12.json']);
1040 // api_favorites_create_destroy('json');
1044 * Test the api_favorites_create_destroy() function with an invalid action.
1048 public function testApiFavoritesCreateDestroyWithInvalidAction()
1050 // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1051 // DI::args()->setArgv(['api', '1.1', 'favorites', 'change.json']);
1052 // $_REQUEST['id'] = 1;
1053 // api_favorites_create_destroy('json');
1057 * Test the api_favorites_create_destroy() function with the create action.
1061 public function testApiFavoritesCreateDestroyWithCreateAction()
1063 // DI::args()->setArgv(['api', '1.1', 'favorites', 'create.json']);
1064 // $_REQUEST['id'] = 3;
1065 // $result = api_favorites_create_destroy('json');
1066 // self::assertStatus($result['status']);
1070 * Test the api_favorites_create_destroy() function with the create action and an RSS result.
1074 public function testApiFavoritesCreateDestroyWithCreateActionAndRss()
1076 // DI::args()->setArgv(['api', '1.1', 'favorites', 'create.rss']);
1077 // $_REQUEST['id'] = 3;
1078 // $result = api_favorites_create_destroy('rss');
1079 // self::assertXml($result, 'status');
1083 * Test the api_favorites_create_destroy() function with the destroy action.
1087 public function testApiFavoritesCreateDestroyWithDestroyAction()
1089 // DI::args()->setArgv(['api', '1.1', 'favorites', 'destroy.json']);
1090 // $_REQUEST['id'] = 3;
1091 // $result = api_favorites_create_destroy('json');
1092 // self::assertStatus($result['status']);
1096 * Test the api_favorites_create_destroy() function without an authenticated user.
1100 public function testApiFavoritesCreateDestroyWithoutAuthenticatedUser()
1103 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1104 DI::args()->setArgv(['api', '1.1', 'favorites', 'create.json']);
1105 BasicAuth::setCurrentUserID();
1106 $_SESSION['authenticated'] = false;
1107 api_favorites_create_destroy('json');
1114 * Test the api_format_messages() function.
1118 public function testApiFormatMessages()
1120 $result = api_format_messages(
1121 ['id' => 1, 'uri-id' => 1, 'title' => 'item_title', 'body' => '[b]item_body[/b]'],
1122 ['id' => 2, 'uri-id' => 2, 'screen_name' => 'recipient_name'],
1123 ['id' => 3, 'uri-id' => 2, 'screen_name' => 'sender_name']
1125 self::assertEquals('item_title' . "\n" . 'item_body', $result['text']);
1126 self::assertEquals(1, $result['id']);
1127 self::assertEquals(2, $result['recipient_id']);
1128 self::assertEquals(3, $result['sender_id']);
1129 self::assertEquals('recipient_name', $result['recipient_screen_name']);
1130 self::assertEquals('sender_name', $result['sender_screen_name']);
1134 * Test the api_format_messages() function with HTML.
1138 public function testApiFormatMessagesWithHtmlText()
1140 $_GET['getText'] = 'html';
1141 $result = api_format_messages(
1142 ['id' => 1, 'uri-id' => 1, 'title' => 'item_title', 'body' => '[b]item_body[/b]'],
1143 ['id' => 2, 'uri-id' => 2, 'screen_name' => 'recipient_name'],
1144 ['id' => 3, 'uri-id' => 3, 'screen_name' => 'sender_name']
1146 self::assertEquals('item_title', $result['title']);
1147 self::assertEquals('<strong>item_body</strong>', $result['text']);
1151 * Test the api_format_messages() function with plain text.
1155 public function testApiFormatMessagesWithPlainText()
1157 $_GET['getText'] = 'plain';
1158 $result = api_format_messages(
1159 ['id' => 1, 'uri-id' => 1, 'title' => 'item_title', 'body' => '[b]item_body[/b]'],
1160 ['id' => 2, 'uri-id' => 2, 'screen_name' => 'recipient_name'],
1161 ['id' => 3, 'uri-id' => 3, 'screen_name' => 'sender_name']
1163 self::assertEquals('item_title', $result['title']);
1164 self::assertEquals('item_body', $result['text']);
1168 * Test the api_format_messages() function with the getUserObjects GET parameter set to false.
1172 public function testApiFormatMessagesWithoutUserObjects()
1174 $_GET['getUserObjects'] = 'false';
1175 $result = api_format_messages(
1176 ['id' => 1, 'uri-id' => 1, 'title' => 'item_title', 'body' => '[b]item_body[/b]'],
1177 ['id' => 2, 'uri-id' => 2, 'screen_name' => 'recipient_name'],
1178 ['id' => 3, 'uri-id' => 3, 'screen_name' => 'sender_name']
1180 self::assertTrue(!isset($result['sender']));
1181 self::assertTrue(!isset($result['recipient']));
1185 * Test the api_convert_item() function.
1189 public function testApiConvertItem()
1192 $result = api_convert_item(
1194 'network' => 'feed',
1195 'title' => 'item_title',
1197 // We need a long string to test that it is correctly cut
1198 'body' => 'perspiciatis impedit voluptatem quis molestiae ea qui ' .
1199 'reiciendis dolorum aut ducimus sunt consequatur inventore dolor ' .
1200 'officiis pariatur doloremque nemo culpa aut quidem qui dolore ' .
1201 'laudantium atque commodi alias voluptatem non possimus aperiam ' .
1202 'ipsum rerum consequuntur aut amet fugit quia aliquid praesentium ' .
1203 'repellendus quibusdam et et inventore mollitia rerum sit autem ' .
1204 'pariatur maiores ipsum accusantium perferendis vel sit possimus ' .
1205 'veritatis nihil distinctio qui eum repellat officia illum quos ' .
1206 'impedit quam iste esse unde qui suscipit aut facilis ut inventore ' .
1207 'omnis exercitationem quo magnam consequatur maxime aut illum ' .
1208 'soluta quaerat natus unde aspernatur et sed beatae nihil ullam ' .
1209 'temporibus corporis ratione blanditiis perspiciatis impedit ' .
1210 'voluptatem quis molestiae ea qui reiciendis dolorum aut ducimus ' .
1211 'sunt consequatur inventore dolor officiis pariatur doloremque ' .
1212 'nemo culpa aut quidem qui dolore laudantium atque commodi alias ' .
1213 'voluptatem non possimus aperiam ipsum rerum consequuntur aut ' .
1214 'amet fugit quia aliquid praesentium repellendus quibusdam et et ' .
1215 'inventore mollitia rerum sit autem pariatur maiores ipsum accusantium ' .
1216 'perferendis vel sit possimus veritatis nihil distinctio qui eum ' .
1217 'repellat officia illum quos impedit quam iste esse unde qui ' .
1218 'suscipit aut facilis ut inventore omnis exercitationem quo magnam ' .
1219 'consequatur maxime aut illum soluta quaerat natus unde aspernatur ' .
1220 'et sed beatae nihil ullam temporibus corporis ratione blanditiis',
1221 'plink' => 'item_plink'
1224 self::assertStringStartsWith('item_title', $result['text']);
1225 self::assertStringStartsWith('<h4>item_title</h4><br>perspiciatis impedit voluptatem', $result['html']);
1230 * Test the api_convert_item() function with an empty item body.
1234 public function testApiConvertItemWithoutBody()
1237 $result = api_convert_item(
1239 'network' => 'feed',
1240 'title' => 'item_title',
1243 'plink' => 'item_plink'
1246 self::assertEquals("item_title", $result['text']);
1247 self::assertEquals('<h4>item_title</h4><br>item_plink', $result['html']);
1252 * Test the api_convert_item() function with the title in the body.
1256 public function testApiConvertItemWithTitleInBody()
1259 $result = api_convert_item(
1261 'title' => 'item_title',
1262 'body' => 'item_title item_body',
1266 self::assertEquals('item_title item_body', $result['text']);
1267 self::assertEquals('<h4>item_title</h4><br>item_title item_body', $result['html']);
1272 * Test the api_get_attachments() function.
1276 public function testApiGetAttachments()
1279 // self::assertEmpty(api_get_attachments($body, 0));
1283 * Test the api_get_attachments() function with an img tag.
1287 public function testApiGetAttachmentsWithImage()
1289 // $body = '[img]http://via.placeholder.com/1x1.png[/img]';
1290 // self::assertIsArray(api_get_attachments($body, 0));
1294 * Test the api_get_attachments() function with an img tag and an AndStatus user agent.
1298 public function testApiGetAttachmentsWithImageAndAndStatus()
1300 // $_SERVER['HTTP_USER_AGENT'] = 'AndStatus';
1301 // $body = '[img]http://via.placeholder.com/1x1.png[/img]';
1302 // self::assertIsArray(api_get_attachments($body, 0));
1306 * Test the api_get_entitities() function.
1310 public function testApiGetEntitities()
1313 // self::assertIsArray(api_get_entitities($text, 'bbcode', 0));
1317 * Test the api_get_entitities() function with the include_entities parameter.
1321 public function testApiGetEntititiesWithIncludeEntities()
1324 $_REQUEST['include_entities'] = 'true';
1326 $result = api_get_entitities($text, 'bbcode', 0);
1327 self::assertIsArray($result['hashtags']);
1328 self::assertIsArray($result['symbols']);
1329 self::assertIsArray($result['urls']);
1330 self::assertIsArray($result['user_mentions']);
1335 * Test the api_format_items_embeded_images() function.
1339 public function testApiFormatItemsEmbededImages()
1343 'text ' . DI::baseUrl() . '/display/item_guid',
1344 api_format_items_embeded_images(['guid' => 'item_guid'], 'text data:image/foo')
1350 * Test the api_format_items_activities() function.
1354 public function testApiFormatItemsActivities()
1356 $item = ['uid' => 0, 'uri-id' => 1];
1357 $result = DI::friendicaActivities()->createFromUriId($item['uri-id'], $item['uid']);
1358 self::assertArrayHasKey('like', $result);
1359 self::assertArrayHasKey('dislike', $result);
1360 self::assertArrayHasKey('attendyes', $result);
1361 self::assertArrayHasKey('attendno', $result);
1362 self::assertArrayHasKey('attendmaybe', $result);
1366 * Test the api_format_items_activities() function with an XML result.
1370 public function testApiFormatItemsActivitiesWithXml()
1372 $item = ['uid' => 0, 'uri-id' => 1];
1373 $result = DI::friendicaActivities()->createFromUriId($item['uri-id'], $item['uid'], 'xml');
1374 self::assertArrayHasKey('friendica:like', $result);
1375 self::assertArrayHasKey('friendica:dislike', $result);
1376 self::assertArrayHasKey('friendica:attendyes', $result);
1377 self::assertArrayHasKey('friendica:attendno', $result);
1378 self::assertArrayHasKey('friendica:attendmaybe', $result);
1382 * Test the api_format_items() function.
1383 * @doesNotPerformAssertions
1385 public function testApiFormatItems()
1388 $items = Post::selectToArray([], ['uid' => 42]);
1389 foreach ($items as $item) {
1390 $status = api_format_item($item);
1391 self::assertStatus($status);
1397 * Test the api_format_items() function with an XML result.
1398 * @doesNotPerformAssertions
1400 public function testApiFormatItemsWithXml()
1403 $items = Post::selectToArray([], ['uid' => 42]);
1404 foreach ($items as $item) {
1405 $status = api_format_item($item, 'xml');
1406 self::assertStatus($status);
1412 * Test the api_lists_list() function.
1416 public function testApiListsList()
1418 $result = api_lists_list('json');
1419 self::assertEquals(['lists_list' => []], $result);
1423 * Test the api_lists_ownerships() function.
1427 public function testApiListsOwnerships()
1429 $result = api_lists_ownerships('json');
1430 foreach ($result['lists']['lists'] as $list) {
1431 self::assertList($list);
1436 * Test the api_lists_ownerships() function without an authenticated user.
1440 public function testApiListsOwnershipsWithoutAuthenticatedUser()
1442 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1443 BasicAuth::setCurrentUserID();
1444 $_SESSION['authenticated'] = false;
1445 api_lists_ownerships('json');
1449 * Test the api_statuses_f() function.
1453 public function testApiStatusesFWithIncoming()
1455 // $result = api_statuses_f('incoming');
1456 // self::assertArrayHasKey('user', $result);
1461 * Test the api_direct_messages_new() function.
1465 public function testApiDirectMessagesNew()
1467 $result = api_direct_messages_new('json');
1468 self::assertNull($result);
1472 * Test the api_direct_messages_new() function without an authenticated user.
1476 public function testApiDirectMessagesNewWithoutAuthenticatedUser()
1478 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1479 BasicAuth::setCurrentUserID();
1480 $_SESSION['authenticated'] = false;
1481 api_direct_messages_new('json');
1485 * Test the api_direct_messages_new() function with an user ID.
1489 public function testApiDirectMessagesNewWithUserId()
1491 $_POST['text'] = 'message_text';
1492 $_REQUEST['user_id'] = $this->otherUser['id'];
1493 $result = api_direct_messages_new('json');
1494 self::assertEquals(['direct_message' => ['error' => -1]], $result);
1498 * Test the api_direct_messages_new() function with a screen name.
1502 public function testApiDirectMessagesNewWithScreenName()
1504 $this->app->setLoggedInUserNickname($this->selfUser['nick']);
1505 $_POST['text'] = 'message_text';
1506 $_REQUEST['user_id'] = $this->friendUser['id'];
1507 $result = api_direct_messages_new('json');
1508 self::assertStringContainsString('message_text', $result['direct_message']['text']);
1509 self::assertEquals('selfcontact', $result['direct_message']['sender_screen_name']);
1510 self::assertEquals(1, $result['direct_message']['friendica_seen']);
1514 * Test the api_direct_messages_new() function with a title.
1518 public function testApiDirectMessagesNewWithTitle()
1520 $this->app->setLoggedInUserNickname($this->selfUser['nick']);
1521 $_POST['text'] = 'message_text';
1522 $_REQUEST['user_id'] = $this->friendUser['id'];
1523 $_REQUEST['title'] = 'message_title';
1524 $result = api_direct_messages_new('json');
1525 self::assertStringContainsString('message_text', $result['direct_message']['text']);
1526 self::assertStringContainsString('message_title', $result['direct_message']['text']);
1527 self::assertEquals('selfcontact', $result['direct_message']['sender_screen_name']);
1528 self::assertEquals(1, $result['direct_message']['friendica_seen']);
1532 * Test the api_direct_messages_new() function with an RSS result.
1536 public function testApiDirectMessagesNewWithRss()
1538 $this->app->setLoggedInUserNickname($this->selfUser['nick']);
1539 $_POST['text'] = 'message_text';
1540 $_REQUEST['user_id'] = $this->friendUser['id'];
1541 $result = api_direct_messages_new('rss');
1542 self::assertXml($result, 'direct-messages');
1546 * Test the api_direct_messages_destroy() function.
1550 public function testApiDirectMessagesDestroy()
1552 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1553 api_direct_messages_destroy('json');
1557 * Test the api_direct_messages_destroy() function with the friendica_verbose GET param.
1561 public function testApiDirectMessagesDestroyWithVerbose()
1563 $_GET['friendica_verbose'] = 'true';
1564 $result = api_direct_messages_destroy('json');
1568 'result' => 'error',
1569 'message' => 'message id or parenturi not specified'
1577 * Test the api_direct_messages_destroy() function without an authenticated user.
1581 public function testApiDirectMessagesDestroyWithoutAuthenticatedUser()
1583 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1584 BasicAuth::setCurrentUserID();
1585 $_SESSION['authenticated'] = false;
1586 api_direct_messages_destroy('json');
1590 * Test the api_direct_messages_destroy() function with a non-zero ID.
1594 public function testApiDirectMessagesDestroyWithId()
1596 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1597 $_REQUEST['id'] = 1;
1598 api_direct_messages_destroy('json');
1602 * Test the api_direct_messages_destroy() with a non-zero ID and the friendica_verbose GET param.
1606 public function testApiDirectMessagesDestroyWithIdAndVerbose()
1608 $_REQUEST['id'] = 1;
1609 $_REQUEST['friendica_parenturi'] = 'parent_uri';
1610 $_GET['friendica_verbose'] = 'true';
1611 $result = api_direct_messages_destroy('json');
1615 'result' => 'error',
1616 'message' => 'message id not in database'
1624 * Test the api_direct_messages_destroy() function with a non-zero ID.
1628 public function testApiDirectMessagesDestroyWithCorrectId()
1630 $this->markTestIncomplete('We need to add a dataset for this.');
1634 * Test the api_direct_messages_box() function.
1638 public function testApiDirectMessagesBoxWithSentbox()
1640 $_REQUEST['page'] = -1;
1641 $_REQUEST['max_id'] = 10;
1642 $result = api_direct_messages_box('json', 'sentbox', 'false');
1643 self::assertArrayHasKey('direct_message', $result);
1647 * Test the api_direct_messages_box() function.
1651 public function testApiDirectMessagesBoxWithConversation()
1653 $result = api_direct_messages_box('json', 'conversation', 'false');
1654 self::assertArrayHasKey('direct_message', $result);
1658 * Test the api_direct_messages_box() function.
1662 public function testApiDirectMessagesBoxWithAll()
1664 $result = api_direct_messages_box('json', 'all', 'false');
1665 self::assertArrayHasKey('direct_message', $result);
1669 * Test the api_direct_messages_box() function.
1673 public function testApiDirectMessagesBoxWithInbox()
1675 $result = api_direct_messages_box('json', 'inbox', 'false');
1676 self::assertArrayHasKey('direct_message', $result);
1680 * Test the api_direct_messages_box() function.
1684 public function testApiDirectMessagesBoxWithVerbose()
1686 $result = api_direct_messages_box('json', 'sentbox', 'true');
1690 'result' => 'error',
1691 'message' => 'no mails available'
1699 * Test the api_direct_messages_box() function with a RSS result.
1703 public function testApiDirectMessagesBoxWithRss()
1705 $result = api_direct_messages_box('rss', 'sentbox', 'false');
1706 self::assertXml($result, 'direct-messages');
1710 * Test the api_direct_messages_box() function without an authenticated user.
1714 public function testApiDirectMessagesBoxWithUnallowedUser()
1716 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1717 BasicAuth::setCurrentUserID();
1718 api_direct_messages_box('json', 'sentbox', 'false');
1722 * Test the api_direct_messages_sentbox() function.
1726 public function testApiDirectMessagesSentbox()
1728 $result = api_direct_messages_sentbox('json');
1729 self::assertArrayHasKey('direct_message', $result);
1733 * Test the api_direct_messages_inbox() function.
1737 public function testApiDirectMessagesInbox()
1739 $result = api_direct_messages_inbox('json');
1740 self::assertArrayHasKey('direct_message', $result);
1744 * Test the api_direct_messages_all() function.
1748 public function testApiDirectMessagesAll()
1750 $result = api_direct_messages_all('json');
1751 self::assertArrayHasKey('direct_message', $result);
1755 * Test the api_direct_messages_conversation() function.
1759 public function testApiDirectMessagesConversation()
1761 $result = api_direct_messages_conversation('json');
1762 self::assertArrayHasKey('direct_message', $result);
1766 * Test the api_oauth_request_token() function.
1770 public function testApiOauthRequestToken()
1772 $this->markTestIncomplete('exit() kills phpunit as well');
1776 * Test the api_oauth_access_token() function.
1780 public function testApiOauthAccessToken()
1782 $this->markTestIncomplete('exit() kills phpunit as well');
1786 * Test the api_fr_photos_list() function.
1790 public function testApiFrPhotosList()
1792 $result = api_fr_photos_list('json');
1793 self::assertArrayHasKey('photo', $result);
1797 * Test the api_fr_photos_list() function without an authenticated user.
1801 public function testApiFrPhotosListWithoutAuthenticatedUser()
1803 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1804 BasicAuth::setCurrentUserID();
1805 $_SESSION['authenticated'] = false;
1806 api_fr_photos_list('json');
1810 * Test the api_fr_photo_create_update() function.
1812 public function testApiFrPhotoCreateUpdate()
1814 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1815 api_fr_photo_create_update('json');
1819 * Test the api_fr_photo_create_update() function without an authenticated user.
1823 public function testApiFrPhotoCreateUpdateWithoutAuthenticatedUser()
1825 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1826 BasicAuth::setCurrentUserID();
1827 $_SESSION['authenticated'] = false;
1828 api_fr_photo_create_update('json');
1832 * Test the api_fr_photo_create_update() function with an album name.
1836 public function testApiFrPhotoCreateUpdateWithAlbum()
1838 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1839 $_REQUEST['album'] = 'album_name';
1840 api_fr_photo_create_update('json');
1844 * Test the api_fr_photo_create_update() function with the update mode.
1848 public function testApiFrPhotoCreateUpdateWithUpdate()
1850 $this->markTestIncomplete('We need to create a dataset for this');
1854 * Test the api_fr_photo_create_update() function with an uploaded file.
1858 public function testApiFrPhotoCreateUpdateWithFile()
1860 $this->markTestIncomplete();
1864 * Test the api_fr_photo_detail() function.
1868 public function testApiFrPhotoDetail()
1870 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1871 api_fr_photo_detail('json');
1875 * Test the api_fr_photo_detail() function without an authenticated user.
1879 public function testApiFrPhotoDetailWithoutAuthenticatedUser()
1881 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1882 BasicAuth::setCurrentUserID();
1883 $_SESSION['authenticated'] = false;
1884 api_fr_photo_detail('json');
1888 * Test the api_fr_photo_detail() function with a photo ID.
1892 public function testApiFrPhotoDetailWithPhotoId()
1894 $this->expectException(\Friendica\Network\HTTPException\NotFoundException::class);
1895 $_REQUEST['photo_id'] = 1;
1896 api_fr_photo_detail('json');
1900 * Test the api_fr_photo_detail() function with a correct photo ID.
1904 public function testApiFrPhotoDetailCorrectPhotoId()
1906 $this->markTestIncomplete('We need to create a dataset for this.');
1910 * Test the api_account_update_profile_image() function.
1914 public function testApiAccountUpdateProfileImage()
1916 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1917 api_account_update_profile_image('json');
1921 * Test the api_account_update_profile_image() function without an authenticated user.
1925 public function testApiAccountUpdateProfileImageWithoutAuthenticatedUser()
1927 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1928 BasicAuth::setCurrentUserID();
1929 $_SESSION['authenticated'] = false;
1930 api_account_update_profile_image('json');
1934 * Test the api_account_update_profile_image() function with an uploaded file.
1938 public function testApiAccountUpdateProfileImageWithUpload()
1940 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1941 $this->markTestIncomplete();
1945 * Test the check_acl_input() function.
1949 public function testCheckAclInput()
1951 $result = check_acl_input('<aclstring>', BaseApi::getCurrentUserID());
1952 // Where does this result come from?
1953 self::assertEquals(1, $result);
1957 * Test the check_acl_input() function with an empty ACL string.
1961 public function testCheckAclInputWithEmptyAclString()
1963 $result = check_acl_input(' ', BaseApi::getCurrentUserID());
1964 self::assertFalse($result);
1968 * Test the save_media_to_database() function.
1972 public function testSaveMediaToDatabase()
1974 $this->markTestIncomplete();
1978 * Test the post_photo_item() function.
1982 public function testPostPhotoItem()
1984 $this->markTestIncomplete();
1988 * Test the prepare_photo_data() function.
1992 public function testPreparePhotoData()
1994 $this->markTestIncomplete();
1998 * Test the api_share_as_retweet() function with a valid item.
2002 public function testApiShareAsRetweetWithValidItem()
2004 $this->markTestIncomplete();
2008 * Test the api_in_reply_to() function with a valid item.
2012 public function testApiInReplyToWithValidItem()
2014 $this->markTestIncomplete();
2018 * Test the api_clean_plain_items() function.
2022 public function testApiCleanPlainItems()
2024 $_REQUEST['include_entities'] = 'true';
2025 $result = api_clean_plain_items('some_text [url="some_url"]some_text[/url]');
2026 self::assertEquals('some_text [url="some_url"]"some_url"[/url]', $result);
2030 * Test the api_best_nickname() function with contacts.
2034 public function testApiBestNicknameWithContacts()
2036 $this->markTestIncomplete();
2040 * Test the api_friendica_group_show() function.
2044 public function testApiFriendicaGroupShow()
2046 $this->markTestIncomplete();
2050 * Test the api_friendica_group_delete() function.
2054 public function testApiFriendicaGroupDelete()
2056 $this->markTestIncomplete();
2060 * Test the api_lists_destroy() function.
2064 public function testApiListsDestroy()
2066 $this->markTestIncomplete();
2070 * Test the group_create() function.
2074 public function testGroupCreate()
2076 $this->markTestIncomplete();
2080 * Test the api_friendica_group_create() function.
2084 public function testApiFriendicaGroupCreate()
2086 $this->markTestIncomplete();
2090 * Test the api_lists_create() function.
2094 public function testApiListsCreate()
2096 $this->markTestIncomplete();
2100 * Test the api_friendica_group_update() function.
2104 public function testApiFriendicaGroupUpdate()
2106 $this->markTestIncomplete();
2110 * Test the api_lists_update() function.
2114 public function testApiListsUpdate()
2116 $this->markTestIncomplete();
2120 * Test the api_friendica_activity() function.
2124 public function testApiFriendicaActivity()
2126 $this->markTestIncomplete();
2130 * Test the api_friendica_notification_seen() function.
2134 public function testApiFriendicaNotificationSeen()
2136 $this->markTestIncomplete();
2140 * Test the api_friendica_direct_messages_setseen() function.
2144 public function testApiFriendicaDirectMessagesSetseen()
2146 $this->markTestIncomplete();
2150 * Test the api_friendica_direct_messages_search() function.
2154 public function testApiFriendicaDirectMessagesSearch()
2156 $this->markTestIncomplete();