Changeset 36307 for trunk/tests/phpunit/tests/oembed/discovery.php
- Timestamp:
- 01/15/2016 07:55:19 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/oembed/discovery.php
r36059 r36307 10 10 11 11 function test_add_oembed_discovery_links_front_page() { 12 $this->go_to( home_url( '/') );12 $this->go_to( home_url() ); 13 13 $this->assertSame( '', get_echo( 'wp_oembed_add_discovery_links' ) ); 14 $this->assertSame( 0, url_to_postid( home_url() ) ); 14 15 } 15 16 17 /** 18 * @ticket 34971 19 */ 16 20 function test_add_oembed_discovery_links_static_front_page() { 17 21 update_option( 'show_on_front', 'page' ); 18 update_option( 'page_for_posts', self::factory()->post->create( array( 'post_title' => 'blog-page', 'post_type' => 'page' ) ) );19 22 update_option( 'page_on_front', self::factory()->post->create( array( 'post_title' => 'front-page', 'post_type' => 'page' ) ) ); 20 23 21 $this->go_to( home_url('/') ); 22 $this->assertSame( '', get_echo( 'wp_oembed_add_discovery_links' ) ); 24 $this->go_to( home_url() ); 25 $this->assertQueryTrue( 'is_front_page', 'is_singular', 'is_page' ); 26 27 $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 28 $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 29 30 $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) ); 23 31 24 32 update_option( 'show_on_front', 'posts' );
Note: See TracChangeset
for help on using the changeset viewer.