From abfca603429a03898d46ec9cabcf04b41cf19fd0 Mon Sep 17 00:00:00 2001 From: SergeyBiryukov Date: Fri, 17 Jan 2020 00:54:02 +0000 Subject: [PATCH] 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 --- .../{functions => date}/maybeDeclineDate.php | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) rename tests/phpunit/tests/{functions => date}/maybeDeclineDate.php (80%) diff --git a/tests/phpunit/tests/functions/maybeDeclineDate.php b/tests/phpunit/tests/date/maybeDeclineDate.php similarity index 80% rename from tests/phpunit/tests/functions/maybeDeclineDate.php rename to tests/phpunit/tests/date/maybeDeclineDate.php index 04b5612223..9c0322203e 100644 --- a/tests/phpunit/tests/functions/maybeDeclineDate.php +++ b/tests/phpunit/tests/date/maybeDeclineDate.php @@ -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' ), ); }