mirror of
https://github.com/friendica/friendica
synced 2025-04-23 23:10:10 +00:00
Re-enable AccountVerifyCredentials test
This commit is contained in:
parent
902bcc506f
commit
cc7b2fae4e
4 changed files with 246 additions and 174 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
namespace Friendica\Test\src\Module\Api\Mastodon\Accounts;
|
||||
|
||||
use Friendica\App\Router;
|
||||
use Friendica\DI;
|
||||
use Friendica\Module\Api\Mastodon\Accounts\VerifyCredentials;
|
||||
use Friendica\Test\src\Module\Api\ApiTest;
|
||||
|
||||
class VerifyCredentialsTest extends ApiTest
|
||||
|
@ -13,7 +16,18 @@ class VerifyCredentialsTest extends ApiTest
|
|||
*/
|
||||
public function testApiAccountVerifyCredentials()
|
||||
{
|
||||
// self::assertArrayHasKey('user', api_account_verify_credentials('json'));
|
||||
$verifyCredentials = new VerifyCredentials(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::GET]);
|
||||
$response = $verifyCredentials->run();
|
||||
|
||||
$body = (string)$response->getBody();
|
||||
|
||||
self::assertJson($body);
|
||||
|
||||
$json = json_decode($body);
|
||||
|
||||
self::assertEquals(42, $json->id);
|
||||
self::assertIsArray($json->emojis);
|
||||
self::assertIsArray($json->fields);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -23,6 +37,8 @@ class VerifyCredentialsTest extends ApiTest
|
|||
*/
|
||||
public function testApiAccountVerifyCredentialsWithoutAuthenticatedUser()
|
||||
{
|
||||
self::markTestIncomplete('Needs dynamic BasicAuth first');
|
||||
|
||||
// $this->expectException(\Friendica\Network\HTTPException\UnauthorizedException::class);
|
||||
// BasicAuth::setCurrentUserID();
|
||||
// $_SESSION['authenticated'] = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue