Changeset 32461 for trunk/tests/phpunit/tests/comment/query.php
- Timestamp:
- 05/08/2015 07:44:06 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/comment/query.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r31793 r32461 723 723 } 724 724 725 /** 726 * @group 32081 727 */ 728 public function test_meta_query_should_work_with_comment__in() { 729 $comments = $this->factory->comment->create_many( 3 ); 730 731 add_comment_meta( $comments[0], 'foo', 'jjj' ); 732 add_comment_meta( $comments[1], 'foo', 'zzz' ); 733 add_comment_meta( $comments[2], 'foo', 'jjj' ); 734 735 $q = new WP_Comment_Query( array( 736 'comment__in' => array( $comments[1], $comments[2] ), 737 'meta_query' => array( 738 array( 739 'key' => 'foo', 740 'value' => 'jjj', 741 ), 742 ), 743 'fields' => 'ids', 744 ) ); 745 746 $this->assertEquals( array( $comments[2] ), $q->get_comments() ); 747 } 748 749 /** 750 * @group 32081 751 */ 752 public function test_meta_query_should_work_with_comment__not_in() { 753 $comments = $this->factory->comment->create_many( 3 ); 754 755 add_comment_meta( $comments[0], 'foo', 'jjj' ); 756 add_comment_meta( $comments[1], 'foo', 'zzz' ); 757 add_comment_meta( $comments[2], 'foo', 'jjj' ); 758 759 $q = new WP_Comment_Query( array( 760 'comment__not_in' => array( $comments[1], $comments[2] ), 761 'meta_query' => array( 762 array( 763 'key' => 'foo', 764 'value' => 'jjj', 765 ), 766 ), 767 'fields' => 'ids', 768 ) ); 769 770 $this->assertEquals( array( $comments[0] ), $q->get_comments() ); 771 } 725 772 726 773 /**
Note: See TracChangeset
for help on using the changeset viewer.