Changeset 62229
- Timestamp:
- 04/13/2026 07:29:55 AM (32 hours ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/oembed/WpEmbed.php (modified) (25 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/oembed/WpEmbed.php
r62223 r62229 4 4 * @group oembed 5 5 * 6 * @covers WP_Embed6 * @coversDefaultClass WP_Embed 7 7 */ 8 8 class Tests_WP_Embed extends WP_UnitTestCase { … … 25 25 } 26 26 27 /** 28 * @covers ::maybe_run_ajax_cache 29 */ 27 30 public function test_maybe_run_ajax_cache_should_return_nothing_if_there_is_no_post() { 28 31 $this->expectOutputString( '' ); … … 30 33 } 31 34 35 /** 36 * @covers ::maybe_run_ajax_cache 37 */ 32 38 public function test_maybe_run_ajax_cache_should_return_nothing_if_there_is_no_message() { 33 39 $GLOBALS['post'] = self::factory()->post->create_and_get( … … 43 49 } 44 50 51 /** 52 * @covers ::maybe_run_ajax_cache 53 */ 45 54 public function test_maybe_run_ajax_cache_should_return_javascript() { 46 55 $GLOBALS['post'] = self::factory()->post->create_and_get( … … 60 69 } 61 70 71 /** 72 * @covers ::wp_maybe_load_embeds 73 */ 62 74 public function test_wp_maybe_load_embeds() { 63 75 $this->assertSameSets( array( 10, 9999 ), array_keys( $GLOBALS['wp_embed']->handlers ) ); … … 77 89 } 78 90 91 /** 92 * @covers ::wp_embed_register_handler 93 */ 79 94 public function test_wp_embed_register_handler() { 80 95 $handle = __FUNCTION__; … … 95 110 } 96 111 112 /** 113 * @covers ::wp_embed_unregister_handler 114 */ 97 115 public function test_wp_embed_unregister_handler() { 98 116 $this->assertArrayHasKey( 'youtube_embed_url', $GLOBALS['wp_embed']->handlers[10] ); … … 110 128 /** 111 129 * @group external-http 130 * 131 * @covers ::autoembed 112 132 */ 113 133 public function test_autoembed_should_do_nothing_without_matching_handler() { … … 120 140 /** 121 141 * @group external-http 142 * 143 * @covers ::autoembed 122 144 */ 123 145 public function test_autoembed_should_return_modified_content() { … … 136 158 } 137 159 160 /** 161 * @covers ::delete_oembed_caches 162 */ 138 163 public function test_delete_oembed_caches() { 139 164 $post_id = self::factory()->post->create(); … … 149 174 } 150 175 176 /** 177 * @covers ::cache_oembed 178 */ 151 179 public function test_cache_oembed_invalid_post_type() { 152 180 $post_id = self::factory()->post->create( array( 'post_type' => 'nav_menu_item' ) ); … … 156 184 } 157 185 186 /** 187 * @covers ::cache_oembed 188 */ 158 189 public function test_cache_oembed_empty_content() { 159 190 $post_id = self::factory()->post->create( array( 'post_content' => '' ) ); … … 163 194 } 164 195 196 /** 197 * @covers ::cache_oembed 198 */ 165 199 public function test_cache_oembed_for_post() { 166 200 $url = 'https://example.com/'; … … 181 215 } 182 216 217 /** 218 * @covers ::shortcode 219 */ 183 220 public function test_shortcode_should_get_cached_data_from_post_meta_for_known_post() { 184 221 global $post; … … 208 245 } 209 246 247 /** 248 * @covers ::shortcode 249 */ 210 250 public function test_shortcode_should_get_cached_failure_from_post_meta_for_known_post() { 211 251 global $post; … … 242 282 /** 243 283 * @ticket 34115 284 * 285 * @covers ::shortcode 244 286 */ 245 287 public function test_shortcode_should_cache_data_in_custom_post() { … … 268 310 /** 269 311 * @ticket 34115 312 * 313 * @covers ::shortcode 270 314 */ 271 315 public function test_shortcode_should_cache_failure_in_custom_post() { … … 296 340 * 297 341 * @ticket 42310 342 * 343 * @covers ::shortcode 298 344 */ 299 345 public function test_shortcode_should_update_custom_post() { … … 328 374 /** 329 375 * @group external-http 376 * 377 * @covers ::shortcode 330 378 */ 331 379 public function test_shortcode_should_get_url_from_src_attribute() { … … 338 386 /** 339 387 * @group external-http 388 * 389 * @covers ::shortcode 340 390 */ 341 391 public function test_shortcode_should_return_empty_string_for_missing_url() { … … 345 395 /** 346 396 * @group external-http 397 * 398 * @covers ::shortcode 347 399 */ 348 400 public function test_shortcode_should_make_link_for_unknown_url() { … … 354 406 355 407 /** 356 * @ group external-http408 * @covers ::run_shortcode 357 409 */ 358 410 public function test_run_shortcode_url_only() { … … 362 414 } 363 415 416 /** 417 * @covers ::maybe_make_link 418 */ 364 419 public function test_maybe_make_link() { 365 420 $url = 'http://example.com/embed/foo'; … … 369 424 } 370 425 426 /** 427 * @covers ::maybe_make_link 428 */ 371 429 public function test_maybe_make_link_return_false_on_fail() { 372 430 $this->wp_embed->return_false_on_fail = true; … … 374 432 } 375 433 434 /** 435 * @covers ::maybe_make_link 436 */ 376 437 public function test_maybe_make_link_do_not_link_if_unknown() { 377 438 $url = 'http://example.com/';
Note: See TracChangeset
for help on using the changeset viewer.