diff --git a/projects/plugins/jetpack/changelog/fix-test-sync-posts-delete-event-type b/projects/plugins/jetpack/changelog/fix-test-sync-posts-delete-event-type new file mode 100644 index 0000000000000..d12ef1eb79150 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-test-sync-posts-delete-event-type @@ -0,0 +1,4 @@ +Significance: patch +Type: bugfix + +Test fix: adapted the Sync test to WordPress Core changes in post deletion mechanics. diff --git a/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-posts.php b/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-posts.php index 1909152b74820..3280f292811cf 100644 --- a/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-posts.php +++ b/projects/plugins/jetpack/tests/php/sync/test_class.jetpack-sync-posts.php @@ -134,7 +134,11 @@ public function test_delete_post_syncs_event() { wp_delete_post( $this->post->ID, true ); $this->sender->do_sync(); - $event = $this->server_event_storage->get_most_recent_event(); + + // Only getting the deleted_post event types because the latest might be + // an option update for post counts. + // @see https://core.trac.wordpress.org/changeset/55419/trunk + $event = $this->server_event_storage->get_most_recent_event( 'deleted_post' ); $this->assertEquals( 'deleted_post', $event->action ); $this->assertEquals( $this->post->ID, $event->args[0] );