Changeset 55562 for trunk/tests/phpunit/tests/post/query.php
- Timestamp:
- 03/19/2023 12:03:30 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/query.php
r53942 r55562 713 713 } 714 714 715 public function set_found_posts_provider() { 715 /** 716 * @ticket 42860 717 * 718 * @dataProvider data_set_found_posts_not_posts_as_an_array 719 */ 720 public function test_set_found_posts_not_posts_as_an_array( $posts, $expected ) { 721 $q = new WP_Query( 722 array( 723 'post_type' => 'wptests_pt', 724 'posts_per_page' => 1, 725 ) 726 ); 727 728 $q->posts = $posts; 729 730 $methd = new ReflectionMethod( 'WP_Query', 'set_found_posts' ); 731 $methd->setAccessible( true ); 732 $methd->invoke( $q, array( 'no_found_rows' => false ), array() ); 733 734 $this->assertSame( $expected, $q->found_posts ); 735 } 736 737 public function data_set_found_posts_not_posts_as_an_array() { 716 738 // Count return 0 for null, but 1 for other data you may not expect. 717 739 return array( … … 724 746 725 747 /** 726 * @ticket 42860727 *728 * @dataProvider set_found_posts_provider729 */730 public function test_set_found_posts_not_posts_as_an_array( $posts, $expected ) {731 $q = new WP_Query(732 array(733 'post_type' => 'wptests_pt',734 'posts_per_page' => 1,735 )736 );737 738 $q->posts = $posts;739 740 $methd = new ReflectionMethod( 'WP_Query', 'set_found_posts' );741 $methd->setAccessible( true );742 $methd->invoke( $q, array( 'no_found_rows' => false ), array() );743 744 $this->assertSame( $expected, $q->found_posts );745 }746 747 /**748 748 * @ticket 42469 749 749 */
Note: See TracChangeset
for help on using the changeset viewer.