Changeset 11255
- Timestamp:
- 11/28/2016 01:45:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/routing/url.php
r9819 r11255 6 6 function test_bp_core_ajax_url() { 7 7 $forced = force_ssl_admin(); 8 $old_https = isset( $_SERVER['HTTPS'] ) ? $_SERVER['HTTPS'] : null; 8 9 9 10 // (1) HTTPS off … … 27 28 28 29 // (2b) Dashboard 30 $_SERVER['HTTPS'] = 'on'; 29 31 $this->go_to( '/wp-admin' ); 30 32 $this->assertEquals( bp_core_ajax_url(), get_site_url( bp_get_root_blog_id(), '/wp-admin/admin-ajax.php', 'https' ) ); 31 33 34 // Restore to defaults. 32 35 force_ssl_admin( $forced ); 36 if ( is_null( $old_https ) ) { 37 unset( $_SERVER['HTTPS'] ); 38 } else { 39 $_SERVER['HTTPS'] = $old_https; 40 } 33 41 34 42 // (3) Multisite, root blog other than 1 … … 38 46 'path' => '/path' . rand() . time() . '/', 39 47 ) ); 48 40 49 buddypress()->root_blog_id = $blog_id; 41 42 50 $blog_url = get_blog_option( $blog_id, 'siteurl' ); 43 51 44 52 $this->go_to( trailingslashit( $blog_url ) ); 53 switch_to_blog( $blog_id ); 54 45 55 buddypress()->root_blog_id = $original_root_blog; 46 56 $ajax_url = bp_core_ajax_url(); 57 58 restore_current_blog(); 47 59 $this->go_to( '/' ); 48 60
Note: See TracChangeset
for help on using the changeset viewer.