mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
Shortcodes: Revert [46369] for now to allow more time to investigate and prepare for backward compatibility changes.
Also reverts follow-up changes in [46370] and [46465]. See #47863. git-svn-id: https://develop.svn.wordpress.org/trunk@46554 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -740,7 +740,7 @@ EOF;
|
||||
}
|
||||
|
||||
function data_whole_posts() {
|
||||
require_once DIR_TESTDATA . '/formatting/whole-posts.php';
|
||||
require_once( DIR_TESTDATA . '/formatting/whole-posts.php' );
|
||||
return data_whole_posts();
|
||||
}
|
||||
|
||||
@@ -972,136 +972,4 @@ EOF;
|
||||
);
|
||||
$this->assertEquals( 'test-shortcode-tag', $this->tagname );
|
||||
}
|
||||
|
||||
/**
|
||||
* Testing the `shortcode_parse_atts()` function.
|
||||
*
|
||||
* @ticket 47863
|
||||
*
|
||||
* @covers ::shortcode_parse_atts
|
||||
* @dataProvider data_shortcode_parse_atts
|
||||
*
|
||||
* @param string $text A single shortcode format or key/value pair string.
|
||||
* @param string|array $expected Expected results.
|
||||
*/
|
||||
public function test_shortcode_parse_atts( $text, $expected ) {
|
||||
$actual = shortcode_parse_atts( $text );
|
||||
$this->assertSame( $expected, $actual );
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for `test_shortcode_parse_atts()`.
|
||||
*
|
||||
* @return array {
|
||||
* @type array {
|
||||
* @type string $text A single shortcode format or key/value pair string.
|
||||
* @type string|array $expected The expected result.
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
public function data_shortcode_parse_atts() {
|
||||
|
||||
return array(
|
||||
array(
|
||||
'',
|
||||
'',
|
||||
),
|
||||
array(
|
||||
' ',
|
||||
'',
|
||||
),
|
||||
array(
|
||||
'""',
|
||||
array(),
|
||||
),
|
||||
array(
|
||||
'\'\'',
|
||||
array(),
|
||||
),
|
||||
array(
|
||||
'[unittest]',
|
||||
'',
|
||||
),
|
||||
array(
|
||||
'[unitest]Unit Test[/unittest]',
|
||||
'',
|
||||
),
|
||||
array(
|
||||
'[unittest title="unittest" link="https://unit.test/"]',
|
||||
array(
|
||||
'title' => 'unittest',
|
||||
'link' => 'https://unit.test/',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'[unittest title="unittest" link="https://unit.test/"/]',
|
||||
array(
|
||||
'title' => 'unittest',
|
||||
'link' => 'https://unit.test/',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'[unit_test title="unittest" link="https://unit.test/"/]',
|
||||
array(
|
||||
'title' => 'unittest',
|
||||
'link' => 'https://unit.test/',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'[unit-test title="unittest" link="https://unit.test/"/]',
|
||||
array(
|
||||
'title' => 'unittest',
|
||||
'link' => 'https://unit.test/',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'[unittest link=https://unit.test/ /]',
|
||||
array(
|
||||
'link' => 'https://unit.test/',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'[unittest link=https://unit.test/ ]',
|
||||
array(
|
||||
'link' => 'https://unit.test/',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'[unittest link=https://unit.test/]',
|
||||
array(
|
||||
'link' => 'https://unit.test',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'[unittest link https://unit.test/ /]',
|
||||
array(
|
||||
'link',
|
||||
'https://unit.test/',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'[unittest title="unittest" link="https://unit.test/"]Unit Test[/unittest]',
|
||||
array(
|
||||
'title' => 'unittest',
|
||||
'link' => 'https://unit.test/',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'[unittest title="unittest" link="https://unit.test/"][unit_test foo="bar" bar="foo"][/unittest]',
|
||||
array(
|
||||
'title' => 'unittest',
|
||||
'link' => 'https://unit.test/',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'title="unittest" link="https://unit.test/"',
|
||||
array(
|
||||
'title' => 'unittest',
|
||||
'link' => 'https://unit.test/',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user