Changeset 48328 for trunk/tests/phpunit/tests/post/query.php
- Timestamp:
- 07/05/2020 09:32:26 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/query.php
r47122 r48328 653 653 654 654 add_filter( 'split_the_query', '__return_true' ); 655 655 656 $q = new WP_Query( 656 657 array( … … 659 660 ) 660 661 ); 662 661 663 remove_filter( 'split_the_query', '__return_true' ); 662 664 … … 678 680 // ! $split_the_query 679 681 add_filter( 'split_the_query', '__return_false' ); 682 680 683 $q = new WP_Query( 681 684 array( … … 684 687 ) 685 688 ); 689 686 690 remove_filter( 'split_the_query', '__return_false' ); 687 691 … … 722 726 } 723 727 728 /** 729 * @ticket 42469 730 */ 731 public function test_found_posts_should_be_integer_not_string() { 732 $this->post_id = self::factory()->post->create(); 733 734 $q = new WP_Query( 735 array( 736 'posts_per_page' => 1, 737 ) 738 ); 739 740 $this->assertInternalType( 'int', $q->found_posts ); 741 } 742 743 /** 744 * @ticket 42469 745 */ 746 public function test_found_posts_should_be_integer_even_if_found_posts_filter_returns_string_value() { 747 $this->post_id = self::factory()->post->create(); 748 749 add_filter( 'found_posts', '__return_empty_string' ); 750 751 $q = new WP_Query( 752 array( 753 'posts_per_page' => 1, 754 ) 755 ); 756 757 remove_filter( 'found_posts', '__return_empty_string' ); 758 759 $this->assertInternalType( 'int', $q->found_posts ); 760 } 724 761 }
Note: See TracChangeset
for help on using the changeset viewer.