Changeset 65101
- Timestamp:
- 10/30/2026 09:44:08 PM (8 days ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/getPosts.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/getPosts.php
r63924 r65101 6 6 */ 7 7 class Tests_Post_GetPosts extends WP_UnitTestCase { 8 private $posts_where_filter_fired = false; 9 8 10 public function test_offset_should_be_null_by_default() { 9 11 $p1 = self::factory()->post->create( … … 216 218 $this->assertSame( $expected, get_posts( $args ), 'The cached call is not of the expected form.' ); 217 219 } 220 221 /** 222 * @ticket 7326 223 */ 224 public function test_should_suppress_posts_where_filter_by_default() { 225 self::factory()->post->create(); 226 227 add_filter( 'posts_where', array( $this, 'filter_posts_where_set_flag' ) ); 228 get_posts(); 229 remove_filter( 'posts_where', array( $this, 'filter_posts_where_set_flag' ) ); 230 231 $this->assertFalse( $this->posts_where_filter_fired ); 232 } 233 234 /** 235 * @ticket 7326 236 */ 237 public function test_suppress_filters_false_should_apply_posts_where_filter() { 238 self::factory()->post->create(); 239 240 add_filter( 'posts_where', array( $this, 'filter_posts_where_set_flag' ) ); 241 get_posts( array( 'suppress_filters' => false ) ); 242 remove_filter( 'posts_where', array( $this, 'filter_posts_where_set_flag' ) ); 243 244 $this->assertTrue( $this->posts_where_filter_fired ); 245 } 246 247 public function filter_posts_where_set_flag( $where ) { 248 $this->posts_where_filter_fired = true; 249 return $where; 250 } 218 251 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)