WordPress.org

Make WordPress Core

Ticket #27350: Autop-27350.diff

File Autop-27350.diff, 752 bytes (added by jond, 7 years ago)

Autop.php unit test coverage for #27350

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

     
    400400
    401401                $this->assertEquals( $expected, trim( wpautop( $content ) ) );
    402402        }
     403
     404        /**
     405         * wpautop() should correctly pee in blocks
     406         *
     407         * @ticket 27350
     408         */
     409        function test_pee_in_divs() {
     410                $str = "<div>hello\n<pre>test</pre>\nworld</div>";
     411                $this->assertEquals( "<div>\n<p>hello</p>\n<pre>test</pre>\n<p>world</p>\n</div>", trim( wpautop( $str ) ) );
     412
     413                $str = "hello<div>test</div>";
     414                $this->assertEquals( "<p>hello</p>\n<div>\n<p>test</p>\n</div>", trim( wpautop( $str ) ) );
     415        }
    403416}