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
This commit is contained in:
Diogo Cordeiro
2018-07-26 21:12:13 +00:00
parent e377b87ff7
commit eaad9423dd
45 changed files with 4723 additions and 1918 deletions

View File

@@ -0,0 +1,29 @@
<?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']));
}
}