8045afd81b
wp-tests-config.php can/should reside in the root of a develop checkout. `phpunit` should be run from the root. see #25088. git-svn-id: https://develop.svn.wordpress.org/trunk@25165 602fd350-edb4-49c9-b593-d223f7449a82
18 lines
702 B
PHP
18 lines
702 B
PHP
<?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 );
|
|
}
|
|
}
|