WordPress.org

Make WordPress Core

Ticket #14050: shortcode_unautop-unit-tests.diff

File shortcode_unautop-unit-tests.diff, 908 bytes (added by aaroncampbell, 7 years ago)

Unit Tests

  • wp-testcase/test_shortcode.php

     
    300300                $this->assertEquals( $expected, $out );
    301301        }
    302302
     303        function test_shortcode_unautop() {
     304                // a blank line is added at the end, so test with it already there
     305                $test_string = <<<EOF
     306[footag]
     307
     308EOF;
     309
     310                $this->assertEquals( $test_string, shortcode_unautop( wpautop( $test_string ) ) );
     311        }
     312
     313        function test_multiple_shortcode_unautop() {
     314                // a blank line is added at the end, so test with it already there
     315                $test_string = <<<EOF
     316[footag]
     317[footag]
     318
     319EOF;
     320
     321                $actual = shortcode_unautop( wpautop( $test_string ) );
     322                $this->assertEquals( $test_string, $actual );
     323        }
     324
    303325}
    304326//http://core.trac.wordpress.org/ticket/10326
    305327class TestShortcodeStripping extends WPTestCase {