Changeset 47122 for trunk/tests/phpunit/tests/url.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/url.php
r46586 r47122 1 1 <?php 2 2 3 // tests for link-template.php and related URL functions4 3 /** 4 * Tests for link-template.php and related URL functions. 5 * 5 6 * @group url 6 7 */ … … 201 202 $screen = get_current_screen(); 202 203 203 // Pretend to be in the site admin 204 // Pretend to be in the site admin. 204 205 set_current_screen( 'dashboard' ); 205 206 $home = get_option( 'home' ); 206 207 207 // home_url() should return http when in the admin 208 // home_url() should return http when in the admin. 208 209 $_SERVER['HTTPS'] = 'on'; 209 210 $this->assertEquals( $home, home_url() ); … … 212 213 $this->assertEquals( $home, home_url() ); 213 214 214 // If not in the admin, is_ssl() should determine the scheme 215 // If not in the admin, is_ssl() should determine the scheme. 215 216 set_current_screen( 'front' ); 216 217 $this->assertEquals( $home, home_url() ); … … 219 220 $this->assertEquals( $home, home_url() ); 220 221 221 // Test with https in home 222 // Test with https in home. 222 223 update_option( 'home', set_url_scheme( $home, 'https' ) ); 223 224 224 // Pretend to be in the site admin 225 // Pretend to be in the site admin. 225 226 set_current_screen( 'dashboard' ); 226 227 $home = get_option( 'home' ); 227 228 228 // home_url() should return whatever scheme is set in the home option when in the admin 229 // home_url() should return whatever scheme is set in the home option when in the admin. 229 230 $_SERVER['HTTPS'] = 'on'; 230 231 $this->assertEquals( $home, home_url() ); … … 233 234 $this->assertEquals( $home, home_url() ); 234 235 235 // If not in the admin, is_ssl() should determine the scheme unless https hard-coded in home 236 // If not in the admin, is_ssl() should determine the scheme unless https hard-coded in home. 236 237 set_current_screen( 'front' ); 237 238 $this->assertEquals( $home, home_url() ); … … 249 250 $screen = get_current_screen(); 250 251 251 // Pretend to be in the site admin 252 // Pretend to be in the site admin. 252 253 set_current_screen( 'dashboard' ); 253 254 $home = network_home_url(); 254 255 255 // home_url() should return http when in the admin 256 // home_url() should return http when in the admin. 256 257 $this->assertEquals( 0, strpos( $home, 'http://' ) ); 257 258 $_SERVER['HTTPS'] = 'on'; … … 261 262 $this->assertEquals( $home, network_home_url() ); 262 263 263 // If not in the admin, is_ssl() should determine the scheme 264 // If not in the admin, is_ssl() should determine the scheme. 264 265 set_current_screen( 'front' ); 265 266 $this->assertEquals( $home, network_home_url() ); … … 350 351 $this->assertEquals( $post_id, $p->ID ); 351 352 352 // The same again to make sure a cached query returns the same result 353 // The same again to make sure a cached query returns the same result. 353 354 $p = get_adjacent_post(); 354 355 $this->assertInstanceOf( 'WP_Post', $p ); 355 356 $this->assertEquals( $post_id, $p->ID ); 356 357 357 // Test next 358 // Test next. 358 359 $p = get_adjacent_post( false, '', false ); 359 360 $this->assertEquals( '', $p );
Note: See TracChangeset
for help on using the changeset viewer.