From 01c8e7a8e1c7f367cd0511f663b4d8fa04c606f9 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Wed, 23 Sep 2015 14:34:37 +0000 Subject: [PATCH] Add unit test for `comment_exists()`. See #33871. git-svn-id: https://develop.svn.wordpress.org/trunk@34456 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/admin/includesComment.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/phpunit/tests/admin/includesComment.php diff --git a/tests/phpunit/tests/admin/includesComment.php b/tests/phpunit/tests/admin/includesComment.php new file mode 100644 index 0000000000..2b3d915ec1 --- /dev/null +++ b/tests/phpunit/tests/admin/includesComment.php @@ -0,0 +1,22 @@ +factory->comment->create( array( + 'comment_author' => 'foo', + 'comment_date' => '2014-05-06 12:00:00', + ) ); + + $c2 = $this->factory->comment->create( array( + 'comment_author' => 'bar', + 'comment_date' => '2004-01-02 12:00:00', + ) ); + + $this->assertNull( comment_exists( 'foo', '2004-01-02 12:00:00' ) ); + $this->assertEquals( $c1, comment_exists( 'foo', '2014-05-06 12:00:00' ) ); + } +}