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

26 lines
542 B
PHP
Raw 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 );
$activitypub_post = new \Activitypub\Model\Post( $post );
2020-10-01 19:57:19 +02:00
$this->assertEquals( $permalink, $activitypub_post->get_id() );
\wp_trash_post( $post );
2022-12-27 16:06:41 +01:00
\sleep( 3 );
$activitypub_post = new \Activitypub\Model\Post( $post );
2020-10-01 19:57:19 +02:00
$this->assertEquals( $permalink, $activitypub_post->get_id() );
}
}