Make WordPress Core

Ticket #9993: 9993-tests.diff

File 9993-tests.diff, 1014 bytes (added by stevenkword, 10 years ago)

Unit tests for the_title_rss

  • tests/phpunit/tests/feed/rss2.php

     
    117117        }
    118118
    119119        /**
     120         * Test individual HTML entities encoding in the_title_rss
     121         *
     122         * @ticket 9993
     123         * @return [type] [description]
     124         */
     125        function test_entity_encoding_rss_lone_entities() {
     126                $actual = apply_filters( 'the_title_rss', '& > " test < \'' );
     127                $expected = '&amp; &gt; &quot; test &lt; &#039;';
     128                $this->assertEquals( $expected, $actual );
     129        }
     130
     131        /**
     132         * Test XML tag entities encoding in the_title_rss
     133         *
     134         * @ticket 9993
     135         * @return [type] [description]
     136         */
     137        function test_entity_encoding_rss_xml_tags() {
     138                $actual = apply_filters( 'the_title_rss', '<test>This is a test</test>' );
     139                $expected = '&lt;test&gt;This is a test&lt;/test&gt;';
     140                $this->assertEquals( $expected, $actual );
     141        }
     142
     143        /**
    120144         * @ticket UT32
    121145         */
    122146        function test_items() {