Changeset 35225 for trunk/tests/phpunit/tests/oembed/template.php
- Timestamp:
- 10/16/2015 09:04:12 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/oembed/template.php
r34903 r35225 6 6 class Tests_Embed_Template extends WP_UnitTestCase { 7 7 function test_oembed_output_post() { 8 $user = $this->factory->user->create_and_get( array(8 $user = self::$factory->user->create_and_get( array( 9 9 'display_name' => 'John Doe', 10 10 ) ); 11 11 12 $post_id = $this->factory->post->create( array(12 $post_id = self::$factory->post->create( array( 13 13 'post_author' => $user->ID, 14 14 'post_title' => 'Hello World', … … 31 31 32 32 function test_oembed_output_post_with_thumbnail() { 33 $post_id = $this->factory->post->create( array(33 $post_id = self::$factory->post->create( array( 34 34 'post_title' => 'Hello World', 35 35 'post_content' => 'Foo Bar', … … 37 37 ) ); 38 38 $file = DIR_TESTDATA . '/images/canola.jpg'; 39 $attachment_id = $this->factory->attachment->create_object( $file, $post_id, array(39 $attachment_id = self::$factory->attachment->create_object( $file, $post_id, array( 40 40 'post_mime_type' => 'image/jpeg', 41 41 ) ); … … 73 73 74 74 function test_oembed_output_attachment() { 75 $post = $this->factory->post->create_and_get();75 $post = self::$factory->post->create_and_get(); 76 76 $file = DIR_TESTDATA . '/images/canola.jpg'; 77 $attachment_id = $this->factory->attachment->create_object( $file, $post->ID, array(77 $attachment_id = self::$factory->attachment->create_object( $file, $post->ID, array( 78 78 'post_mime_type' => 'image/jpeg', 79 79 'post_title' => 'Hello World', … … 98 98 99 99 function test_oembed_output_draft_post() { 100 $post_id = $this->factory->post->create( array(100 $post_id = self::$factory->post->create( array( 101 101 'post_title' => 'Hello World', 102 102 'post_content' => 'Foo Bar', … … 119 119 120 120 function test_oembed_output_scheduled_post() { 121 $post_id = $this->factory->post->create( array(121 $post_id = self::$factory->post->create( array( 122 122 'post_title' => 'Hello World', 123 123 'post_content' => 'Foo Bar', … … 141 141 142 142 function test_oembed_output_private_post() { 143 $post_id = $this->factory->post->create( array(143 $post_id = self::$factory->post->create( array( 144 144 'post_title' => 'Hello World', 145 145 'post_content' => 'Foo Bar', … … 162 162 163 163 function test_oembed_output_private_post_with_permissions() { 164 $user_id = $this->factory->user->create( array( 'role' => 'editor' ) );164 $user_id = self::$factory->user->create( array( 'role' => 'editor' ) ); 165 165 wp_set_current_user( $user_id ); 166 166 167 $post_id = $this->factory->post->create( array(167 $post_id = self::$factory->post->create( array( 168 168 'post_title' => 'Hello World', 169 169 'post_content' => 'Foo Bar', … … 194 194 195 195 function test_wp_oembed_excerpt_more() { 196 $post_id = $this->factory->post->create( array(196 $post_id = self::$factory->post->create( array( 197 197 'post_content' => 'Foo Bar', 198 198 ) ); … … 215 215 $this->assertFalse( is_embed() ); 216 216 217 $post_id = $this->factory->post->create();217 $post_id = self::$factory->post->create(); 218 218 $this->go_to( get_post_embed_url( $post_id ) ); 219 219 $this->assertTrue( is_embed() ); … … 221 221 222 222 function test_is_embed_attachment() { 223 $post_id = $this->factory->post->create();223 $post_id = self::$factory->post->create(); 224 224 $file = DIR_TESTDATA . '/images/canola.jpg'; 225 $attachment_id = $this->factory->attachment->create_object( $file, $post_id, array(225 $attachment_id = self::$factory->attachment->create_object( $file, $post_id, array( 226 226 'post_mime_type' => 'image/jpeg', 227 227 ) ); … … 241 241 242 242 function test_get_post_embed_html() { 243 $post_id = $this->factory->post->create();243 $post_id = self::$factory->post->create(); 244 244 245 245 $expected = '<iframe sandbox="allow-scripts" security="restricted" src="' . esc_url( get_post_embed_url( $post_id ) ) . '" width="200" height="200" title="Embedded WordPress Post" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"></iframe>';
Note: See TracChangeset
for help on using the changeset viewer.