Changeset 52010 for trunk/tests/phpunit/tests/oembed/template.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/oembed/template.php
r51587 r52010 5 5 */ 6 6 class Tests_Embed_Template extends WP_UnitTestCase { 7 function test_oembed_output_post() {7 public function test_oembed_output_post() { 8 8 $user = self::factory()->user->create_and_get( 9 9 array( … … 37 37 } 38 38 39 function test_oembed_output_post_with_thumbnail() {39 public function test_oembed_output_post_with_thumbnail() { 40 40 $post_id = self::factory()->post->create( 41 41 array( … … 70 70 } 71 71 72 function test_oembed_output_404() {72 public function test_oembed_output_404() { 73 73 $this->go_to( home_url( '/?p=123&embed=true' ) ); 74 74 $GLOBALS['wp_query']->query_vars['embed'] = true; … … 85 85 } 86 86 87 function test_oembed_output_attachment() {87 public function test_oembed_output_attachment() { 88 88 $post = self::factory()->post->create_and_get(); 89 89 $file = DIR_TESTDATA . '/images/canola.jpg'; … … 114 114 } 115 115 116 function test_oembed_output_draft_post() {116 public function test_oembed_output_draft_post() { 117 117 $post_id = self::factory()->post->create( 118 118 array( … … 137 137 } 138 138 139 function test_oembed_output_scheduled_post() {139 public function test_oembed_output_scheduled_post() { 140 140 $post_id = self::factory()->post->create( 141 141 array( … … 161 161 } 162 162 163 function test_oembed_output_private_post() {163 public function test_oembed_output_private_post() { 164 164 $post_id = self::factory()->post->create( 165 165 array( … … 184 184 } 185 185 186 function test_oembed_output_private_post_with_permissions() {186 public function test_oembed_output_private_post_with_permissions() { 187 187 $user_id = self::factory()->user->create( array( 'role' => 'editor' ) ); 188 188 wp_set_current_user( $user_id ); … … 212 212 } 213 213 214 function test_wp_embed_excerpt_more_no_embed() {214 public function test_wp_embed_excerpt_more_no_embed() { 215 215 $GLOBALS['wp_query'] = new WP_Query(); 216 216 … … 218 218 } 219 219 220 function test_wp_embed_excerpt_more() {220 public function test_wp_embed_excerpt_more() { 221 221 $post_id = self::factory()->post->create( 222 222 array( … … 240 240 } 241 241 242 function test_is_embed_post() {242 public function test_is_embed_post() { 243 243 $this->assertFalse( is_embed() ); 244 244 … … 248 248 } 249 249 250 function test_is_embed_attachment() {250 public function test_is_embed_attachment() { 251 251 $post_id = self::factory()->post->create(); 252 252 $file = DIR_TESTDATA . '/images/canola.jpg'; … … 262 262 } 263 263 264 function test_is_embed_404() {264 public function test_is_embed_404() { 265 265 $this->go_to( home_url( '/?p=12345&embed=true' ) ); 266 266 $this->assertTrue( is_embed() ); 267 267 } 268 268 269 function test_get_post_embed_html_non_existent_post() {269 public function test_get_post_embed_html_non_existent_post() { 270 270 $this->assertFalse( get_post_embed_html( 200, 200, 0 ) ); 271 271 $this->assertFalse( get_post_embed_html( 200, 200 ) ); 272 272 } 273 273 274 function test_get_post_embed_html() {274 public function test_get_post_embed_html() { 275 275 $post_id = self::factory()->post->create(); 276 276 $title = esc_attr( … … 287 287 } 288 288 289 function test_add_host_js() {289 public function test_add_host_js() { 290 290 wp_oembed_add_host_js(); 291 291 … … 300 300 * @ticket 34698 301 301 */ 302 function test_js_no_ampersands() {302 public function test_js_no_ampersands() { 303 303 $this->assertStringNotContainsString( '&', file_get_contents( ABSPATH . WPINC . '/js/wp-embed.js' ) ); 304 304 }
Note: See TracChangeset
for help on using the changeset viewer.