mirror of
https://github.com/Automattic/wordpress-activitypub
synced 2024-10-18 16:23:34 +00:00
e560d1b5b6
* Implement the account endpoint for an external account * phpcs * typos * Change namespace calling * Populate with more data * phpcs * some formatting * some phpdoc * Potentially extend an existing account props @pfefferle Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com> * phpcs * Switch to using jsonSerialize --------- Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
23 lines
866 B
PHP
23 lines
866 B
PHP
<?php
|
|
class Test_Enable_Mastodon_Apps extends WP_UnitTestCase {
|
|
public function set_up() {
|
|
parent::set_up();
|
|
|
|
if ( ! class_exists( '\Enable_Mastodon_Apps\Entity\Entity' ) ) {
|
|
self::markTestSkipped( 'The Enable_Mastodon_Apps plugin is not active.' );
|
|
}
|
|
}
|
|
|
|
public function test_api_account_external() {
|
|
$account = apply_filters( 'mastodon_api_account', array(), 'alex@kirk.at' );
|
|
$this->assertNotEmpty( $account );
|
|
$account = $account->jsonSerialize();
|
|
$this->assertArrayHasKey( 'id', $account );
|
|
$this->assertArrayHasKey( 'username', $account );
|
|
$this->assertArrayHasKey( 'acct', $account );
|
|
$this->assertArrayHasKey( 'display_name', $account );
|
|
$this->assertArrayHasKey( 'url', $account );
|
|
$this->assertEquals( 'https://alex.kirk.at/author/alex/', $account['url'] );
|
|
$this->assertEquals( 'Alex Kirk', $account['display_name'] );
|
|
}
|
|
}
|