1234567891011121314151617 |
- <?php
- /**
- * @group comment
- */
- class Tests_Comment extends WP_UnitTestCase {
- function test_wp_update_comment() {
- $post = $this->factory->post->create_and_get( array( 'post_title' => 'some-post', 'post_type' => 'post' ) );
- $comments = $this->factory->comment->create_post_comments( $post->ID, 5 );
- $result = wp_update_comment( array( 'comment_ID' => $comments[0], 'comment_parent' => $comments[1] ) );
- $this->assertEquals( 1, $result );
- $comment = get_comment( $comments[0] );
- $this->assertEquals( $comments[1], $comment->comment_parent );
- $result = wp_update_comment( array( 'comment_ID' => $comments[0], 'comment_parent' => $comments[1] ) );
- $this->assertEquals( 0, $result );
- }
- }
|