Make WordPress Core

Ticket #14050: 14050-tests.diff

File 14050-tests.diff, 1.1 KB (added by aaroncampbell, 10 years ago)
  • tests/phpunit/tests/shortcode.php

    diff --git tests/phpunit/tests/shortcode.php tests/phpunit/tests/shortcode.php
    index 2a966bf..e6b1e58 100644
    EOF; 
    299299        }
    300300
    301301        /**
     302         * Tests `shortcode_unautop` on multiple shortcodes
     303         *
    302304         * @ticket 14050
     305         * @dataProvider data_shortcode_unautop
    303306         */
    304         function test_shortcode_unautop() {
    305                 // a blank line is added at the end, so test with it already there
    306                 $test_string = "[footag]\n";
    307                 $this->assertEquals( $test_string, shortcode_unautop( wpautop( $test_string ) ) );
     307        function test_shortcode_unautop( $test_string ) {
     308                $this->assertEquals( trim( $test_string ), trim( shortcode_unautop( wpautop( $test_string ) ) ) );
     309        }
     310
     311        function data_shortcode_unautop() {
     312                return array(
     313                        'single-shortcode'               => array( "[footag]\n" ),
     314                        'two-shortcodes-same-line'       => array( "[footag][footag]\n" ),
     315                        'two-shortcodes-one-line-apart'  => array( "[footag]\n[footag]\n" ),
     316                        'two-shortcodes-two-lines-apart' => array( "[footag]\n\n[footag]\n" ),
     317                );
    308318        }
    309319
    310320        /**