Make WordPress Core

Ticket #3833: 3833.5.diff

File 3833.5.diff, 1.2 KB (added by jared_smith, 9 years ago)

Updated patch with unit tests

  • tests/phpunit/tests/formatting/Autop.php

     
    524524                $this->assertEquals( $expected, trim( wpautop( $content ) ) );
    525525        }
    526526
     527
     528        /**
     529         * @ticket 3833
     530         */
     531        function test_autop_blockquote_p() {
     532                $input = "<blockquote>This is a blockquote</blockquote>";
     533                $expected = "<blockquote><p>This is a blockquote</p></blockquote>";
     534                $this->assertEquals( $expected, trim( wpautop( $input ) ) );
     535        }
     536
     537        /**
     538         * @ticket 3833
     539         */
     540        function test_autop_content_before() {
     541                $input = 'text before    <div class="whatever"><blockquote>
     542text inside the blockquote tag
     543</blockquote>
     544Some text inside the div embedding the blockquote and after the closing blockquote tag
     545</div>
     546';
     547
     548                $expected = '<p>text before</p>
     549<div class="whatever">
     550<blockquote>
     551<p>text inside the blockquote tag</p>
     552</blockquote>
     553<p>Some text inside the div embedding the blockquote and after the closing blockquote tag</p>
     554</div>';
     555        $this->assertEquals( $expected, wpautop( $input ) );
     556        }
    527557}