Make WordPress Core

Ticket #36790: 36790.skip-tests.patch

File 36790.skip-tests.patch, 1.0 KB (added by ocean90, 7 years ago)
  • tests/phpunit/tests/functions/maybeDeclineDate.php

     
    3434                parent::tearDown();
    3535        }
    3636
     37        private function is_preg_match_unicode_aware() {
     38                static $is_preg_match_unicode_aware = null;
     39
     40                if ( ! isset( $is_preg_match_unicode_aware ) ) {
     41                        $is_preg_match_unicode_aware = (bool) preg_match( '#^\d{1,2}\.? \w+#u', '21 Июнь' );
     42                }
     43
     44                return $is_preg_match_unicode_aware;
     45        }
     46
    3747        /**
    3848         * @ticket 36790
    3949         * @dataProvider data_wp_maybe_decline_date
    4050         */
    4151        public function test_wp_maybe_decline_date( $test_locale, $input, $output ) {
     52                if ( ! $this->is_preg_match_unicode_aware() ) {
     53                        $this->markTestSkipped( 'preg_match() is not unicode aware.' );
     54                }
     55
    4256                global $locale, $wp_locale;
    4357
    4458                add_filter( 'gettext_with_context', array( $this, 'filter__enable_months_names_declension' ), 10, 3 );