Changeset 55093 for trunk/tests/phpunit/tests/post/thumbnails.php
- Timestamp:
- 01/19/2023 07:32:28 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/thumbnails.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/thumbnails.php
r53464 r55093 409 409 } 410 410 411 /** 412 * @ticket 57490 413 */ 414 public function test_get_the_post_thumbnail_includes_loading_lazy() { 415 set_post_thumbnail( self::$post, self::$attachment_id ); 416 417 $html = get_the_post_thumbnail( self::$post ); 418 $this->assertStringContainsString( ' loading="lazy"', $html ); 419 } 420 421 /** 422 * @ticket 57490 423 */ 424 public function test_get_the_post_thumbnail_respects_passed_loading_attr() { 425 set_post_thumbnail( self::$post, self::$attachment_id ); 426 427 $html = get_the_post_thumbnail( self::$post, 'post-thumbnail', array( 'loading' => 'eager' ) ); 428 $this->assertStringContainsString( ' loading="eager"', $html, 'loading=eager was not present in img tag because attributes array with loading=eager was overwritten.' ); 429 430 $html = get_the_post_thumbnail( self::$post, 'post-thumbnail', 'loading=eager' ); 431 $this->assertStringContainsString( ' loading="eager"', $html, 'loading=eager was not present in img tag because attributes string with loading=eager was overwritten.' ); 432 } 433 434 /** 435 * @ticket 57490 436 */ 437 public function test_get_the_post_thumbnail_respects_wp_lazy_loading_enabled_filter() { 438 set_post_thumbnail( self::$post, self::$attachment_id ); 439 440 add_filter( 'wp_lazy_loading_enabled', '__return_false' ); 441 442 $html = get_the_post_thumbnail( self::$post ); 443 $this->assertStringNotContainsString( ' loading="lazy"', $html ); 444 } 445 411 446 public function data_post_thumbnail_size_filter_complex() { 412 447 return array(
Note: See TracChangeset
for help on using the changeset viewer.