Changeset 38838 for trunk/tests/phpunit/tests/media.php
- Timestamp:
- 10/20/2016 09:06:11 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/media.php
r38812 r38838 34 34 $this->img_html = '<img src="' . $this->img_url . '"/>'; 35 35 $this->img_meta = array( 'width' => 100, 'height' => 100, 'sizes' => '' ); 36 37 // Disable Twenty Seventeen changes to the image size attribute 38 remove_filter( 'wp_calculate_image_sizes', 'twentyseventeen_content_image_sizes_attr' ); 39 remove_filter( 'wp_get_attachment_image_attributes', 'twentyseventeen_post_thumbnail_sizes_attr' ); 40 } 41 42 function tearDown() { 43 parent::tearDown(); 44 45 // Reset Twenty Seventeen behaviour 46 add_filter( 'wp_calculate_image_sizes', 'twentyseventeen_content_image_sizes_attr', 10, 2 ); 47 add_filter( 'wp_get_attachment_image_attributes', 'twentyseventeen_post_thumbnail_sizes_attr', 10, 3 ); 36 48 } 37 49 … … 56 68 array( 'width' => 20, 'caption' => $this->caption ) 57 69 ); 70 58 71 $this->assertEquals( 2, preg_match_all( '/wp-caption/', $result, $_r ) ); 59 72 $this->assertEquals( 1, preg_match_all( '/alignnone/', $result, $_r ) ); 60 73 $this->assertEquals( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) ); 61 $this->assertEquals( 1, preg_match_all( "/width: 30/", $result, $_r ) ); 74 75 if ( current_theme_supports( 'html5', 'caption' ) ) { 76 $this->assertEquals( 1, preg_match_all( "/width: 20/", $result, $_r ) ); 77 } else { 78 $this->assertEquals( 1, preg_match_all( "/width: 30/", $result, $_r ) ); 79 } 62 80 } 63 81
Note: See TracChangeset
for help on using the changeset viewer.