WordPress.org

Make WordPress Core

Ticket #22625: balanceTags-unit-1162.patch

File balanceTags-unit-1162.patch, 951 bytes (added by devesine, 5 years ago)
  • tests/formatting/balanceTags.php

     
    231231                }
    232232        }
    233233
     234        /**
     235         * @ticket 22625
     236         **/
     237
     238        function test_encodes_lone_anglebracket() {
     239                $inputs = array(
     240                    'This is < That. <blockquote>foo</blockquote> Text <a href="#">link</a>. Post-link text.',
     241                    'This is <blockquote>foo</blockquote> < that.',
     242                    'This is <blockquote>foo < bar</blockquote> that.',
     243                );
     244                $expected = array(
     245                    'This is &lt; That. <blockquote>foo</blockquote> Text <a href="#">link</a>. Post-link text.',
     246                    'This is <blockquote>foo</blockquote> &lt; that.',
     247                    'This is <blockquote>foo &lt; bar</blockquote> that.',
     248                );
     249
     250                foreach ( $inputs as $key => $input ) {
     251                        $this->assertEquals( $expected[$key], balanceTags( $inputs[$key], true ) );
     252                }
     253        }
     254
    234255}