Make WordPress Core

Ticket #26642: 26642.5.1.diff

File 26642.5.1.diff, 1.0 KB (added by jond3r, 11 years ago)

Improved unit test, not using regexp.

  • tests/phpunit/tests/media.php

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