fix unit tests

This commit is contained in:
Matthias Pfefferle 2023-02-02 01:50:20 +01:00
parent 472ee27849
commit 3c84be1691
2 changed files with 2 additions and 2 deletions

View file

@ -55,7 +55,7 @@ class Activity_Dispatcher {
* @param [type] $activity_type * @param [type] $activity_type
* @return void * @return void
*/ */
public function send_activity( Model\Post $activitypub_post, $activity_type ) { public static function send_activity( Model\Post $activitypub_post, $activity_type ) {
// get latest version of post // get latest version of post
$user_id = $activitypub_post->get_post_author(); $user_id = $activitypub_post->get_post_author();

View file

@ -22,7 +22,7 @@ class Test_Activitypub_Activity extends WP_UnitTestCase {
$activitypub_activity = new \Activitypub\Model\Activity( 'Create', \Activitypub\Model\Activity::TYPE_FULL ); $activitypub_activity = new \Activitypub\Model\Activity( 'Create', \Activitypub\Model\Activity::TYPE_FULL );
$activitypub_activity->from_post( $activitypub_post ); $activitypub_activity->from_post( $activitypub_post );
$this->assertContains( \get_rest_url( null, '/activitypub/1.0/users/1/followers' ), $activitypub_activity->get_cc() ); $this->assertContains( \get_rest_url( null, '/activitypub/1.0/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' );