Skip to content

Commit

Permalink
Jetpack: Fix a legacy-full-sync test with PHPUnit 9.5 (#22112)
Browse files Browse the repository at this point in the history
At some point PHPUnit changed `assertContains()` to do strict
comparison. Now that we're running the coverage tests with PHP 8 and
PHPUnit 9.5, a test was failing due to string vs int comparison.

Co-authored-by: Brandon Kraft <[email protected]>
  • Loading branch information
anomiex and kraftbj authored Dec 15, 2021
1 parent e087309 commit c18c518
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Fix a legacy sync test in PHPUnit 9.5.
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ function test_full_sync_can_sync_individual_comments() {
$comments = $synced_comments_event->args[0];

$this->assertEquals( 2, count( $comments ) );
$comment_ids = array( $comments[0]->comment_ID, $comments[1]->comment_ID );
$comment_ids = array( (int) $comments[0]->comment_ID, (int) $comments[1]->comment_ID );

$this->assertContains( $sync_comment_id, $comment_ids );
$this->assertContains( $sync_comment_id_2, $comment_ids );
Expand Down

0 comments on commit c18c518

Please sign in to comment.