Changeset 25364
- Timestamp:
- 09/11/2013 09:47:14 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r25002 r25364 7 7 */ 8 8 class Tests_Comment_Query extends WP_UnitTestCase { 9 var $comment_id; 9 protected $post_id; 10 protected $comment_id; 10 11 11 12 function setUp() { 12 13 parent::setUp(); 14 15 $this->post_id = $this->factory->post->create(); 13 16 } 14 17 … … 17 20 */ 18 21 function test_get_comment_comment_approved_0() { 19 $comment_id = $this->factory->comment->create( );22 $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) ); 20 23 $comments_approved_0 = get_comments( array( 'status' => 'hold' ) ); 21 24 $this->assertEquals( 0, count( $comments_approved_0 ) ); … … 26 29 */ 27 30 function test_get_comment_comment_approved_1() { 28 $comment_id = $this->factory->comment->create( );31 $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) ); 29 32 $comments_approved_1 = get_comments( array( 'status' => 'approve' ) ); 30 33 … … 81 84 */ 82 85 function test_orderby_meta() { 83 $comment_id = $this->factory->comment->create( );84 $comment_id2 = $this->factory->comment->create( );85 $comment_id3 = $this->factory->comment->create( );86 $comment_id = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) ); 87 $comment_id2 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) ); 88 $comment_id3 = $this->factory->comment->create( array( 'comment_post_ID' => $this->post_id ) ); 86 89 87 90 add_comment_meta( $comment_id, 'key', 'value1', true );
Note: See TracChangeset
for help on using the changeset viewer.