3 namespace Friendica\Test\src\Module\Api\Mastodon\Timelines;
5 use Friendica\Test\src\Module\Api\ApiTest;
7 class HomeTest extends ApiTest
10 * Test the api_statuses_home_timeline() function.
14 public function testApiStatusesHomeTimeline()
16 self::markTestIncomplete('Needs Home to not set header during call (like at BaseApi::setLinkHeader');
19 $_REQUEST['max_id'] = 10;
20 $_REQUEST['exclude_replies'] = true;
21 $_REQUEST['conversation_id'] = 1;
22 $result = api_statuses_home_timeline('json');
23 self::assertNotEmpty($result['status']);
24 foreach ($result['status'] as $status) {
25 self::assertStatus($status);
31 * Test the api_statuses_home_timeline() function with a negative page parameter.
35 public function testApiStatusesHomeTimelineWithNegativePage()
37 self::markTestIncomplete('Needs Home to not set header during call (like at BaseApi::setLinkHeader');
40 $_REQUEST['page'] = -2;
41 $result = api_statuses_home_timeline('json');
42 self::assertNotEmpty($result['status']);
43 foreach ($result['status'] as $status) {
44 self::assertStatus($status);
50 * Test the api_statuses_home_timeline() with an unallowed user.
54 public function testApiStatusesHomeTimelineWithUnallowedUser()
56 self::markTestIncomplete('Needs Home to not set header during call (like at BaseApi::setLinkHeader');
59 $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
60 BasicAuth::setCurrentUserID();
61 api_statuses_home_timeline('json');
66 * Test the api_statuses_home_timeline() function with an RSS result.
70 public function testApiStatusesHomeTimelineWithRss()
72 self::markTestIncomplete('Needs Home to not set header during call (like at BaseApi::setLinkHeader');
74 // $result = api_statuses_home_timeline('rss');
75 // self::assertXml($result, 'statuses');