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
This commit is contained in:
parent
01c8e7a8e1
commit
cf3042389d
@ -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' ) );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user