Skip to content

Commit

Permalink
[not verified] Fixes tests for Sync posts delete event type. (#29154)
Browse files Browse the repository at this point in the history
* Added event type for latest event getter to avoid breaking tests.

* changelog
  • Loading branch information
zinigor authored and jhnstn committed Feb 24, 2023
1 parent d305b53 commit e18273d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Test fix: adapted the Sync test to WordPress Core changes in post deletion mechanics.
Original file line number Diff line number Diff line change
Expand Up @@ -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] );
Expand Down

0 comments on commit e18273d

Please sign in to comment.