be sure to register hooks

This commit is contained in:
Matthias Pfefferle 2022-12-27 16:14:19 +01:00
parent b984319f8f
commit 4b97d412e0

View file

@ -1,6 +1,8 @@
<?php <?php
class Test_Activitypub_Post extends WP_UnitTestCase { class Test_Activitypub_Post extends WP_UnitTestCase {
public function test_to_array() { public function test_to_array() {
\Activitypub\Activitypub::init();
$post = \wp_insert_post( $post = \wp_insert_post(
array( array(
'post_author' => 1, 'post_author' => 1,
@ -16,8 +18,6 @@ class Test_Activitypub_Post extends WP_UnitTestCase {
\wp_trash_post( $post ); \wp_trash_post( $post );
\sleep( 3 );
$activitypub_post = new \Activitypub\Model\Post( $post ); $activitypub_post = new \Activitypub\Model\Post( $post );
$this->assertEquals( $permalink, $activitypub_post->get_id() ); $this->assertEquals( $permalink, $activitypub_post->get_id() );