Add some more data for Shortcode unit tests.
Props miqrogroove. Fixes #33455. git-svn-id: https://develop.svn.wordpress.org/trunk@33740 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4a622d21fb
commit
a0a351a75d
@ -4,7 +4,7 @@
|
||||
*/
|
||||
class Tests_Shortcode extends WP_UnitTestCase {
|
||||
|
||||
protected $shortcodes = array( 'test-shortcode-tag', 'footag', 'bartag', 'baztag', 'dumptag', 'hyphen', 'hyphen-foo', 'hyphen-foo-bar' );
|
||||
protected $shortcodes = array( 'test-shortcode-tag', 'footag', 'bartag', 'baztag', 'dumptag', 'hyphen', 'hyphen-foo', 'hyphen-foo-bar', 'url' );
|
||||
|
||||
function setUp() {
|
||||
parent::setUp();
|
||||
@ -73,6 +73,10 @@ class Tests_Shortcode extends WP_UnitTestCase {
|
||||
return __FUNCTION__;
|
||||
}
|
||||
|
||||
function _shortcode_url() {
|
||||
return 'http://www.wordpress.org/';
|
||||
}
|
||||
|
||||
function test_noatts() {
|
||||
do_shortcode('[test-shortcode-tag /]');
|
||||
$this->assertEquals( '', $this->atts );
|
||||
@ -454,6 +458,30 @@ EOF;
|
||||
'[gallery]<div>Hello</div>[/gallery]',
|
||||
'',
|
||||
),
|
||||
array(
|
||||
'[url]',
|
||||
'http://www.wordpress.org/',
|
||||
),
|
||||
array(
|
||||
'<a href="[url]">',
|
||||
'<a href="http://www.wordpress.org/">',
|
||||
),
|
||||
array(
|
||||
'<a href=[url] >',
|
||||
'<a href=http://www.wordpress.org/ >',
|
||||
),
|
||||
array(
|
||||
'<a href="[url]plugins/">',
|
||||
'<a href="http://www.wordpress.org/plugins/">',
|
||||
),
|
||||
array(
|
||||
'<a href="bad[url]">',
|
||||
'<a href="//www.wordpress.org/">',
|
||||
),
|
||||
array(
|
||||
'<a onclick="bad[url]">',
|
||||
'<a onclick="bad[url]">',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user