Changeset 36307 for trunk/tests/phpunit/tests/rewrite.php
- Timestamp:
- 01/15/2016 07:55:19 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rewrite.php
r36254 r36307 305 305 306 306 /** 307 * @ticket 34971 308 */ 309 function test_url_to_postid_static_front_page() { 310 $post_id = self::factory()->post->create( array( 'post_type' => 'page' ) ); 311 312 $this->assertSame( 0, url_to_postid( home_url() ) ); 313 314 update_option( 'show_on_front', 'page' ); 315 update_option( 'page_on_front', $post_id ); 316 317 $this->assertSame( $post_id, url_to_postid( set_url_scheme( home_url(), 'http' ) ) ); 318 $this->assertSame( $post_id, url_to_postid( set_url_scheme( home_url(), 'https' ) ) ); 319 $this->assertSame( $post_id, url_to_postid( str_replace( array( 'http://', 'https://' ), 'http://www.', home_url() ) ) ); 320 $this->assertSame( $post_id, url_to_postid( home_url() . '#random' ) ); 321 $this->assertSame( $post_id, url_to_postid( home_url() . '?random' ) ); 322 323 update_option( 'show_on_front', 'posts' ); 324 } 325 326 /** 307 327 * @ticket 21970 308 328 */
Note: See TracChangeset
for help on using the changeset viewer.