wordpress-activitypub/tests/test-class-activitypub-post.php

24 lines
602 B
PHP
Raw Permalink Normal View History

<?php
class Test_Activitypub_Post extends WP_UnitTestCase {
public function test_to_array() {
$post = \wp_insert_post(
array(
'post_author' => 1,
'post_content' => 'test',
)
);
$permalink = \get_permalink( $post );
2023-07-03 17:59:42 +02:00
$activitypub_post = \Activitypub\Transformer\Post::transform( get_post( $post ) )->to_object();
2020-10-01 19:57:19 +02:00
$this->assertEquals( $permalink, $activitypub_post->get_id() );
\wp_trash_post( $post );
2023-07-03 17:59:42 +02:00
$activitypub_post = \Activitypub\Transformer\Post::transform( get_post( $post ) )->to_object();
2020-10-01 19:57:19 +02:00
$this->assertEquals( $permalink, $activitypub_post->get_id() );
}
}