Changeset 42343 for trunk/tests/phpunit/tests/oembed/discovery.php
- Timestamp:
- 11/30/2017 11:09:33 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/oembed/discovery.php
r36307 r42343 20 20 function test_add_oembed_discovery_links_static_front_page() { 21 21 update_option( 'show_on_front', 'page' ); 22 update_option( 'page_on_front', self::factory()->post->create( array( 'post_title' => 'front-page', 'post_type' => 'page' ) ) ); 22 update_option( 23 'page_on_front', self::factory()->post->create( 24 array( 25 'post_title' => 'front-page', 26 'post_type' => 'page', 27 ) 28 ) 29 ); 23 30 24 31 $this->go_to( home_url() ); 25 32 $this->assertQueryTrue( 'is_front_page', 'is_singular', 'is_page' ); 26 33 27 $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";34 $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 28 35 $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 29 36 … … 38 45 $this->assertQueryTrue( 'is_single', 'is_singular' ); 39 46 40 $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";47 $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 41 48 $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 42 49 … … 45 52 46 53 function test_add_oembed_discovery_links_to_page() { 47 $post_id = self::factory()->post->create( array( 48 'post_type' => 'page' 49 )); 54 $post_id = self::factory()->post->create( 55 array( 56 'post_type' => 'page', 57 ) 58 ); 50 59 $this->go_to( get_permalink( $post_id ) ); 51 60 $this->assertQueryTrue( 'is_page', 'is_singular' ); 52 61 53 $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";62 $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 54 63 $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 55 64 … … 60 69 $post_id = self::factory()->post->create(); 61 70 $file = DIR_TESTDATA . '/images/canola.jpg'; 62 $attachment_id = self::factory()->attachment->create_object( $file, $post_id, array( 63 'post_mime_type' => 'image/jpeg', 64 ) ); 71 $attachment_id = self::factory()->attachment->create_object( 72 $file, $post_id, array( 73 'post_mime_type' => 'image/jpeg', 74 ) 75 ); 65 76 66 77 $this->go_to( get_permalink( $attachment_id ) ); 67 78 $this->assertQueryTrue( 'is_attachment', 'is_singular', 'is_single' ); 68 79 69 $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n";80 $expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink() ) ) . '" />' . "\n"; 70 81 $expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url( get_oembed_endpoint_url( get_permalink(), 'xml' ) ) . '" />' . "\n"; 71 82
Note: See TracChangeset
for help on using the changeset viewer.