WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/13/2015 06:47:33 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Add 'user_id' to the list of fields wp_update_comment() can update.

props jphase.
fixes #30307.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment.php

    r31171 r31172  
    2929    }
    3030
     31    /**
     32     * @ticket 30307
     33     */
     34    function test_wp_update_comment_updates_user_id() {
     35        $post_id = $this->factory->post->create();
     36        $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => $post_id ) );
     37
     38        wp_update_comment( array( 'comment_ID' => $comment_id, 'user_id' => 1 ) );
     39
     40        $comment = get_comment( $comment_id );
     41        $this->assertEquals( 1, $comment->user_id );
     42    }
     43
    3144    public function test_get_approved_comments() {
    3245        $p = $this->factory->post->create();
Note: See TracChangeset for help on using the changeset viewer.