now with more use
This commit is contained in:
parent
314ccf43a6
commit
3fa5e4f37e
10 changed files with 17 additions and 1 deletions
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Activitypub\Model;
|
namespace Activitypub\Model;
|
||||||
|
|
||||||
|
use function Activitypub\get_rest_url_by_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ActivityPub Post Class
|
* ActivityPub Post Class
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Activitypub\Model;
|
namespace Activitypub\Model;
|
||||||
|
|
||||||
|
use function Activitypub\get_rest_url_by_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ActivityPub Post Class
|
* ActivityPub Post Class
|
||||||
*
|
*
|
||||||
|
|
|
@ -6,6 +6,7 @@ use stdClass;
|
||||||
use WP_REST_Server;
|
use WP_REST_Server;
|
||||||
use WP_REST_Response;
|
use WP_REST_Response;
|
||||||
use Activitypub\Collection\Followers as FollowerCollection;
|
use Activitypub\Collection\Followers as FollowerCollection;
|
||||||
|
use function Activitypub\get_rest_url_by_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ActivityPub Followers REST-Class
|
* ActivityPub Followers REST-Class
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Activitypub\Rest;
|
namespace Activitypub\Rest;
|
||||||
|
|
||||||
|
use function Activitypub\get_rest_url_by_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ActivityPub Following REST-Class
|
* ActivityPub Following REST-Class
|
||||||
*
|
*
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
namespace Activitypub\Rest;
|
namespace Activitypub\Rest;
|
||||||
|
|
||||||
use Activitypub\Model\Activity;
|
use Activitypub\Model\Activity;
|
||||||
|
use function Activitypub\get_rest_url_by_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ActivityPub Inbox REST-Class
|
* ActivityPub Inbox REST-Class
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Activitypub\Rest;
|
namespace Activitypub\Rest;
|
||||||
|
|
||||||
|
use function Activitypub\get_rest_url_by_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ActivityPub NodeInfo REST-Class
|
* ActivityPub NodeInfo REST-Class
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
namespace Activitypub\Rest;
|
namespace Activitypub\Rest;
|
||||||
|
|
||||||
|
use function Activitypub\get_rest_url_by_path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ActivityPub Outbox REST-Class
|
* ActivityPub Outbox REST-Class
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
use function Activitypub\get_rest_url_by_path;
|
||||||
|
|
||||||
$author_id = \get_the_author_meta( 'ID' );
|
$author_id = \get_the_author_meta( 'ID' );
|
||||||
|
|
||||||
$json = new \stdClass();
|
$json = new \stdClass();
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
use function Activitypub\get_rest_url_by_path;
|
||||||
|
|
||||||
$json = new \stdClass();
|
$json = new \stdClass();
|
||||||
|
|
||||||
$json->{'@context'} = \Activitypub\get_context();
|
$json->{'@context'} = \Activitypub\get_context();
|
||||||
|
|
|
@ -22,7 +22,7 @@ class Test_Activitypub_Activity extends WP_UnitTestCase {
|
||||||
$activitypub_activity = new \Activitypub\Model\Activity( 'Create' );
|
$activitypub_activity = new \Activitypub\Model\Activity( 'Create' );
|
||||||
$activitypub_activity->from_post( $activitypub_post );
|
$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() );
|
$this->assertContains( 'https://example.com/alex', $activitypub_activity->get_cc() );
|
||||||
|
|
||||||
remove_all_filters( 'activitypub_extract_mentions' );
|
remove_all_filters( 'activitypub_extract_mentions' );
|
||||||
|
|
Loading…
Reference in a new issue