Skip to content

Commit

Permalink
do not migrate outbox items. fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwiebe committed Jan 24, 2025
1 parent 560c5de commit 0cf8b91
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
22 changes: 12 additions & 10 deletions includes/class-activitypub.php
Original file line number Diff line number Diff line change
Expand Up @@ -523,21 +523,23 @@ private static function register_post_types() {
register_post_type(
Outbox::POST_TYPE,
array(
'labels' => array(
'labels' => array(
'name' => _x( 'Outbox', 'post_type plural name', 'activitypub' ),
'singular_name' => _x( 'Outbox Item', 'post_type single name', 'activitypub' ),
),
'capabilities' => array(
'capabilities' => array(
'create_posts' => false,
),
'map_meta_cap' => true,
'public' => true,
'hierarchical' => true,
'rewrite' => false,
'query_var' => false,
'delete_with_user' => true,
'can_export' => true,
'supports' => array(),
'map_meta_cap' => true,
'public' => true,
'hierarchical' => true,
'rewrite' => false,
'query_var' => false,
'delete_with_user' => true,
'can_export' => true,
'supports' => array(),
'exclude_from_search' => true,
'menu_icon' => 'dashicons-networking',
)
);

Expand Down
10 changes: 9 additions & 1 deletion tests/includes/class-test-migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ public static function set_up_before_class() {
\remove_action( 'wp_insert_comment', array( \Activitypub\Scheduler\Comment::class, 'schedule_comment_activity_on_insert' ) );

// Create test posts.
self::$fixtures['posts'] = self::factory()->post->create_many( 3, array( 'post_author' => 1 ) );
self::$fixtures['posts'] = self::factory()->post->create_many(
3,
array(
'post_author' => 1,
'meta_input' => array( 'activitypub_status' => 'federated' ),
)
);

$modified_post_id = self::factory()->post->create(
array(
Expand All @@ -43,6 +49,7 @@ public static function set_up_before_class() {
'post_status' => 'publish',
'post_type' => 'post',
'post_date' => '2020-01-01 00:00:00',
'meta_input' => array( 'activitypub_status' => 'federated' ),
)
);
self::factory()->post->update_object( $modified_post_id, array( 'post_content' => 'Test post 2 updated' ) );
Expand Down Expand Up @@ -77,6 +84,7 @@ public static function set_up_before_class() {
'comment_approved' => '1',
)
);
\add_comment_meta( self::$fixtures['comment'], 'activitypub_status', 'federated' );
}

/**
Expand Down

0 comments on commit 0cf8b91

Please sign in to comment.