Changeset 14143 for trunk/tests/phpunit/testcases/routing/core.php
- Timestamp:
- 12/15/2025 02:52:55 AM (6 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/testcases/routing/core.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/routing/core.php
r14070 r14143 23 23 } 24 24 25 function test_wordpress_page() {25 public function test_wordpress_page() { 26 26 $this->set_permalink_structure( '/%postname%/' ); 27 27 $this->go_to( '/' ); 28 28 $this->assertEmpty( bp_current_component() ); 29 29 } 30 31 /** 32 * @ticket BP9300 33 */ 34 public function test_buddypress_directory_is_home_false() { 35 $this->set_permalink_structure( '/%postname%/' ); 36 37 $is_home_value = null; 38 39 // Capture the is_home value during pre_get_posts for the main query. 40 $callback = function ( $query ) use ( &$is_home_value ) { 41 if ( $query->is_main_query() ) { 42 $is_home_value = $query->is_home; 43 } 44 }; 45 46 add_action( 'pre_get_posts', $callback ); 47 48 $this->go_to( bp_get_members_directory_permalink() ); 49 50 remove_action( 'pre_get_posts', $callback ); 51 52 $this->assertFalse( $is_home_value, 'is_home should be false for a BuddyPress directory page on the main query.' ); 53 } 30 54 }
Note: See TracChangeset
for help on using the changeset viewer.