From cf3042389d98ec43f3fdb87d4478c65443378031 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 23 Sep 2015 14:46:36 +0000 Subject: [PATCH] Fix `comment_exists()` unit test introduced in [34456]. See #33871. git-svn-id: https://develop.svn.wordpress.org/trunk@34457 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/admin/includesComment.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/tests/admin/includesComment.php b/tests/phpunit/tests/admin/includesComment.php index 2b3d915ec1..5b7b01b904 100644 --- a/tests/phpunit/tests/admin/includesComment.php +++ b/tests/phpunit/tests/admin/includesComment.php @@ -6,17 +6,21 @@ */ class Tests_Admin_IncludesComment extends WP_UnitTestCase { public function test_must_match_date_and_author() { + $p1 = $this->factory->post->create(); $c1 = $this->factory->comment->create( array( - 'comment_author' => 'foo', + 'comment_author' => 1, 'comment_date' => '2014-05-06 12:00:00', + 'comment_post_ID' => $p1, ) ); + $p2 = $this->factory->post->create(); $c2 = $this->factory->comment->create( array( - 'comment_author' => 'bar', + 'comment_author' => 2, 'comment_date' => '2004-01-02 12:00:00', + 'comment_post_ID' => $p2, ) ); - $this->assertNull( comment_exists( 'foo', '2004-01-02 12:00:00' ) ); - $this->assertEquals( $c1, comment_exists( 'foo', '2014-05-06 12:00:00' ) ); + $this->assertNull( comment_exists( 1, '2004-01-02 12:00:00' ) ); + $this->assertEquals( $p1, comment_exists( 1, '2014-05-06 12:00:00' ) ); } }