Make WordPress Core


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

Build/Test Tools: Add @covers tags to the options tests.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/option/siteOption.php

    r52010 r53865  
    99        }
    1010
     11        /**
     12         * @covers ::get_site_option
     13         */
    1114        public function test_get_site_option_returns_false_if_option_does_not_exist() {
    1215                $this->assertFalse( get_site_option( 'doesnotexist' ) );
    1316        }
    1417
     18        /**
     19         * @covers ::add_site_option
     20         * @covers ::delete_site_option
     21         * @covers ::get_site_option
     22         */
    1523        public function test_get_site_option_returns_false_after_deletion() {
    1624                $key   = __FUNCTION__;
     
    2129        }
    2230
     31        /**
     32         * @covers ::add_site_option
     33         * @covers ::get_site_option
     34         */
    2335        public function test_get_site_option_returns_value() {
    2436                $key   = __FUNCTION__;
     
    2840        }
    2941
     42        /**
     43         * @covers ::add_site_option
     44         * @covers ::update_site_option
     45         * @covers ::get_site_option
     46         */
    3047        public function test_get_site_option_returns_updated_value() {
    3148                $key       = __FUNCTION__;
     
    3754        }
    3855
     56        /**
     57         * @covers ::add_filter
     58         * @covers ::get_site_option
     59         * @covers ::remove_filter
     60         */
    3961        public function test_get_site_option_does_not_exist_returns_filtered_default_with_no_default_provided() {
    4062                add_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
     
    4466        }
    4567
     68        /**
     69         * @covers ::add_filter
     70         * @covers ::get_site_option
     71         * @covers ::remove_filter
     72         */
    4673        public function test_get_site_option_does_not_exist_returns_filtered_default_with_default_provided() {
    4774                add_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
     
    5178        }
    5279
     80        /**
     81         * @covers ::get_site_option
     82         */
    5383        public function test_get_site_option_does_not_exist_returns_provided_default() {
    5484                $this->assertSame( 'bar', get_site_option( 'doesnotexist', 'bar' ) );
    5585        }
    5686
     87        /**
     88         * @covers ::add_site_option
     89         * @covers ::get_site_option
     90         */
    5791        public function test_get_site_option_exists_does_not_return_provided_default() {
    5892                $key   = __FUNCTION__;
     
    6296        }
    6397
     98        /**
     99         * @covers ::add_site_option
     100         * @covers ::add_filter
     101         * @covers ::get_site_option
     102         * @covers ::remove_filter
     103         */
    64104        public function test_get_site_option_exists_does_not_return_filtered_default() {
    65105                $key   = __FUNCTION__;
     
    72112        }
    73113
     114        /**
     115         * @covers ::add_site_option
     116         */
    74117        public function test_add_site_option_returns_true_for_new_option() {
    75118                $key   = __FUNCTION__;
     
    78121        }
    79122
     123        /**
     124         * @covers ::add_site_option
     125         */
    80126        public function test_add_site_option_returns_false_for_existing_option() {
    81127                $key   = __FUNCTION__;
     
    85131        }
    86132
     133        /**
     134         * @covers ::add_site_option
     135         * @covers ::update_site_option
     136         */
    87137        public function test_update_site_option_returns_false_for_same_value() {
    88138                $key   = __FUNCTION__;
     
    92142        }
    93143
     144        /**
     145         * @covers ::add_site_option
     146         * @covers ::update_site_option
     147         */
    94148        public function test_update_site_option_returns_true_for_new_value() {
    95149                $key       = 'key';
     
    100154        }
    101155
     156        /**
     157         * @covers ::add_site_option
     158         * @covers ::delete_site_option
     159         */
    102160        public function test_delete_site_option_returns_true_if_option_exists() {
    103161                $key   = __FUNCTION__;
     
    107165        }
    108166
     167        /**
     168         * @covers ::add_site_option
     169         * @covers ::delete_site_option
     170         */
    109171        public function test_delete_site_option_returns_false_if_option_does_not_exist() {
    110172                $key   = __FUNCTION__;
     
    115177        }
    116178
     179        /**
     180         * @covers ::add_site_option
     181         * @covers ::get_site_option
     182         */
    117183        public function test_site_option_add_and_get_serialized_array() {
    118184                $key   = __FUNCTION__;
     
    125191        }
    126192
     193        /**
     194         * @covers ::add_site_option
     195         * @covers ::get_site_option
     196         */
    127197        public function test_site_option_add_and_get_serialized_object() {
    128198                $key        = __FUNCTION__;
     
    138208         *
    139209         * @ticket 15497
     210         *
     211         * @covers ::update_site_option
     212         * @covers ::get_site_option
    140213         */
    141214        public function test_update_adds_falsey_value() {
     
    153226         *
    154227         * @ticket 18955
     228         *
     229         * @covers ::get_site_option
    155230         */
    156231        public function test_get_doesnt_cache_default_value() {
Note: See TracChangeset for help on using the changeset viewer.