Add unit test for comment_exists()
.
See #33871. git-svn-id: https://develop.svn.wordpress.org/trunk@34456 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4cbd2fbc55
commit
01c8e7a8e1
22
tests/phpunit/tests/admin/includesComment.php
Normal file
22
tests/phpunit/tests/admin/includesComment.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group admin
|
||||||
|
* @group comment
|
||||||
|
*/
|
||||||
|
class Tests_Admin_IncludesComment extends WP_UnitTestCase {
|
||||||
|
public function test_must_match_date_and_author() {
|
||||||
|
$c1 = $this->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' ) );
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user