]> git.mxchange.org Git - friendica.git/blob - tests/src/Module/Api/Mastodon/Accounts/VerifyCredentialsTest.php
5942aa1d273c016f76dadb9afa4a200855c47fff
[friendica.git] / tests / src / Module / Api / Mastodon / Accounts / VerifyCredentialsTest.php
1 <?php
2
3 namespace Friendica\Test\src\Module\Api\Mastodon\Accounts;
4
5 use Friendica\App\Router;
6 use Friendica\DI;
7 use Friendica\Module\Api\Mastodon\Accounts\VerifyCredentials;
8 use Friendica\Test\src\Module\Api\ApiTest;
9
10 class VerifyCredentialsTest extends ApiTest
11 {
12         /**
13          * Test the api_account_verify_credentials() function.
14          *
15          * @return void
16          */
17         public function testApiAccountVerifyCredentials()
18         {
19                 $response = (new VerifyCredentials(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET]))
20                         ->run();
21
22                 $json = $this->toJson($response);
23
24                 self::assertEquals(48, $json->id);
25                 self::assertIsArray($json->emojis);
26                 self::assertIsArray($json->fields);
27         }
28
29         /**
30          * Test the api_account_verify_credentials() function without an authenticated user.
31          *
32          * @return void
33          */
34         public function testApiAccountVerifyCredentialsWithoutAuthenticatedUser()
35         {
36                 self::markTestIncomplete('Needs dynamic BasicAuth first');
37
38                 // $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
39                 // BasicAuth::setCurrentUserID();
40                 // $_SESSION['authenticated'] = false;
41                 // api_account_verify_credentials('json');
42         }
43 }