wordpress-develop/tests/phpunit/tests/functions/wpToKebabCase.php
Sergey Biryukov 7a96aefac6 Docs: Use third-person singular verbs in some test descriptions in phpunit/tests/functions/.
Follow-up to [42971], [45371], [46159], [46175], [47779], [50962], [50964], [51910], [52778].

Props azouamauriac, SergeyBiryukov.
See #54725.

git-svn-id: https://develop.svn.wordpress.org/trunk@52780 602fd350-edb4-49c9-b593-d223f7449a82
2022-02-21 14:50:07 +00:00

65 lines
1.8 KiB
PHP

<?php
/**
* Tests for the _wp_to_kebab_case() function
*
* @since 5.8.0
*
* @group functions.php
* @covers ::_wp_to_kebab_case
*/
class Tests_Functions_wpToKebabCase extends WP_UnitTestCase {
/**
* Tests _wp_to_kebab_case().
*
* @dataProvider data_wp_to_kebab_case
*
* @ticket 53397
*
* @param string $test_value Test value.
* @param string $expected Expected return value.
*/
public function test_wp_to_kebab_case( $test_value, $expected ) {
$this->assertSame( $expected, _wp_to_kebab_case( $test_value ) );
}
/**
* Data provider for test_wp_to_kebab_case().
*
* @return array[] Test parameters {
* @type string $test_value Test value.
* @type string $expected Expected return value.
* }
*/
public function data_wp_to_kebab_case() {
return array(
array( 'white', 'white' ),
array( 'white+black', 'white-black' ),
array( 'white:black', 'white-black' ),
array( 'white*black', 'white-black' ),
array( 'white.black', 'white-black' ),
array( 'white black', 'white-black' ),
array( 'white black', 'white-black' ),
array( 'white-to-black', 'white-to-black' ),
array( 'white2white', 'white-2-white' ),
array( 'white2nd', 'white-2nd' ),
array( 'white2ndcolor', 'white-2-ndcolor' ),
array( 'white2ndColor', 'white-2nd-color' ),
array( 'white2nd_color', 'white-2nd-color' ),
array( 'white23color', 'white-23-color' ),
array( 'white23', 'white-23' ),
array( '23color', '23-color' ),
array( 'white4th', 'white-4th' ),
array( 'font2xl', 'font-2-xl' ),
array( 'whiteToWhite', 'white-to-white' ),
array( 'whiteTOwhite', 'white-t-owhite' ),
array( 'WHITEtoWHITE', 'whit-eto-white' ),
array( 42, '42' ),
array( "i've done", 'ive-done' ),
array( '#ffffff', 'ffffff' ),
array( '$ffffff', 'ffffff' ),
);
}
}