3 namespace Friendica\Test\src\Module\Api\Mastodon\Accounts;
5 use Friendica\App\Router;
7 use Friendica\Module\Api\Mastodon\Accounts\VerifyCredentials;
8 use Friendica\Test\src\Module\Api\ApiTest;
10 class VerifyCredentialsTest extends ApiTest
13 * Test the api_account_verify_credentials() function.
17 public function testApiAccountVerifyCredentials()
19 $verifyCredentials = new VerifyCredentials(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET]);
20 $response = $verifyCredentials->run();
22 $json = $this->toJson($response);
24 self::assertEquals(48, $json->id);
25 self::assertIsArray($json->emojis);
26 self::assertIsArray($json->fields);
30 * Test the api_account_verify_credentials() function without an authenticated user.
34 public function testApiAccountVerifyCredentialsWithoutAuthenticatedUser()
36 self::markTestIncomplete('Needs dynamic BasicAuth first');
38 // $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
39 // BasicAuth::setCurrentUserID();
40 // $_SESSION['authenticated'] = false;
41 // api_account_verify_credentials('json');