This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
gnu-social-v2-archive-activ.../tests/Unit/ProfileObjectTest.php
Diogo Cordeiro eaad9423dd Add Remote Flow (#43) and PHP Unit Tests from dansup (#37)
Now the code is following most of PSR
Various changes from various branches (some testing will be required)
Fixed various issues
2018-07-26 23:08:32 +01:00

30 lines
759 B
PHP

<?php
namespace Tests\Unit;
use Tests\TestCase;
class ProfileObjectTest extends TestCase
{
public function testLibraryInstalled()
{
$this->assertTrue(class_exists('\Activitypub_profile'));
}
public function testProfileObject()
{
// Mimic proper ACCEPT header
$_SERVER['HTTP_ACCEPT'] = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams';
// Fetch profile
$user = \Profile::getKV('id', 1);
// Fetch ActivityPub Actor Object representation
$profile = \Activitypub_profile::profile_to_array($user);
$this->assertTrue(is_array($profile));
$this->assertTrue(isset($profile['inbox']));
$this->assertTrue(isset($profile['outbox']));
}
}