Make WordPress Core

Ticket #26642: 26642.5.diff

File 26642.5.diff, 1.1 KB (added by jond3r, 11 years ago)

A unit test for 26642.4.diff

  • tests/phpunit/tests/media.php

     
    108108                $this->assertEquals( 1, preg_match_all( "~wp-caption-text.*{$content_preg}~", $result, $_r ) );
    109109        }
    110110
     111        function test_new_img_caption_shortcode_new_format_no_inline() {
     112                add_theme_support( 'no-inline-style-captions' );
     113                $result = img_caption_shortcode(
     114                        array( 'width' => 20 ),
     115                        $this->img_content . $this->html_content
     116                );
     117                $img_preg = preg_quote( $this->img_content );
     118                $content_preg = preg_quote( $this->html_content );
     119
     120                $this->assertEquals( 1, preg_match( "~^<div class=\"wp-caption alignnone\">{$img_preg}<p class=\"wp-caption-text\">{$content_preg}</p></div>$~", $result ) );
     121                remove_theme_support( 'no-inline-style-captions' );
     122        }
     123
    111124        function test_add_remove_oembed_provider() {
    112125                wp_oembed_add_provider( 'http://foo.bar/*', 'http://foo.bar/oembed' );
    113126                $this->assertTrue( wp_oembed_remove_provider( 'http://foo.bar/*' ) );