6 namespace Friendica\Test\legacy;
9 use Friendica\App\Router;
10 use Friendica\Core\Config\Capability\IManageConfigValues;
11 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
12 use Friendica\Core\Protocol;
14 use Friendica\Model\Post;
15 use Friendica\Module\Api\ApiResponse;
16 use Friendica\Module\Api\Twitter\Media\Upload;
17 use Friendica\Module\BaseApi;
18 use Friendica\Network\HTTPException;
19 use Friendica\Security\BasicAuth;
20 use Friendica\Test\FixtureTest;
21 use Friendica\Util\Arrays;
22 use Friendica\Util\DateTimeFormat;
23 use Friendica\Util\Temporal;
24 use Monolog\Handler\TestHandler;
26 require_once __DIR__ . '/../../include/api.php';
29 * Tests for the API functions.
31 * Functions that use header() need to be tested in a separate process.
32 * @see https://phpunit.de/manual/5.7/en/appendixes.annotations.html#appendixes.annotations.runTestsInSeparateProcesses
34 * @backupGlobals enabled
36 class ApiTest extends FixtureTest
39 * @var TestHandler Can handle log-outputs
46 protected $friendUser;
50 protected $wrongUserId;
55 /** @var IManageConfigValues */
59 * Create variables used by tests.
61 protected function setUp() : void
63 global $API, $called_api;
69 /** @var IManageConfigValues $config */
70 $this->config = $this->dice->create(IManageConfigValues::class);
72 $this->config->set('system', 'url', 'http://localhost');
73 $this->config->set('system', 'hostname', 'localhost');
74 $this->config->set('system', 'worker_dont_fork', true);
77 $this->config->set('config', 'hostname', 'localhost');
78 $this->config->set('system', 'throttle_limit_day', 100);
79 $this->config->set('system', 'throttle_limit_week', 100);
80 $this->config->set('system', 'throttle_limit_month', 100);
81 $this->config->set('system', 'theme', 'system_theme');
85 $this->app = DI::app();
87 DI::args()->setArgc(1);
89 // User data that the test database is populated with
92 'name' => 'Self contact',
93 'nick' => 'selfcontact',
94 'nurl' => 'http://localhost/profile/selfcontact'
98 'name' => 'Friend contact',
99 'nick' => 'friendcontact',
100 'nurl' => 'http://localhost/profile/friendcontact'
104 'name' => 'othercontact',
105 'nick' => 'othercontact',
106 'nurl' => 'http://localhost/profile/othercontact'
109 // User ID that we know is not in the database
110 $this->wrongUserId = 666;
112 DI::session()->start();
114 // Most API require login so we force the session
116 'authenticated' => true,
117 'uid' => $this->selfUser['id']
119 BasicAuth::setCurrentUserID($this->selfUser['id']);
123 * Assert that an user array contains expected keys.
125 * @param array $user User array
129 private function assertSelfUser(array $user)
131 self::assertEquals($this->selfUser['id'], $user['uid']);
132 self::assertEquals($this->selfUser['id'], $user['cid']);
133 self::assertEquals(1, $user['self']);
134 self::assertEquals('DFRN', $user['location']);
135 self::assertEquals($this->selfUser['name'], $user['name']);
136 self::assertEquals($this->selfUser['nick'], $user['screen_name']);
137 self::assertEquals('dfrn', $user['network']);
138 self::assertTrue($user['verified']);
142 * Assert that an user array contains expected keys.
144 * @param array $user User array
148 private function assertOtherUser(array $user = [])
150 self::assertEquals($this->otherUser['id'], $user['id']);
151 self::assertEquals($this->otherUser['id'], $user['id_str']);
152 self::assertEquals($this->otherUser['name'], $user['name']);
153 self::assertEquals($this->otherUser['nick'], $user['screen_name']);
154 self::assertFalse($user['verified']);
158 * Assert that a status array contains expected keys.
160 * @param array $status Status array
164 private function assertStatus(array $status = [])
166 self::assertIsString($status['text'] ?? '');
167 self::assertIsInt($status['id'] ?? '');
168 // We could probably do more checks here.
172 * Assert that a list array contains expected keys.
174 * @param array $list List array
178 private function assertList(array $list = [])
180 self::assertIsString($list['name']);
181 self::assertIsInt($list['id']);
182 self::assertIsString('string', $list['id_str']);
183 self::assertContains($list['mode'], ['public', 'private']);
184 // We could probably do more checks here.
188 * Assert that the string is XML and contain the root element.
190 * @param string $result XML string
191 * @param string $root_element Root element name
195 private function assertXml($result = '', $root_element = '')
197 self::assertStringStartsWith('<?xml version="1.0"?>', $result);
198 self::assertStringContainsString('<' . $root_element, $result);
199 // We could probably do more checks here.
203 * Test the api_user() function.
207 public function testApiUser()
209 self::assertEquals($this->selfUser['id'], BaseApi::getCurrentUserID());
213 * Test the api_user() function with an unallowed user.
217 public function testApiUserWithUnallowedUser()
219 // self::assertEquals(false, api_user());
223 * Test the api_source() function.
227 public function testApiSource()
229 self::assertEquals('api', BasicAuth::getCurrentApplicationToken()['name']);
233 * Test the api_source() function with a Twidere user agent.
237 public function testApiSourceWithTwidere()
239 $_SERVER['HTTP_USER_AGENT'] = 'Twidere';
240 self::assertEquals('Twidere', BasicAuth::getCurrentApplicationToken()['name']);
244 * Test the api_source() function with a GET parameter.
248 public function testApiSourceWithGet()
250 $_REQUEST['source'] = 'source_name';
251 self::assertEquals('source_name', BasicAuth::getCurrentApplicationToken()['name']);
255 * Test the api_date() function.
259 public function testApiDate()
261 self::assertEquals('Wed Oct 10 00:00:00 +0000 1990', DateTimeFormat::utc('1990-10-10', DateTimeFormat::API));
265 * Test the api_register_func() function.
269 public function testApiRegisterFunc()
281 self::assertTrue(is_callable($API['api_path']['func']));
285 * Test the BasicAuth::getCurrentUserID() function without any login.
287 * @runInSeparateProcess
288 * @preserveGlobalState disabled
289 * @preserveGlobalState disabled
291 public function testApiLoginWithoutLogin()
293 BasicAuth::setCurrentUserID();
294 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
295 BasicAuth::getCurrentUserID(true);
299 * Test the BasicAuth::getCurrentUserID() function with a bad login.
301 * @runInSeparateProcess
302 * @preserveGlobalState disabled
303 * @preserveGlobalState disabled
305 public function testApiLoginWithBadLogin()
307 BasicAuth::setCurrentUserID();
308 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
309 $_SERVER['PHP_AUTH_USER'] = 'user@server';
310 BasicAuth::getCurrentUserID(true);
314 * Test the BasicAuth::getCurrentUserID() function with oAuth.
318 public function testApiLoginWithOauth()
320 $this->markTestIncomplete('Can we test this easily?');
324 * Test the BasicAuth::getCurrentUserID() function with authentication provided by an addon.
328 public function testApiLoginWithAddonAuth()
330 $this->markTestIncomplete('Can we test this easily?');
334 * Test the BasicAuth::getCurrentUserID() function with a correct login.
336 * @runInSeparateProcess
337 * @preserveGlobalState disabled
338 * @doesNotPerformAssertions
340 public function testApiLoginWithCorrectLogin()
342 BasicAuth::setCurrentUserID();
343 $_SERVER['PHP_AUTH_USER'] = 'Test user';
344 $_SERVER['PHP_AUTH_PW'] = 'password';
345 BasicAuth::getCurrentUserID(true);
349 * Test the BasicAuth::getCurrentUserID() function with a remote user.
351 * @runInSeparateProcess
352 * @preserveGlobalState disabled
354 public function testApiLoginWithRemoteUser()
356 BasicAuth::setCurrentUserID();
357 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
358 $_SERVER['REDIRECT_REMOTE_USER'] = '123456dXNlcjpwYXNzd29yZA==';
359 BasicAuth::getCurrentUserID(true);
363 * Test the api_call() function.
365 * @runInSeparateProcess
366 * @preserveGlobalState disabled
368 public function testApiCall()
372 'method' => 'method',
373 'func' => function () {
374 return ['data' => ['some_data']];
377 $_SERVER['REQUEST_METHOD'] = 'method';
378 $_SERVER['QUERY_STRING'] = 'pagename=api_path';
379 $_GET['callback'] = 'callback_name';
382 'callback_name(["some_data"])',
383 api_call('api_path', 'json')
388 * Test the api_call() function with the profiled enabled.
390 * @runInSeparateProcess
391 * @preserveGlobalState disabled
393 public function testApiCallWithProfiler()
397 'method' => 'method',
398 'func' => function () {
399 return ['data' => ['some_data']];
403 $_SERVER['REQUEST_METHOD'] = 'method';
404 $_SERVER['QUERY_STRING'] = 'pagename=api_path';
406 $this->config->set('system', 'profiler', true);
407 $this->config->set('rendertime', 'callstack', true);
408 $this->app->callstack = [
409 'database' => ['some_function' => 200],
410 'database_write' => ['some_function' => 200],
411 'cache' => ['some_function' => 200],
412 'cache_write' => ['some_function' => 200],
413 'network' => ['some_function' => 200]
418 api_call('api_path', 'json')
423 * Test the api_call() function with a JSON result.
425 * @runInSeparateProcess
426 * @preserveGlobalState disabled
428 public function testApiCallWithJson()
432 'method' => 'method',
433 'func' => function () {
434 return ['data' => ['some_data']];
437 $_SERVER['REQUEST_METHOD'] = 'method';
438 $_SERVER['QUERY_STRING'] = 'pagename=api_path.json';
442 api_call('api_path.json', 'json')
447 * Test the api_call() function with an XML result.
449 * @runInSeparateProcess
450 * @preserveGlobalState disabled
452 public function testApiCallWithXml()
456 'method' => 'method',
457 'func' => function () {
461 $_SERVER['REQUEST_METHOD'] = 'method';
462 $_SERVER['QUERY_STRING'] = 'pagename=api_path.xml';
464 $args = DI::args()->determine($_SERVER, $_GET);
468 api_call('api_path.xml', 'xml')
473 * Test the api_call() function with an RSS result.
475 * @runInSeparateProcess
476 * @preserveGlobalState disabled
478 public function testApiCallWithRss()
482 'method' => 'method',
483 'func' => function () {
487 $_SERVER['REQUEST_METHOD'] = 'method';
488 $_SERVER['QUERY_STRING'] = 'pagename=api_path.rss';
491 '<?xml version="1.0" encoding="UTF-8"?>' . "\n" .
493 api_call('api_path.rss', 'rss')
498 * Test the api_call() function with an Atom result.
500 * @runInSeparateProcess
501 * @preserveGlobalState disabled
503 public function testApiCallWithAtom()
507 'method' => 'method',
508 'func' => function () {
512 $_SERVER['REQUEST_METHOD'] = 'method';
513 $_SERVER['QUERY_STRING'] = 'pagename=api_path.atom';
516 '<?xml version="1.0" encoding="UTF-8"?>' . "\n" .
518 api_call('api_path.atom', 'atom')
523 * Test the api_rss_extra() function.
527 public function testApiRssExtra()
530 $user_info = ['url' => 'user_url', 'lang' => 'en'];
531 $result = api_rss_extra([], $user_info);
532 self::assertEquals($user_info, $result['$user']);
533 self::assertEquals($user_info['url'], $result['$rss']['alternate']);
534 self::assertArrayHasKey('self', $result['$rss']);
535 self::assertArrayHasKey('base', $result['$rss']);
536 self::assertArrayHasKey('updated', $result['$rss']);
537 self::assertArrayHasKey('atom_updated', $result['$rss']);
538 self::assertArrayHasKey('language', $result['$rss']);
539 self::assertArrayHasKey('logo', $result['$rss']);
544 * Test the api_rss_extra() function without any user info.
548 public function testApiRssExtraWithoutUserInfo()
551 $result = api_rss_extra([], null);
552 self::assertIsArray($result['$user']);
553 self::assertArrayHasKey('alternate', $result['$rss']);
554 self::assertArrayHasKey('self', $result['$rss']);
555 self::assertArrayHasKey('base', $result['$rss']);
556 self::assertArrayHasKey('updated', $result['$rss']);
557 self::assertArrayHasKey('atom_updated', $result['$rss']);
558 self::assertArrayHasKey('language', $result['$rss']);
559 self::assertArrayHasKey('logo', $result['$rss']);
564 * Test the api_get_user() function.
568 public function testApiGetUser()
570 // $user = api_get_user();
571 // self::assertSelfUser($user);
572 // self::assertEquals('708fa0', $user['profile_sidebar_fill_color']);
573 // self::assertEquals('6fdbe8', $user['profile_link_color']);
574 // self::assertEquals('ededed', $user['profile_background_color']);
578 * Test the api_get_user() function with a Frio schema.
582 public function testApiGetUserWithFrioSchema()
584 // $pConfig = $this->dice->create(IManagePersonalConfigValues::class);
585 // $pConfig->set($this->selfUser['id'], 'frio', 'schema', 'red');
586 // $user = api_get_user();
587 // self::assertSelfUser($user);
588 // self::assertEquals('708fa0', $user['profile_sidebar_fill_color']);
589 // self::assertEquals('6fdbe8', $user['profile_link_color']);
590 // self::assertEquals('ededed', $user['profile_background_color']);
594 * Test the api_get_user() function with an empty Frio schema.
598 public function testApiGetUserWithEmptyFrioSchema()
600 // $pConfig = $this->dice->create(IManagePersonalConfigValues::class);
601 // $pConfig->set($this->selfUser['id'], 'frio', 'schema', '---');
602 // $user = api_get_user();
603 // self::assertSelfUser($user);
604 // self::assertEquals('708fa0', $user['profile_sidebar_fill_color']);
605 // self::assertEquals('6fdbe8', $user['profile_link_color']);
606 // self::assertEquals('ededed', $user['profile_background_color']);
610 * Test the api_get_user() function with a custom Frio schema.
614 public function testApiGetUserWithCustomFrioSchema()
616 // $pConfig = $this->dice->create(IManagePersonalConfigValues::class);
617 // $pConfig->set($this->selfUser['id'], 'frio', 'schema', '---');
618 // $pConfig->set($this->selfUser['id'], 'frio', 'nav_bg', '#123456');
619 // $pConfig->set($this->selfUser['id'], 'frio', 'link_color', '#123456');
620 // $pConfig->set($this->selfUser['id'], 'frio', 'background_color', '#123456');
621 // $user = api_get_user();
622 // self::assertSelfUser($user);
623 // self::assertEquals('123456', $user['profile_sidebar_fill_color']);
624 // self::assertEquals('123456', $user['profile_link_color']);
625 // self::assertEquals('123456', $user['profile_background_color']);
629 * Test the api_get_user() function with an user that is not allowed to use the API.
631 * @runInSeparateProcess
632 * @preserveGlobalState disabled
634 public function testApiGetUserWithoutApiUser()
636 // api_get_user() with empty parameters is not used anymore
638 $_SERVER['PHP_AUTH_USER'] = 'Test user';
639 $_SERVER['PHP_AUTH_PW'] = 'password';
640 BasicAuth::setCurrentUserID();
641 self::assertFalse(api_get_user());
646 * Test the api_get_user() function with an user ID in a GET parameter.
650 public function testApiGetUserWithGetId()
652 // self::assertOtherUser(api_get_user());
656 * Test the api_get_user() function with a wrong user ID in a GET parameter.
660 public function testApiGetUserWithWrongGetId()
662 // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
663 // self::assertOtherUser(api_get_user());
667 * Test the api_get_user() function with an user name in a GET parameter.
671 public function testApiGetUserWithGetName()
673 // self::assertSelfUser(api_get_user());
677 * Test the api_get_user() function with a profile URL in a GET parameter.
681 public function testApiGetUserWithGetUrl()
683 // self::assertSelfUser(api_get_user());
687 * Test the api_get_user() function with an user ID in the API path.
691 public function testApiGetUserWithNumericCalledApi()
693 // global $called_api;
694 // $called_api = ['api_path'];
695 // DI::args()->setArgv(['', $this->otherUser['id'] . '.json']);
696 // self::assertOtherUser(api_get_user());
700 * Test the api_get_user() function with the $called_api global variable.
704 public function testApiGetUserWithCalledApi()
706 // global $called_api;
707 // $called_api = ['api', 'api_path'];
708 // self::assertSelfUser(api_get_user());
712 * Test the Arrays::walkRecursive() function.
716 public function testApiWalkRecursive()
721 Arrays::walkRecursive(
724 // Should we test this with a callback that actually does something?
732 * Test the Arrays::walkRecursive() function with an array.
736 public function testApiWalkRecursiveWithArray()
738 $array = [['item1'], ['item2']];
741 Arrays::walkRecursive(
744 // Should we test this with a callback that actually does something?
752 * Test the BaseApi::reformatXML() function.
756 public function testApiReformatXml()
760 self::assertTrue(ApiResponse::reformatXML($item, $key));
761 self::assertEquals('true', $item);
765 * Test the BaseApi::reformatXML() function with a statusnet_api key.
769 public function testApiReformatXmlWithStatusnetKey()
772 $key = 'statusnet_api';
773 self::assertTrue(ApiResponse::reformatXML($item, $key));
774 self::assertEquals('statusnet:api', $key);
778 * Test the BaseApi::reformatXML() function with a friendica_api key.
782 public function testApiReformatXmlWithFriendicaKey()
785 $key = 'friendica_api';
786 self::assertTrue(ApiResponse::reformatXML($item, $key));
787 self::assertEquals('friendica:api', $key);
791 * Test the BaseApi::createXML() function.
795 public function testApiCreateXml()
798 '<?xml version="1.0"?>' . "\n" .
799 '<root_element xmlns="http://api.twitter.com" xmlns:statusnet="http://status.net/schema/api/1/" ' .
800 'xmlns:friendica="http://friendi.ca/schema/api/1/" ' .
801 'xmlns:georss="http://www.georss.org/georss">' . "\n" .
802 ' <data>some_data</data>' . "\n" .
803 '</root_element>' . "\n",
804 DI::apiResponse()->createXML(['data' => ['some_data']], 'root_element')
809 * Test the BaseApi::createXML() function without any XML namespace.
813 public function testApiCreateXmlWithoutNamespaces()
816 '<?xml version="1.0"?>' . "\n" .
818 ' <data>some_data</data>' . "\n" .
820 DI::apiResponse()->createXML(['data' => ['some_data']], 'ok')
825 * Test the BaseApi::formatData() function.
829 public function testApiFormatData()
831 $data = ['some_data'];
832 self::assertEquals($data, DI::apiResponse()->formatData('root_element', 'json', $data));
836 * Test the BaseApi::formatData() function with an XML result.
840 public function testApiFormatDataWithXml()
843 '<?xml version="1.0"?>' . "\n" .
844 '<root_element xmlns="http://api.twitter.com" xmlns:statusnet="http://status.net/schema/api/1/" ' .
845 'xmlns:friendica="http://friendi.ca/schema/api/1/" ' .
846 'xmlns:georss="http://www.georss.org/georss">' . "\n" .
847 ' <data>some_data</data>' . "\n" .
848 '</root_element>' . "\n",
849 DI::apiResponse()->formatData('root_element', 'xml', ['data' => ['some_data']])
854 * Test the api_statuses_mediap() function.
858 public function testApiStatusesMediap()
861 DI::args()->setArgc(2);
869 'tmp_name' => $this->getTempImage(),
870 'name' => 'spacer.png',
871 'type' => 'image/png'
874 $_GET['status'] = '<b>Status content</b>';
876 $result = api_statuses_mediap('json');
877 self::assertStatus($result['status']);
882 * Test the api_statuses_mediap() function without an authenticated user.
886 public function testApiStatusesMediapWithoutAuthenticatedUser()
888 // $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
889 // BasicAuth::setCurrentUserID();
890 // $_SESSION['authenticated'] = false;
891 // api_statuses_mediap('json');
895 * Test the api_statuses_update() function.
899 public function testApiStatusesUpdate()
902 $_REQUEST['status'] = 'Status content #friendica';
903 $_REQUEST['in_reply_to_status_id'] = -1;
904 $_REQUEST['lat'] = 48;
905 $_REQUEST['long'] = 7;
912 'tmp_name' => $this->getTempImage(),
913 'name' => 'spacer.png',
914 'type' => 'image/png'
918 $result = api_statuses_update('json');
919 self::assertStatus($result['status']);
924 * Test the api_statuses_update() function with an HTML status.
928 public function testApiStatusesUpdateWithHtml()
931 $_REQUEST['htmlstatus'] = '<b>Status content</b>';
933 $result = api_statuses_update('json');
934 self::assertStatus($result['status']);
939 * Test the api_statuses_update() function without an authenticated user.
943 public function testApiStatusesUpdateWithoutAuthenticatedUser()
946 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
947 BasicAuth::setCurrentUserID();
948 $_SESSION['authenticated'] = false;
949 api_statuses_update('json');
954 * Test the api_statuses_update() function with a parent status.
958 public function testApiStatusesUpdateWithParent()
960 $this->markTestIncomplete('This triggers an exit() somewhere and kills PHPUnit.');
964 * Test the api_statuses_update() function with a media_ids parameter.
968 public function testApiStatusesUpdateWithMediaIds()
970 $this->markTestIncomplete();
974 * Test the api_statuses_update() function with the throttle limit reached.
978 public function testApiStatusesUpdateWithDayThrottleReached()
980 $this->markTestIncomplete();
986 * Test the api_statuses_repeat() function.
990 public function testApiStatusesRepeat()
992 // $this->expectException(\Friendica\Network\HTTPException\ForbiddenException::class);
993 // api_statuses_repeat('json');
997 * Test the api_statuses_repeat() function without an authenticated user.
1001 public function testApiStatusesRepeatWithoutAuthenticatedUser()
1003 // $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1004 // BasicAuth::setCurrentUserID();
1005 // $_SESSION['authenticated'] = false;
1006 // api_statuses_repeat('json');
1010 * Test the api_statuses_repeat() function with an ID.
1014 public function testApiStatusesRepeatWithId()
1016 // DI::args()->setArgv(['', '', '', 1]);
1017 // $result = api_statuses_repeat('json');
1018 // self::assertStatus($result['status']);
1020 // Also test with a shared status
1021 // DI::args()->setArgv(['', '', '', 5]);
1022 // $result = api_statuses_repeat('json');
1023 // self::assertStatus($result['status']);
1027 * Test the api_favorites_create_destroy() function.
1031 public function testApiFavoritesCreateDestroy()
1033 // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1034 // DI::args()->setArgv(['api', '1.1', 'favorites', 'create']);
1035 // api_favorites_create_destroy('json');
1039 * Test the api_favorites_create_destroy() function with an invalid ID.
1043 public function testApiFavoritesCreateDestroyWithInvalidId()
1045 // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1046 // DI::args()->setArgv(['api', '1.1', 'favorites', 'create', '12.json']);
1047 // api_favorites_create_destroy('json');
1051 * Test the api_favorites_create_destroy() function with an invalid action.
1055 public function testApiFavoritesCreateDestroyWithInvalidAction()
1057 // $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1058 // DI::args()->setArgv(['api', '1.1', 'favorites', 'change.json']);
1059 // $_REQUEST['id'] = 1;
1060 // api_favorites_create_destroy('json');
1064 * Test the api_favorites_create_destroy() function with the create action.
1068 public function testApiFavoritesCreateDestroyWithCreateAction()
1070 // DI::args()->setArgv(['api', '1.1', 'favorites', 'create.json']);
1071 // $_REQUEST['id'] = 3;
1072 // $result = api_favorites_create_destroy('json');
1073 // self::assertStatus($result['status']);
1077 * Test the api_favorites_create_destroy() function with the create action and an RSS result.
1081 public function testApiFavoritesCreateDestroyWithCreateActionAndRss()
1083 // DI::args()->setArgv(['api', '1.1', 'favorites', 'create.rss']);
1084 // $_REQUEST['id'] = 3;
1085 // $result = api_favorites_create_destroy('rss');
1086 // self::assertXml($result, 'status');
1090 * Test the api_favorites_create_destroy() function with the destroy action.
1094 public function testApiFavoritesCreateDestroyWithDestroyAction()
1096 // DI::args()->setArgv(['api', '1.1', 'favorites', 'destroy.json']);
1097 // $_REQUEST['id'] = 3;
1098 // $result = api_favorites_create_destroy('json');
1099 // self::assertStatus($result['status']);
1103 * Test the api_favorites_create_destroy() function without an authenticated user.
1107 public function testApiFavoritesCreateDestroyWithoutAuthenticatedUser()
1110 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1111 DI::args()->setArgv(['api', '1.1', 'favorites', 'create.json']);
1112 BasicAuth::setCurrentUserID();
1113 $_SESSION['authenticated'] = false;
1114 api_favorites_create_destroy('json');
1121 * Test the api_format_messages() function.
1125 public function testApiFormatMessages()
1127 $result = api_format_messages(
1128 ['id' => 1, 'uri-id' => 1, 'title' => 'item_title', 'body' => '[b]item_body[/b]'],
1129 ['id' => 2, 'uri-id' => 2, 'screen_name' => 'recipient_name'],
1130 ['id' => 3, 'uri-id' => 2, 'screen_name' => 'sender_name']
1132 self::assertEquals('item_title' . "\n" . 'item_body', $result['text']);
1133 self::assertEquals(1, $result['id']);
1134 self::assertEquals(2, $result['recipient_id']);
1135 self::assertEquals(3, $result['sender_id']);
1136 self::assertEquals('recipient_name', $result['recipient_screen_name']);
1137 self::assertEquals('sender_name', $result['sender_screen_name']);
1141 * Test the api_format_messages() function with HTML.
1145 public function testApiFormatMessagesWithHtmlText()
1147 $_GET['getText'] = 'html';
1148 $result = api_format_messages(
1149 ['id' => 1, 'uri-id' => 1, 'title' => 'item_title', 'body' => '[b]item_body[/b]'],
1150 ['id' => 2, 'uri-id' => 2, 'screen_name' => 'recipient_name'],
1151 ['id' => 3, 'uri-id' => 3, 'screen_name' => 'sender_name']
1153 self::assertEquals('item_title', $result['title']);
1154 self::assertEquals('<strong>item_body</strong>', $result['text']);
1158 * Test the api_format_messages() function with plain text.
1162 public function testApiFormatMessagesWithPlainText()
1164 $_GET['getText'] = 'plain';
1165 $result = api_format_messages(
1166 ['id' => 1, 'uri-id' => 1, 'title' => 'item_title', 'body' => '[b]item_body[/b]'],
1167 ['id' => 2, 'uri-id' => 2, 'screen_name' => 'recipient_name'],
1168 ['id' => 3, 'uri-id' => 3, 'screen_name' => 'sender_name']
1170 self::assertEquals('item_title', $result['title']);
1171 self::assertEquals('item_body', $result['text']);
1175 * Test the api_format_messages() function with the getUserObjects GET parameter set to false.
1179 public function testApiFormatMessagesWithoutUserObjects()
1181 $_GET['getUserObjects'] = 'false';
1182 $result = api_format_messages(
1183 ['id' => 1, 'uri-id' => 1, 'title' => 'item_title', 'body' => '[b]item_body[/b]'],
1184 ['id' => 2, 'uri-id' => 2, 'screen_name' => 'recipient_name'],
1185 ['id' => 3, 'uri-id' => 3, 'screen_name' => 'sender_name']
1187 self::assertTrue(!isset($result['sender']));
1188 self::assertTrue(!isset($result['recipient']));
1192 * Test the api_convert_item() function.
1196 public function testApiConvertItem()
1199 $result = api_convert_item(
1201 'network' => 'feed',
1202 'title' => 'item_title',
1204 // We need a long string to test that it is correctly cut
1205 'body' => 'perspiciatis impedit voluptatem quis molestiae ea qui ' .
1206 'reiciendis dolorum aut ducimus sunt consequatur inventore dolor ' .
1207 'officiis pariatur doloremque nemo culpa aut quidem qui dolore ' .
1208 'laudantium atque commodi alias voluptatem non possimus aperiam ' .
1209 'ipsum rerum consequuntur aut amet fugit quia aliquid praesentium ' .
1210 'repellendus quibusdam et et inventore mollitia rerum sit autem ' .
1211 'pariatur maiores ipsum accusantium perferendis vel sit possimus ' .
1212 'veritatis nihil distinctio qui eum repellat officia illum quos ' .
1213 'impedit quam iste esse unde qui suscipit aut facilis ut inventore ' .
1214 'omnis exercitationem quo magnam consequatur maxime aut illum ' .
1215 'soluta quaerat natus unde aspernatur et sed beatae nihil ullam ' .
1216 'temporibus corporis ratione blanditiis perspiciatis impedit ' .
1217 'voluptatem quis molestiae ea qui reiciendis dolorum aut ducimus ' .
1218 'sunt consequatur inventore dolor officiis pariatur doloremque ' .
1219 'nemo culpa aut quidem qui dolore laudantium atque commodi alias ' .
1220 'voluptatem non possimus aperiam ipsum rerum consequuntur aut ' .
1221 'amet fugit quia aliquid praesentium repellendus quibusdam et et ' .
1222 'inventore mollitia rerum sit autem pariatur maiores ipsum accusantium ' .
1223 'perferendis vel sit possimus veritatis nihil distinctio qui eum ' .
1224 'repellat officia illum quos impedit quam iste esse unde qui ' .
1225 'suscipit aut facilis ut inventore omnis exercitationem quo magnam ' .
1226 'consequatur maxime aut illum soluta quaerat natus unde aspernatur ' .
1227 'et sed beatae nihil ullam temporibus corporis ratione blanditiis',
1228 'plink' => 'item_plink'
1231 self::assertStringStartsWith('item_title', $result['text']);
1232 self::assertStringStartsWith('<h4>item_title</h4><br>perspiciatis impedit voluptatem', $result['html']);
1237 * Test the api_convert_item() function with an empty item body.
1241 public function testApiConvertItemWithoutBody()
1244 $result = api_convert_item(
1246 'network' => 'feed',
1247 'title' => 'item_title',
1250 'plink' => 'item_plink'
1253 self::assertEquals("item_title", $result['text']);
1254 self::assertEquals('<h4>item_title</h4><br>item_plink', $result['html']);
1259 * Test the api_convert_item() function with the title in the body.
1263 public function testApiConvertItemWithTitleInBody()
1266 $result = api_convert_item(
1268 'title' => 'item_title',
1269 'body' => 'item_title item_body',
1273 self::assertEquals('item_title item_body', $result['text']);
1274 self::assertEquals('<h4>item_title</h4><br>item_title item_body', $result['html']);
1279 * Test the api_get_attachments() function.
1283 public function testApiGetAttachments()
1286 // self::assertEmpty(api_get_attachments($body, 0));
1290 * Test the api_get_attachments() function with an img tag.
1294 public function testApiGetAttachmentsWithImage()
1296 // $body = '[img]http://via.placeholder.com/1x1.png[/img]';
1297 // self::assertIsArray(api_get_attachments($body, 0));
1301 * Test the api_get_attachments() function with an img tag and an AndStatus user agent.
1305 public function testApiGetAttachmentsWithImageAndAndStatus()
1307 // $_SERVER['HTTP_USER_AGENT'] = 'AndStatus';
1308 // $body = '[img]http://via.placeholder.com/1x1.png[/img]';
1309 // self::assertIsArray(api_get_attachments($body, 0));
1313 * Test the api_get_entitities() function.
1317 public function testApiGetEntitities()
1320 // self::assertIsArray(api_get_entitities($text, 'bbcode', 0));
1324 * Test the api_get_entitities() function with the include_entities parameter.
1328 public function testApiGetEntititiesWithIncludeEntities()
1331 $_REQUEST['include_entities'] = 'true';
1333 $result = api_get_entitities($text, 'bbcode', 0);
1334 self::assertIsArray($result['hashtags']);
1335 self::assertIsArray($result['symbols']);
1336 self::assertIsArray($result['urls']);
1337 self::assertIsArray($result['user_mentions']);
1342 * Test the api_format_items_embeded_images() function.
1346 public function testApiFormatItemsEmbededImages()
1350 'text ' . DI::baseUrl() . '/display/item_guid',
1351 api_format_items_embeded_images(['guid' => 'item_guid'], 'text data:image/foo')
1357 * Test the api_format_items_activities() function.
1361 public function testApiFormatItemsActivities()
1363 $item = ['uid' => 0, 'uri-id' => 1];
1364 $result = DI::friendicaActivities()->createFromUriId($item['uri-id'], $item['uid']);
1365 self::assertArrayHasKey('like', $result);
1366 self::assertArrayHasKey('dislike', $result);
1367 self::assertArrayHasKey('attendyes', $result);
1368 self::assertArrayHasKey('attendno', $result);
1369 self::assertArrayHasKey('attendmaybe', $result);
1373 * Test the api_format_items_activities() function with an XML result.
1377 public function testApiFormatItemsActivitiesWithXml()
1379 $item = ['uid' => 0, 'uri-id' => 1];
1380 $result = DI::friendicaActivities()->createFromUriId($item['uri-id'], $item['uid'], 'xml');
1381 self::assertArrayHasKey('friendica:like', $result);
1382 self::assertArrayHasKey('friendica:dislike', $result);
1383 self::assertArrayHasKey('friendica:attendyes', $result);
1384 self::assertArrayHasKey('friendica:attendno', $result);
1385 self::assertArrayHasKey('friendica:attendmaybe', $result);
1389 * Test the api_format_items() function.
1390 * @doesNotPerformAssertions
1392 public function testApiFormatItems()
1395 $items = Post::selectToArray([], ['uid' => 42]);
1396 foreach ($items as $item) {
1397 $status = api_format_item($item);
1398 self::assertStatus($status);
1404 * Test the api_format_items() function with an XML result.
1405 * @doesNotPerformAssertions
1407 public function testApiFormatItemsWithXml()
1410 $items = Post::selectToArray([], ['uid' => 42]);
1411 foreach ($items as $item) {
1412 $status = api_format_item($item, 'xml');
1413 self::assertStatus($status);
1419 * Test the api_lists_list() function.
1423 public function testApiListsList()
1425 $result = api_lists_list('json');
1426 self::assertEquals(['lists_list' => []], $result);
1430 * Test the api_lists_ownerships() function.
1434 public function testApiListsOwnerships()
1436 $result = api_lists_ownerships('json');
1437 foreach ($result['lists']['lists'] as $list) {
1438 self::assertList($list);
1443 * Test the api_lists_ownerships() function without an authenticated user.
1447 public function testApiListsOwnershipsWithoutAuthenticatedUser()
1449 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1450 BasicAuth::setCurrentUserID();
1451 $_SESSION['authenticated'] = false;
1452 api_lists_ownerships('json');
1456 * Test the api_statuses_f() function.
1460 public function testApiStatusesFWithIncoming()
1462 // $result = api_statuses_f('incoming');
1463 // self::assertArrayHasKey('user', $result);
1468 * Test the api_direct_messages_new() function.
1472 public function testApiDirectMessagesNew()
1474 $result = api_direct_messages_new('json');
1475 self::assertNull($result);
1479 * Test the api_direct_messages_new() function without an authenticated user.
1483 public function testApiDirectMessagesNewWithoutAuthenticatedUser()
1485 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1486 BasicAuth::setCurrentUserID();
1487 $_SESSION['authenticated'] = false;
1488 api_direct_messages_new('json');
1492 * Test the api_direct_messages_new() function with an user ID.
1496 public function testApiDirectMessagesNewWithUserId()
1498 $_POST['text'] = 'message_text';
1499 $_REQUEST['user_id'] = $this->otherUser['id'];
1500 $result = api_direct_messages_new('json');
1501 self::assertEquals(['direct_message' => ['error' => -1]], $result);
1505 * Test the api_direct_messages_new() function with a screen name.
1509 public function testApiDirectMessagesNewWithScreenName()
1511 $this->app->setLoggedInUserNickname($this->selfUser['nick']);
1512 $_POST['text'] = 'message_text';
1513 $_REQUEST['user_id'] = $this->friendUser['id'];
1514 $result = api_direct_messages_new('json');
1515 self::assertStringContainsString('message_text', $result['direct_message']['text']);
1516 self::assertEquals('selfcontact', $result['direct_message']['sender_screen_name']);
1517 self::assertEquals(1, $result['direct_message']['friendica_seen']);
1521 * Test the api_direct_messages_new() function with a title.
1525 public function testApiDirectMessagesNewWithTitle()
1527 $this->app->setLoggedInUserNickname($this->selfUser['nick']);
1528 $_POST['text'] = 'message_text';
1529 $_REQUEST['user_id'] = $this->friendUser['id'];
1530 $_REQUEST['title'] = 'message_title';
1531 $result = api_direct_messages_new('json');
1532 self::assertStringContainsString('message_text', $result['direct_message']['text']);
1533 self::assertStringContainsString('message_title', $result['direct_message']['text']);
1534 self::assertEquals('selfcontact', $result['direct_message']['sender_screen_name']);
1535 self::assertEquals(1, $result['direct_message']['friendica_seen']);
1539 * Test the api_direct_messages_new() function with an RSS result.
1543 public function testApiDirectMessagesNewWithRss()
1545 $this->app->setLoggedInUserNickname($this->selfUser['nick']);
1546 $_POST['text'] = 'message_text';
1547 $_REQUEST['user_id'] = $this->friendUser['id'];
1548 $result = api_direct_messages_new('rss');
1549 self::assertXml($result, 'direct-messages');
1553 * Test the api_direct_messages_destroy() function.
1557 public function testApiDirectMessagesDestroy()
1559 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1560 api_direct_messages_destroy('json');
1564 * Test the api_direct_messages_destroy() function with the friendica_verbose GET param.
1568 public function testApiDirectMessagesDestroyWithVerbose()
1570 $_GET['friendica_verbose'] = 'true';
1571 $result = api_direct_messages_destroy('json');
1575 'result' => 'error',
1576 'message' => 'message id or parenturi not specified'
1584 * Test the api_direct_messages_destroy() function without an authenticated user.
1588 public function testApiDirectMessagesDestroyWithoutAuthenticatedUser()
1590 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1591 BasicAuth::setCurrentUserID();
1592 $_SESSION['authenticated'] = false;
1593 api_direct_messages_destroy('json');
1597 * Test the api_direct_messages_destroy() function with a non-zero ID.
1601 public function testApiDirectMessagesDestroyWithId()
1603 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1604 $_REQUEST['id'] = 1;
1605 api_direct_messages_destroy('json');
1609 * Test the api_direct_messages_destroy() with a non-zero ID and the friendica_verbose GET param.
1613 public function testApiDirectMessagesDestroyWithIdAndVerbose()
1615 $_REQUEST['id'] = 1;
1616 $_REQUEST['friendica_parenturi'] = 'parent_uri';
1617 $_GET['friendica_verbose'] = 'true';
1618 $result = api_direct_messages_destroy('json');
1622 'result' => 'error',
1623 'message' => 'message id not in database'
1631 * Test the api_direct_messages_destroy() function with a non-zero ID.
1635 public function testApiDirectMessagesDestroyWithCorrectId()
1637 $this->markTestIncomplete('We need to add a dataset for this.');
1641 * Test the api_direct_messages_box() function.
1645 public function testApiDirectMessagesBoxWithSentbox()
1647 $_REQUEST['page'] = -1;
1648 $_REQUEST['max_id'] = 10;
1649 $result = api_direct_messages_box('json', 'sentbox', 'false');
1650 self::assertArrayHasKey('direct_message', $result);
1654 * Test the api_direct_messages_box() function.
1658 public function testApiDirectMessagesBoxWithConversation()
1660 $result = api_direct_messages_box('json', 'conversation', 'false');
1661 self::assertArrayHasKey('direct_message', $result);
1665 * Test the api_direct_messages_box() function.
1669 public function testApiDirectMessagesBoxWithAll()
1671 $result = api_direct_messages_box('json', 'all', 'false');
1672 self::assertArrayHasKey('direct_message', $result);
1676 * Test the api_direct_messages_box() function.
1680 public function testApiDirectMessagesBoxWithInbox()
1682 $result = api_direct_messages_box('json', 'inbox', 'false');
1683 self::assertArrayHasKey('direct_message', $result);
1687 * Test the api_direct_messages_box() function.
1691 public function testApiDirectMessagesBoxWithVerbose()
1693 $result = api_direct_messages_box('json', 'sentbox', 'true');
1697 'result' => 'error',
1698 'message' => 'no mails available'
1706 * Test the api_direct_messages_box() function with a RSS result.
1710 public function testApiDirectMessagesBoxWithRss()
1712 $result = api_direct_messages_box('rss', 'sentbox', 'false');
1713 self::assertXml($result, 'direct-messages');
1717 * Test the api_direct_messages_box() function without an authenticated user.
1721 public function testApiDirectMessagesBoxWithUnallowedUser()
1723 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1724 BasicAuth::setCurrentUserID();
1725 api_direct_messages_box('json', 'sentbox', 'false');
1729 * Test the api_direct_messages_sentbox() function.
1733 public function testApiDirectMessagesSentbox()
1735 $result = api_direct_messages_sentbox('json');
1736 self::assertArrayHasKey('direct_message', $result);
1740 * Test the api_direct_messages_inbox() function.
1744 public function testApiDirectMessagesInbox()
1746 $result = api_direct_messages_inbox('json');
1747 self::assertArrayHasKey('direct_message', $result);
1751 * Test the api_direct_messages_all() function.
1755 public function testApiDirectMessagesAll()
1757 $result = api_direct_messages_all('json');
1758 self::assertArrayHasKey('direct_message', $result);
1762 * Test the api_direct_messages_conversation() function.
1766 public function testApiDirectMessagesConversation()
1768 $result = api_direct_messages_conversation('json');
1769 self::assertArrayHasKey('direct_message', $result);
1773 * Test the api_oauth_request_token() function.
1777 public function testApiOauthRequestToken()
1779 $this->markTestIncomplete('exit() kills phpunit as well');
1783 * Test the api_oauth_access_token() function.
1787 public function testApiOauthAccessToken()
1789 $this->markTestIncomplete('exit() kills phpunit as well');
1793 * Test the api_fr_photos_list() function.
1797 public function testApiFrPhotosList()
1799 $result = api_fr_photos_list('json');
1800 self::assertArrayHasKey('photo', $result);
1804 * Test the api_fr_photos_list() function without an authenticated user.
1808 public function testApiFrPhotosListWithoutAuthenticatedUser()
1810 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1811 BasicAuth::setCurrentUserID();
1812 $_SESSION['authenticated'] = false;
1813 api_fr_photos_list('json');
1817 * Test the api_fr_photo_create_update() function.
1819 public function testApiFrPhotoCreateUpdate()
1821 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1822 api_fr_photo_create_update('json');
1826 * Test the api_fr_photo_create_update() function without an authenticated user.
1830 public function testApiFrPhotoCreateUpdateWithoutAuthenticatedUser()
1832 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1833 BasicAuth::setCurrentUserID();
1834 $_SESSION['authenticated'] = false;
1835 api_fr_photo_create_update('json');
1839 * Test the api_fr_photo_create_update() function with an album name.
1843 public function testApiFrPhotoCreateUpdateWithAlbum()
1845 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1846 $_REQUEST['album'] = 'album_name';
1847 api_fr_photo_create_update('json');
1851 * Test the api_fr_photo_create_update() function with the update mode.
1855 public function testApiFrPhotoCreateUpdateWithUpdate()
1857 $this->markTestIncomplete('We need to create a dataset for this');
1861 * Test the api_fr_photo_create_update() function with an uploaded file.
1865 public function testApiFrPhotoCreateUpdateWithFile()
1867 $this->markTestIncomplete();
1871 * Test the api_fr_photo_detail() function.
1875 public function testApiFrPhotoDetail()
1877 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1878 api_fr_photo_detail('json');
1882 * Test the api_fr_photo_detail() function without an authenticated user.
1886 public function testApiFrPhotoDetailWithoutAuthenticatedUser()
1888 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1889 BasicAuth::setCurrentUserID();
1890 $_SESSION['authenticated'] = false;
1891 api_fr_photo_detail('json');
1895 * Test the api_fr_photo_detail() function with a photo ID.
1899 public function testApiFrPhotoDetailWithPhotoId()
1901 $this->expectException(\Friendica\Network\HTTPException\NotFoundException::class);
1902 $_REQUEST['photo_id'] = 1;
1903 api_fr_photo_detail('json');
1907 * Test the api_fr_photo_detail() function with a correct photo ID.
1911 public function testApiFrPhotoDetailCorrectPhotoId()
1913 $this->markTestIncomplete('We need to create a dataset for this.');
1917 * Test the api_account_update_profile_image() function.
1921 public function testApiAccountUpdateProfileImage()
1923 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1924 api_account_update_profile_image('json');
1928 * Test the api_account_update_profile_image() function without an authenticated user.
1932 public function testApiAccountUpdateProfileImageWithoutAuthenticatedUser()
1934 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
1935 BasicAuth::setCurrentUserID();
1936 $_SESSION['authenticated'] = false;
1937 api_account_update_profile_image('json');
1941 * Test the api_account_update_profile_image() function with an uploaded file.
1945 public function testApiAccountUpdateProfileImageWithUpload()
1947 $this->expectException(\Friendica\Network\HTTPException\BadRequestException::class);
1948 $this->markTestIncomplete();
1952 * Test the check_acl_input() function.
1956 public function testCheckAclInput()
1958 $result = check_acl_input('<aclstring>', BaseApi::getCurrentUserID());
1959 // Where does this result come from?
1960 self::assertEquals(1, $result);
1964 * Test the check_acl_input() function with an empty ACL string.
1968 public function testCheckAclInputWithEmptyAclString()
1970 $result = check_acl_input(' ', BaseApi::getCurrentUserID());
1971 self::assertFalse($result);
1975 * Test the save_media_to_database() function.
1979 public function testSaveMediaToDatabase()
1981 $this->markTestIncomplete();
1985 * Test the post_photo_item() function.
1989 public function testPostPhotoItem()
1991 $this->markTestIncomplete();
1995 * Test the prepare_photo_data() function.
1999 public function testPreparePhotoData()
2001 $this->markTestIncomplete();
2005 * Test the api_share_as_retweet() function with a valid item.
2009 public function testApiShareAsRetweetWithValidItem()
2011 $this->markTestIncomplete();
2015 * Test the api_in_reply_to() function with a valid item.
2019 public function testApiInReplyToWithValidItem()
2021 $this->markTestIncomplete();
2025 * Test the api_clean_plain_items() function.
2029 public function testApiCleanPlainItems()
2031 $_REQUEST['include_entities'] = 'true';
2032 $result = api_clean_plain_items('some_text [url="some_url"]some_text[/url]');
2033 self::assertEquals('some_text [url="some_url"]"some_url"[/url]', $result);
2037 * Test the api_best_nickname() function with contacts.
2041 public function testApiBestNicknameWithContacts()
2043 $this->markTestIncomplete();
2047 * Test the api_friendica_group_show() function.
2051 public function testApiFriendicaGroupShow()
2053 $this->markTestIncomplete();
2057 * Test the api_friendica_group_delete() function.
2061 public function testApiFriendicaGroupDelete()
2063 $this->markTestIncomplete();
2067 * Test the api_lists_destroy() function.
2071 public function testApiListsDestroy()
2073 $this->markTestIncomplete();
2077 * Test the group_create() function.
2081 public function testGroupCreate()
2083 $this->markTestIncomplete();
2087 * Test the api_friendica_group_create() function.
2091 public function testApiFriendicaGroupCreate()
2093 $this->markTestIncomplete();
2097 * Test the api_lists_create() function.
2101 public function testApiListsCreate()
2103 $this->markTestIncomplete();
2107 * Test the api_friendica_group_update() function.
2111 public function testApiFriendicaGroupUpdate()
2113 $this->markTestIncomplete();
2117 * Test the api_lists_update() function.
2121 public function testApiListsUpdate()
2123 $this->markTestIncomplete();
2127 * Test the api_friendica_activity() function.
2131 public function testApiFriendicaActivity()
2133 $this->markTestIncomplete();
2137 * Test the api_friendica_notification_seen() function.
2141 public function testApiFriendicaNotificationSeen()
2143 $this->markTestIncomplete();
2147 * Test the api_friendica_direct_messages_setseen() function.
2151 public function testApiFriendicaDirectMessagesSetseen()
2153 $this->markTestIncomplete();
2157 * Test the api_friendica_direct_messages_search() function.
2161 public function testApiFriendicaDirectMessagesSearch()
2163 $this->markTestIncomplete();