WordPress.org

Make WordPress Core

Ticket #30142: 30142.diff

File 30142.diff, 1.7 KB (added by MikeHansenMe, 7 years ago)
  • tests/phpunit/tests/formatting/Autop.php

     
    400400
    401401                $this->assertEquals( $expected, trim( wpautop( $content ) ) );
    402402        }
     403       
     404        /**
     405         * ticket 3833
     406         */
     407        function test_autop_blockquote_p() {
     408                $input = "<blockquote>This is a blockquote</blockquote>";
     409                $expected = "<blockquote><p>This is a blockquote</p></blockquote>";
     410                $this->assertEquals( $expected, trim( wpautop( $input ) ) );
     411        }
     412
     413        /**
     414         * @ticket 3833
     415         */
     416        function test_autop_content_before() {
     417                $input = <<<EOF
     418text before    <div class="whatever"><blockquote>
     419text inside the blockquote tag
     420</blockquote>
     421Some text inside the div embedding the blockquote and after the closing blockquote tag
     422</div>
     423EOF;
     424
     425                $expected = <<<EOF
     426<p>text before</p>
     427<div class="whatever">
     428<blockquote>
     429<p>text inside the blockquote tag</p>
     430</blockquote>
     431<p>Some text inside the div embedding the blockquote and after the closing blockquote tag</p>
     432</div>
     433
     434EOF;
     435        $this->assertEquals( $expected, wpautop( $input ) );
     436        }
     437
     438        /**
     439         * @ticket 25785
     440         */
     441        function test_div_with_multiple_p() {
     442                $input = "<div>Insert FIRST PARAGRAPH here.
     443
     444Insert SECOND PARAGRAPH here.</div>";
     445                $expected = <<<EOF
     446<div>
     447<p>Insert FIRST PARAGRAPH here.</p>
     448<p>Insert SECOND PARAGRAPH here.</p>
     449</div>
     450EOF;
     451                $this->assertEquals( $expected, trim( wpautop( $input ) ) );
     452        }
     453
     454        /**
     455         * @ticket 27350
     456         */
     457        function test_wpautop_div_with_pre() {
     458                $input = "hello<div>test</div>";
     459                $expected = <<<EOF
     460<p>hello</p>
     461<div>test</div>
     462
     463EOF;
     464        $this->assertEquals( $expected, wpautop( $input ) );
     465        }
    403466}