Make WordPress Core


Ignore:
Timestamp:
08/25/2015 09:50:55 PM (9 years ago)
Author:
wonderboymusic
Message:

Add some more data for Shortcode unit tests.

Props miqrogroove.
Fixes #33455.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/shortcode.php

    r33600 r33740  
    55class Tests_Shortcode extends WP_UnitTestCase {
    66
    7     protected $shortcodes = array( 'test-shortcode-tag', 'footag', 'bartag', 'baztag', 'dumptag', 'hyphen', 'hyphen-foo', 'hyphen-foo-bar' );
     7    protected $shortcodes = array( 'test-shortcode-tag', 'footag', 'bartag', 'baztag', 'dumptag', 'hyphen', 'hyphen-foo', 'hyphen-foo-bar', 'url' );
    88
    99    function setUp() {
     
    7272    function _shortcode_hyphen_foo_bar() {
    7373        return __FUNCTION__;
     74    }
     75
     76    function _shortcode_url() {
     77        return 'http://www.wordpress.org/';
    7478    }
    7579
     
    455459                '',
    456460            ),
     461            array(
     462                '[url]',
     463                'http://www.wordpress.org/',
     464            ),
     465            array(
     466                '<a href="[url]">',
     467                '<a href="http://www.wordpress.org/">',
     468            ),
     469            array(
     470                '<a href=[url] >',
     471                '<a href=http://www.wordpress.org/ >',
     472            ),
     473            array(
     474                '<a href="[url]plugins/">',
     475                '<a href="http://www.wordpress.org/plugins/">',
     476            ),
     477            array(
     478                '<a href="bad[url]">',
     479                '<a href="//www.wordpress.org/">',
     480            ),
     481            array(
     482                '<a onclick="bad[url]">',
     483                '<a onclick="bad[url]">',
     484            ),
    457485        );
    458486    }
Note: See TracChangeset for help on using the changeset viewer.