Make WordPress Core

Ticket #33981: 33981.2.patch

File 33981.2.patch, 1.1 KB (added by joemcgill, 7 years ago)

Update unit tests

  • src/wp-includes/media.php

    diff --git src/wp-includes/media.php src/wp-includes/media.php
    index 3e3e38fe31..3fa536e8b3 100644
    function img_caption_shortcode( $attr, $content = null ) { 
    15781578
    15791579        $style = '';
    15801580        if ( $caption_width ) {
    1581                 $style = 'style="width: ' . (int) $caption_width . 'px" ';
     1581                $style = 'style="max-width: ' . (int) $caption_width . 'px" ';
    15821582        }
    15831583
    15841584        if ( $html5 ) {
  • tests/phpunit/tests/media.php

    diff --git tests/phpunit/tests/media.php tests/phpunit/tests/media.php
    index 392c039fdb..eb4746a4a2 100644
    CAP; 
    6161                $this->assertEquals( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) );
    6262
    6363                if ( current_theme_supports( 'html5', 'caption' ) ) {
    64                         $this->assertEquals( 1, preg_match_all( "/width: 20/", $result, $_r ) );
     64                        $this->assertEquals( 1, preg_match_all( "/max-width: 20/", $result, $_r ) );
    6565                } else {
    66                         $this->assertEquals( 1, preg_match_all( "/width: 30/", $result, $_r ) );
     66                        $this->assertEquals( 1, preg_match_all( "/max-width: 30/", $result, $_r ) );
    6767                }
    6868        }
    6969