mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Move PHPUnit tests into a tests/phpunit directory.
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
This commit is contained in:
17
tests/phpunit/tests/comment.php
Normal file
17
tests/phpunit/tests/comment.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?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 );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user