Make WordPress Core


Ignore:
Timestamp:
08/08/2022 11:39:06 PM (4 years ago)
Author:
azaozz
Message:

Build/Test Tools: Add @covers tags to the l10n and i18n tests.

Props pbearne, jrf, hellofromTonya, patopaiar, ironprogrammer, antonvlasenko, SergeyBiryukov, costdev.
See #39265.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/l10n/wpLocaleSwitcher.php

    r52248 r53866  
    3636        }
    3737
     38        /**
     39         * @covers ::switch_to_locale
     40         */
    3841        public function test_switch_to_non_existent_locale_returns_false() {
    3942                $this->assertFalse( switch_to_locale( 'foo_BAR' ) );
    4043        }
    4144
     45        /**
     46         * @covers ::switch_to_locale
     47         */
    4248        public function test_switch_to_non_existent_locale_does_not_change_locale() {
    4349                switch_to_locale( 'foo_BAR' );
    … …  
    4652        }
    4753
     54        /**
     55         * @covers ::switch_to_locale
     56         */
    4857        public function test_switch_to_locale_returns_true() {
    4958                $expected = switch_to_locale( 'en_GB' );
    … …  
    5564        }
    5665
     66        /**
     67         * @covers ::switch_to_locale
     68         */
    5769        public function test_switch_to_locale_changes_the_locale() {
    5870                switch_to_locale( 'en_GB' );
    … …  
    6678        }
    6779
     80        /**
     81         * @covers ::switch_to_locale
     82         * @covers ::translate
     83         * @covers ::__
     84         */
    6885        public function test_switch_to_locale_loads_translation() {
    6986                switch_to_locale( 'es_ES' );
    … …  
    7794        }
    7895
     96        /**
     97         * @covers ::switch_to_locale
     98         */
    7999        public function test_switch_to_locale_changes_wp_locale_global() {
    80100                global $wp_locale;
    … …  
    95115        }
    96116
     117        /**
     118         * @covers ::switch_to_locale
     119         */
    97120        public function test_switch_to_locale_en_US() {
    98121                switch_to_locale( 'en_GB' );
    … …  
    108131        }
    109132
     133        /**
     134         * @covers ::switch_to_locale
     135         */
    110136        public function test_switch_to_locale_multiple_times() {
    111137                switch_to_locale( 'en_GB' );
    … …  
    120146        }
    121147
     148        /**
     149         * @covers ::switch_to_locale
     150         * @covers ::__
     151         * @covers ::translate
     152         */
    122153        public function test_switch_to_locale_multiple_times_loads_translation() {
    123154                switch_to_locale( 'en_GB' );
    … …  
    135166        }
    136167
     168        /**
     169         * @covers ::restore_previous_locale
     170         */
    137171        public function test_restore_previous_locale_without_switching() {
    138172                $this->assertFalse( restore_previous_locale() );
    139173        }
    140174
     175        /**
     176         * @covers ::restore_previous_locale
     177         */
    141178        public function test_restore_previous_locale_changes_the_locale_back() {
    142179                switch_to_locale( 'en_GB' );
    … …  
    148185        }
    149186
     187        /**
     188         * @covers ::restore_previous_locale
     189         */
    150190        public function test_restore_previous_locale_after_switching_multiple_times() {
    151191                switch_to_locale( 'en_GB' );
    … …  
    161201        }
    162202
     203        /**
     204         * @covers ::restore_previous_locale
     205         * @covers ::__
     206         * @covers ::translate
     207         */
    163208        public function test_restore_previous_locale_restores_translation() {
    164209                switch_to_locale( 'es_ES' );
    … …  
    170215        }
    171216
     217        /**
     218         * @covers ::restore_previous_locale
     219         */
    172220        public function test_restore_previous_locale_action_passes_previous_locale() {
    173221                switch_to_locale( 'en_GB' );
    … …  
    186234        }
    187235
     236        /**
     237         * @covers ::restore_previous_locale
     238         */
    188239        public function test_restore_previous_locale_restores_wp_locale_global() {
    189240                global $wp_locale;
    … …  
    200251        }
    201252
     253        /**
     254         * @covers ::restore_current_locale
     255         */
    202256        public function test_restore_current_locale_without_switching() {
    203257                $this->assertFalse( restore_current_locale() );
    204258        }
    205259
     260        /**
     261         * @covers ::restore_previous_locale
     262         */
    206263        public function test_restore_current_locale_after_switching_multiple_times() {
    207264                switch_to_locale( 'en_GB' );
    … …  
    219276        }
    220277
     278        /**
     279         * @covers ::is_locale_switched
     280         */
    221281        public function test_is_locale_switched_if_not_switched() {
    222282                $this->assertFalse( is_locale_switched() );
    223283        }
    224284
     285        /**
     286         * @covers ::is_locale_switched
     287         */
    225288        public function test_is_locale_switched_original_locale() {
    226289                $original_locale = get_locale();
    … …  
    236299        }
    237300
     301        /**
     302         * @covers ::is_locale_switched
     303         */
    238304        public function test_is_locale_switched() {
    239305                switch_to_locale( 'en_GB' );
    … …  
    247313        }
    248314
     315        /**
     316         * @covers ::switch_to_locale
     317         */
    249318        public function test_switch_to_site_locale_if_user_locale_is_set() {
    250319                global $l10n, $wp_locale_switcher;
    … …  
    293362        }
    294363
     364        /**
     365         * @covers ::switch_to_locale
     366         */
    295367        public function test_switch_to_different_site_locale_if_user_locale_is_set() {
    296368                global $l10n, $wp_locale_switcher;
    … …  
    344416        }
    345417
     418        /**
     419         * @covers ::switch_to_locale
     420         * @covers ::load_default_textdomain
     421         */
    346422        public function test_multiple_switches_to_site_locale_and_user_locale() {
    347423                global $wp_locale_switcher;
Note: See TracChangeset for help on using the changeset viewer.