diff --git a/tests/phpunit/tests/functions/wpParseSlugList.php b/tests/phpunit/tests/functions/wpParseSlugList.php new file mode 100644 index 0000000000000..0ef632cb1945d --- /dev/null +++ b/tests/phpunit/tests/functions/wpParseSlugList.php @@ -0,0 +1,61 @@ +assertSameSets( $expected, wp_parse_slug_list( $input_list ) ); + } + + /** + * data for test_wp_parse_slug_list + * + * @ticket 60217 + * + * @return array[] + */ + public function data_wp_parse_slug_list() { + return array( + 'simple' => array( + 'input_list' => array( '1', 2, 'string with spaces' ), + 'expected' => array( '1', '2', 'string-with-spaces' ), + ), + 'simple_with_comma' => array( + 'input_list' => '1,2,string with spaces', + 'expected' => array( '1', '2', 'string', 'with', 'spaces' ), + ), + 'array_with_spaces' => array( + 'input_list' => array( '1 2 string with spaces' ), + 'expected' => array( '1-2-string-with-spaces' ), + ), + 'simple_with_spaces' => array( + 'input_list' => '1 2 string with spaces', + 'expected' => array( '1', '2', 'string', 'with', 'spaces' ), + ), + 'array_html' => array( + 'input_list' => array( '1', 2, 'string with