now with more use

This commit is contained in:
Matt Wiebe 2023-05-12 15:31:53 -05:00
parent 314ccf43a6
commit 3fa5e4f37e
10 changed files with 17 additions and 1 deletions

View file

@ -1,6 +1,8 @@
<?php
namespace Activitypub\Model;
use function Activitypub\get_rest_url_by_path;
/**
* ActivityPub Post Class
*

View file

@ -1,6 +1,8 @@
<?php
namespace Activitypub\Model;
use function Activitypub\get_rest_url_by_path;
/**
* ActivityPub Post Class
*

View file

@ -6,6 +6,7 @@ use stdClass;
use WP_REST_Server;
use WP_REST_Response;
use Activitypub\Collection\Followers as FollowerCollection;
use function Activitypub\get_rest_url_by_path;
/**
* ActivityPub Followers REST-Class

View file

@ -1,6 +1,8 @@
<?php
namespace Activitypub\Rest;
use function Activitypub\get_rest_url_by_path;
/**
* ActivityPub Following REST-Class
*

View file

@ -2,6 +2,7 @@
namespace Activitypub\Rest;
use Activitypub\Model\Activity;
use function Activitypub\get_rest_url_by_path;
/**
* ActivityPub Inbox REST-Class

View file

@ -1,6 +1,8 @@
<?php
namespace Activitypub\Rest;
use function Activitypub\get_rest_url_by_path;
/**
* ActivityPub NodeInfo REST-Class
*

View file

@ -1,6 +1,8 @@
<?php
namespace Activitypub\Rest;
use function Activitypub\get_rest_url_by_path;
/**
* ActivityPub Outbox REST-Class
*

View file

@ -1,4 +1,6 @@
<?php
use function Activitypub\get_rest_url_by_path;
$author_id = \get_the_author_meta( 'ID' );
$json = new \stdClass();

View file

@ -1,4 +1,6 @@
<?php
use function Activitypub\get_rest_url_by_path;
$json = new \stdClass();
$json->{'@context'} = \Activitypub\get_context();

View file

@ -22,7 +22,7 @@ class Test_Activitypub_Activity extends WP_UnitTestCase {
$activitypub_activity = new \Activitypub\Model\Activity( 'Create' );
$activitypub_activity->from_post( $activitypub_post );
$this->assertContains( get_rest_url_by_path( 'users/1/followers' ), $activitypub_activity->get_to() );
$this->assertContains( \Activitypub\get_rest_url_by_path( 'users/1/followers' ), $activitypub_activity->get_to() );
$this->assertContains( 'https://example.com/alex', $activitypub_activity->get_cc() );
remove_all_filters( 'activitypub_extract_mentions' );