Changeset 52577
- Timestamp:
- 01/14/2022 05:50:52 PM (4 years ago)
- Location:
- trunk/tests/phpunit/tests/query
- Files:
-
- 2 edited
-
invalidQueries.php (modified) (4 diffs)
-
taxQuery.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/invalidQueries.php
r51568 r52577 92 92 93 93 $query = new WP_Query( array( 'post_type' => 'unregistered_cpt' ) ); 94 $posts = $query->get_posts();95 94 96 95 $this->assertStringContainsString( "{$wpdb->posts}.post_type = 'unregistered_cpt'", self::$last_posts_request ); 97 96 $this->assertStringContainsString( "{$wpdb->posts}.post_status = 'publish'", self::$last_posts_request ); 98 $this->assertCount( 0, $ posts );97 $this->assertCount( 0, $query->posts ); 99 98 } 100 99 … … 112 111 ) 113 112 ); 114 $posts = $query->get_posts();115 113 116 114 $this->assertStringContainsString( "{$wpdb->posts}.post_type = 'unregistered_cpt'", self::$last_posts_request ); 117 $this->assertCount( 1, $ posts, 'the valid `page` post type should still return one post' );115 $this->assertCount( 1, $query->posts, 'the valid `page` post type should still return one post' ); 118 116 } 119 117 … … 144 142 ) 145 143 ); 146 $posts = $query->get_posts();147 144 148 145 // Only the published page should be returned. 149 $this->assertCount( 1, $ posts );146 $this->assertCount( 1, $query->posts ); 150 147 } 151 148 … … 159 156 ) 160 157 ); 161 $posts = $query->get_posts();162 158 163 159 // Only the published post should be returned. 164 $this->assertCount( 1, $ posts );160 $this->assertCount( 1, $query->posts ); 165 161 } 166 162 } -
trunk/tests/phpunit/tests/query/taxQuery.php
r52389 r52577 1025 1025 ); 1026 1026 1027 $posts = $query->get_posts(); 1028 $this->assertCount( 0, $posts ); 1027 $this->assertCount( 0, $query->posts ); 1029 1028 } 1030 1029 … … 1060 1059 ); 1061 1060 1062 $posts = $query->get_posts(); 1063 $this->assertCount( 0, $posts ); 1061 $this->assertCount( 0, $query->posts ); 1064 1062 } 1065 1063
Note: See TracChangeset
for help on using the changeset viewer.