1, 'post_content' => '@alex hello', ) ); add_filter( 'activitypub_extract_mentions', function( $mentions ) { $mentions['@alex'] = 'https://example.com/alex'; return $mentions; }, 10 ); $activitypub_post = new \Activitypub\Model\Post( $post ); $activitypub_activity = new \Activitypub\Model\Activity( 'Create' ); $activitypub_activity->from_post( $activitypub_post ); $this->assertContains( \get_rest_url( null, '/' . ACTIVITYPUB_REST_NAMESPACE . '/users/1/followers' ), $activitypub_activity->get_to() ); $this->assertContains( 'https://example.com/alex', $activitypub_activity->get_cc() ); remove_all_filters( 'activitypub_extract_mentions' ); \wp_trash_post( $post ); } }