mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 11:44:33 +00:00
Add 'comment_type' to the list of fields wp_update_comment() can update.
props desaiuditd. fixes #30627. git-svn-id: https://develop.svn.wordpress.org/trunk@31171 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -15,6 +15,19 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
$this->assertEquals( 0, $result );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 30627
|
||||
*/
|
||||
function test_wp_update_comment_updates_comment_type() {
|
||||
$post_id = $this->factory->post->create();
|
||||
$comment_id = $this->factory->comment->create( array( 'comment_post_ID' => $post_id ) );
|
||||
|
||||
wp_update_comment( array( 'comment_ID' => $comment_id, 'comment_type' => 'pingback' ) );
|
||||
|
||||
$comment = get_comment( $comment_id );
|
||||
$this->assertEquals( 'pingback', $comment->comment_type );
|
||||
}
|
||||
|
||||
public function test_get_approved_comments() {
|
||||
$p = $this->factory->post->create();
|
||||
$ca1 = $this->factory->comment->create( array( 'comment_post_ID' => $p, 'comment_approved' => '1' ) );
|
||||
|
||||
Reference in New Issue
Block a user