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