Tests: Move `wp_maybe_decline_date()` tests to the `date` directory.

See #48934.

git-svn-id: https://develop.svn.wordpress.org/trunk@47076 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
SergeyBiryukov 2020-01-17 00:54:02 +00:00
parent 900b3fd6a8
commit abfca60342
1 changed files with 16 additions and 15 deletions

View File

@ -41,7 +41,7 @@ class Tests_Functions_MaybeDeclineDate extends WP_UnitTestCase {
* @ticket 48606
* @dataProvider data_wp_maybe_decline_date
*/
public function test_wp_maybe_decline_date( $test_locale, $input, $output ) {
public function test_wp_maybe_decline_date( $test_locale, $format, $input, $output ) {
global $locale, $wp_locale;
add_filter( 'gettext_with_context', array( $this, 'filter__enable_months_names_declension' ), 10, 3 );
@ -52,7 +52,7 @@ class Tests_Functions_MaybeDeclineDate extends WP_UnitTestCase {
$wp_locale->month = $month_names['month'];
$wp_locale->month_genitive = $month_names['month_genitive'];
$declined_date = wp_maybe_decline_date( $input );
$declined_date = wp_maybe_decline_date( $input, $format );
remove_filter( 'gettext_with_context', array( $this, 'filter__enable_months_names_declension' ), 10 );
@ -69,19 +69,20 @@ class Tests_Functions_MaybeDeclineDate extends WP_UnitTestCase {
public function data_wp_maybe_decline_date() {
return array(
array( 'ru_RU', '21 Июнь', '21 июня' ),
array( 'ru_RU', '1 Январь 2016', '1 января 2016' ),
array( 'ru_RU', 'Январь 1st 2016', '1 января 2016' ),
array( 'ru_RU', 'Январь 1 2016', '1 января 2016' ),
array( 'ru_RU', 'Январь 1 16', '1 января 16' ),
array( 'ru_RU', 'Суббота, 19 Январь 2019 10:50', 'Суббота, 19 января 2019 10:50' ),
array( 'pl_PL', '1 Styczeń', '1 stycznia' ),
array( 'hr', '1. Siječanj', '1. siječnja' ),
array( 'ca', '1 de abril', "1 d'abril" ),
array( 'cs_CZ', '1. Červen', '1. června' ),
array( 'cs_CZ', '1. Červenec', '1. července' ),
array( 'it_IT', 'Lundeì 11 Novembre 2019', 'Lundeì 11 Novembre 2019' ),
array( 'el', 'Σάββατο, 19 Ιανουάριος 2019 10:50', 'Σάββατο, 19 Ιανουαρίου 2019 10:50' ),
array( 'ru_RU', 'j F', '21 Июнь', '21 июня' ),
array( 'ru_RU', 'j F Y', '1 Январь 2016', '1 января 2016' ),
array( 'ru_RU', 'F jS Y', 'Январь 1st 2016', '1 января 2016' ),
array( 'ru_RU', 'F j Y', 'Январь 1 2016', '1 января 2016' ),
array( 'ru_RU', 'F j y', 'Январь 1 16', '1 января 16' ),
array( 'ru_RU', 'F y', 'Январь 16', 'Январь 16' ),
array( 'ru_RU', 'l, d F Y H:i', 'Суббота, 19 Январь 2019 10:50', 'Суббота, 19 января 2019 10:50' ),
array( 'pl_PL', 'j F', '1 Styczeń', '1 stycznia' ),
array( 'hr', 'j. F', '1. Siječanj', '1. siječnja' ),
array( 'ca', 'j F', '1 de abril', "1 d'abril" ),
array( 'cs_CZ', 'j. F', '1. Červen', '1. června' ),
array( 'cs_CZ', 'j. F', '1. Červenec', '1. července' ),
array( 'it_IT', 'l j F Y', 'Lundeì 11 Novembre 2019', 'Lundeì 11 Novembre 2019' ),
array( 'el', 'l, d F Y H:i', 'Σάββατο, 19 Ιανουάριος 2019 10:50', 'Σάββατο, 19 Ιανουαρίου 2019 10:50' ),
);
}