Make WordPress Core

Ticket #39265: o_folders.patch

File o_folders.patch, 63.0 KB (added by patopaiar, 4 years ago)

Adds @covers to folders starting with o: oembed, option

  • oembed/controller.php

     
    173173                $this->oembed_result_filter_count++;
    174174                return $data;
    175175        }
    176 
     176       
     177        /**
     178         * @covers ::wp_oembed_ensure_format
     179         */
    177180        function test_wp_oembed_ensure_format() {
    178181                $this->assertSame( 'json', wp_oembed_ensure_format( 'json' ) );
    179182                $this->assertSame( 'xml', wp_oembed_ensure_format( 'xml' ) );
     
    181184                $this->assertSame( 'json', wp_oembed_ensure_format( 'random' ) );
    182185                $this->assertSame( 'json', wp_oembed_ensure_format( array() ) );
    183186        }
    184 
     187       
     188        /**
     189         * @covers ::_oembed_create_xml
     190         */
    185191        function test_oembed_create_xml() {
    186192                $actual = _oembed_create_xml(
    187193                        array(
     
    238244
    239245                $this->assertStringEndsWith( $expected, trim( $actual ) );
    240246        }
    241 
     247       
     248        /**
     249         * @covers WP_REST_Server::get_routes
     250         */
    242251        public function test_route_availability() {
    243252                // Check the route was registered correctly.
    244253                $filtered_routes = rest_get_server()->get_routes();
     
    258267                $this->assertArrayHasKey( 'methods', $proxy_route[0] );
    259268                $this->assertArrayHasKey( 'args', $proxy_route[0] );
    260269        }
    261 
     270       
     271        /**
     272         * @covers WP_REST_Server::dispatch
     273         * @covers WP_HTTP_Requests_Response::get_data
     274         */
    262275        function test_request_with_wrong_method() {
    263276                $request = new WP_REST_Request( 'POST', '/oembed/1.0/embed' );
    264277
     
    267280
    268281                $this->assertSame( 'rest_no_route', $data['code'] );
    269282        }
    270 
     283       
     284        /**
     285         * @covers WP_REST_Server::dispatch
     286         * @covers WP_HTTP_Requests_Response::get_data
     287         */
    271288        function test_request_without_url_param() {
    272289                $request = new WP_REST_Request( 'GET', '/oembed/1.0/embed' );
    273290
     
    277294                $this->assertSame( 'rest_missing_callback_param', $data['code'] );
    278295                $this->assertSame( 'url', $data['data']['params'][0] );
    279296        }
    280 
     297       
     298        /**
     299         * @covers WP_REST_Server::dispatch
     300         * @covers WP_HTTP_Requests_Response::get_data
     301         */
    281302        function test_request_with_bad_url() {
    282303                $request = new WP_REST_Request( 'GET', '/oembed/1.0/embed' );
    283304                $request->set_param( 'url', 'http://google.com/' );
     
    287308
    288309                $this->assertSame( 'oembed_invalid_url', $data['code'] );
    289310        }
    290 
     311       
     312        /**
     313         * @covers WP_REST_Server::dispatch
     314         * @covers WP_HTTP_Requests_Response::get_data
     315         */
    291316        function test_request_invalid_format() {
    292317                $post_id = $this->factory()->post->create();
    293318
     
    301326                $this->assertInternalType( 'array', $data );
    302327                $this->assertNotEmpty( $data );
    303328        }
    304 
     329       
     330        /**
     331         * @covers WP_REST_Server::dispatch
     332         * @covers WP_HTTP_Requests_Response::get_data
     333         */
    305334        function test_request_json() {
    306335                $user = self::factory()->user->create_and_get(
    307336                        array(
     
    346375
    347376        /**
    348377         * @ticket 34971
     378         * @covers WP_REST_Server::dispatch
     379         * @covers WP_HTTP_Requests_Response::get_data
    349380         */
    350381        function test_request_static_front_page() {
    351382                $post = self::factory()->post->create_and_get(
     
    388419
    389420                update_option( 'show_on_front', 'posts' );
    390421        }
    391 
     422       
     423        /**
     424         * @covers WP_REST_Server::dispatch
     425         * @covers WP_HTTP_Requests_Response::get_data
     426         */
    392427        function test_request_xml() {
    393428                $user = self::factory()->user->create_and_get(
    394429                        array(
     
    435470        /**
    436471         * @group multisite
    437472         * @group ms-required
     473         *
     474         * @covers WP_REST_Server::dispatch
     475         * @covers WP_HTTP_Requests_Response::get_data
    438476         */
    439477        function test_request_ms_child_in_root_blog() {
    440478                $child = self::factory()->blog->create();
     
    458496
    459497                restore_current_blog();
    460498        }
    461 
     499       
     500        /**
     501         * @covers ::_oembed_rest_pre_serve_request
     502         */
    462503        function test_rest_pre_serve_request() {
    463504                $user = $this->factory()->user->create_and_get(
    464505                        array(
     
    482523                $xml = simplexml_load_string( $output );
    483524                $this->assertInstanceOf( 'SimpleXMLElement', $xml );
    484525        }
    485 
     526       
     527        /**
     528         * @covers ::_oembed_rest_pre_serve_request
     529         */
    486530        function test_rest_pre_serve_request_wrong_format() {
    487531                $post = $this->factory()->post->create_and_get();
    488532
     
    494538
    495539                $this->assertTrue( _oembed_rest_pre_serve_request( true, $response, $request, rest_get_server() ) );
    496540        }
    497 
     541       
     542        /**
     543         * @covers ::_oembed_rest_pre_serve_request
     544         */
    498545        function test_rest_pre_serve_request_wrong_method() {
    499546                $post = $this->factory()->post->create_and_get();
    500547
     
    506553
    507554                $this->assertTrue( _oembed_rest_pre_serve_request( true, $response, $request, rest_get_server() ) );
    508555        }
    509 
     556       
     557        /**
     558         * @covers ::get_oembed_endpoint_url
     559         */
    510560        function test_get_oembed_endpoint_url() {
    511561                $this->assertSame( home_url() . '/index.php?rest_route=/oembed/1.0/embed', get_oembed_endpoint_url() );
    512562                $this->assertSame( home_url() . '/index.php?rest_route=/oembed/1.0/embed', get_oembed_endpoint_url( '', 'json' ) );
     
    519569                $this->assertSame( home_url() . '/index.php?rest_route=%2Foembed%2F1.0%2Fembed&url=' . $url_encoded, get_oembed_endpoint_url( $url ) );
    520570                $this->assertSame( home_url() . '/index.php?rest_route=%2Foembed%2F1.0%2Fembed&url=' . $url_encoded . '&format=xml', get_oembed_endpoint_url( $url, 'xml' ) );
    521571        }
    522 
     572       
     573        /**
     574         * @covers ::get_oembed_endpoint_url
     575         */
    523576        function test_get_oembed_endpoint_url_pretty_permalinks() {
    524577                update_option( 'permalink_structure', '/%postname%' );
    525578
     
    535588
    536589                update_option( 'permalink_structure', '' );
    537590        }
    538 
     591       
     592        /**
     593         * @covers WP_REST_Server::dispatch
     594         * @covers WP_HTTP_Requests_Response::get_data
     595         */
    539596        public function test_proxy_without_permission() {
    540597                // Test without a login.
    541598                $request  = new WP_REST_Request( 'GET', '/oembed/1.0/proxy' );
     
    553610                $data = $response->get_data();
    554611                $this->assertSame( $data['code'], 'rest_forbidden' );
    555612        }
    556 
     613       
     614        /**
     615         * @covers WP_REST_Server::dispatch
     616         * @covers WP_HTTP_Requests_Response::get_data
     617         */
    557618        public function test_proxy_with_invalid_oembed_provider() {
    558619                wp_set_current_user( self::$editor );
    559620                $request = new WP_REST_Request( 'GET', '/oembed/1.0/proxy' );
     
    563624                $data = $response->get_data();
    564625                $this->assertSame( 'oembed_invalid_url', $data['code'] );
    565626        }
    566 
     627       
     628        /**
     629         * @covers WP_REST_Server::dispatch
     630         * @covers WP_HTTP_Requests_Response::get_status
     631         */
    567632        public function test_proxy_with_invalid_type() {
    568633                wp_set_current_user( self::$editor );
    569634                $request = new WP_REST_Request( 'GET', '/oembed/1.0/proxy' );
     
    572637
    573638                $this->assertSame( 400, $response->get_status() );
    574639        }
    575 
     640       
     641        /**
     642         * @covers WP_REST_Server::dispatch
     643         * @covers WP_HTTP_Requests_Response::get_status
     644         * @covers WP_HTTP_Requests_Response::get_data
     645         */
    576646        public function test_proxy_with_valid_oembed_provider() {
    577647                wp_set_current_user( self::$editor );
    578648                $request = new WP_REST_Request( 'GET', '/oembed/1.0/proxy' );
     
    613683         * @ticket 45447
    614684         *
    615685         * @see wp_maybe_load_embeds()
     686         *
     687         * @covers WP_REST_Server::dispatch
     688         * @covers WP_HTTP_Requests_Response::get_status
     689         * @covers WP_HTTP_Requests_Response::get_data
    616690         */
    617691        public function test_proxy_with_classic_embed_provider() {
    618692                wp_set_current_user( self::$editor );
     
    633707                $this->assertInternalType( 'string', $data->html );
    634708                $this->assertInternalType( 'array', $data->scripts );
    635709        }
    636 
     710       
     711        /**
     712         * @covers WP_REST_Server::dispatch
     713         * @covers WP_HTTP_Requests_Response::get_status
     714         */
    637715        public function test_proxy_with_invalid_oembed_provider_no_discovery() {
    638716                wp_set_current_user( self::$editor );
    639717
     
    645723                $this->assertSame( 404, $response->get_status() );
    646724                $this->assertSame( 0, $this->request_count );
    647725        }
    648 
     726       
     727        /**
     728         * @covers WP_REST_Server::dispatch
     729         * @covers WP_HTTP_Requests_Response::get_status
     730         */
    649731        public function test_proxy_with_invalid_oembed_provider_with_default_discover_param() {
    650732                wp_set_current_user( self::$editor );
    651733
     
    656738                $this->assertSame( 404, $response->get_status() );
    657739                $this->assertSame( 1, $this->request_count );
    658740        }
    659 
     741       
     742        /**
     743         * @covers WP_REST_Server::dispatch
     744         * @covers WP_HTTP_Requests_Response::get_status
     745         * @covers WP_HTTP_Requests_Response::get_data
     746         */
    660747        public function test_proxy_with_invalid_discover_param() {
    661748                wp_set_current_user( self::$editor );
    662749                $request = new WP_REST_Request( 'GET', '/oembed/1.0/proxy' );
     
    672759
    673760        /**
    674761         * @ticket 45142
     762         *
     763         * @covers WP_REST_Server::dispatch
     764         * @covers WP_HTTP_Requests_Response::get_data
    675765         */
    676766        function test_proxy_with_internal_url() {
    677767                wp_set_current_user( self::$editor );
     
    720810
    721811        /**
    722812         * @ticket 45142
     813         *
     814         * @covers WP_REST_Server::dispatch
     815         * @covers WP_HTTP_Requests_Response::get_data
    723816         */
    724817        function test_proxy_with_static_front_page_url() {
    725818                wp_set_current_user( self::$editor );
     
    771864
    772865        /**
    773866         * @ticket 45142
     867         *
     868         * @covers WP_REST_Server::dispatch
     869         * @covers WP_HTTP_Requests_Response::get_data
    774870         */
    775871        public function test_proxy_filters_result_of_untrusted_oembed_provider() {
    776872                wp_set_current_user( self::$editor );
     
    794890
    795891        /**
    796892         * @ticket 45142
     893         *
     894         * @covers WP_REST_Server::dispatch
     895         * @covers WP_HTTP_Requests_Response::get_data
    797896         */
    798897        public function test_proxy_does_not_filter_result_of_trusted_oembed_provider() {
    799898                wp_set_current_user( self::$editor );
  • oembed/discovery.php

     
    44 * @group oembed
    55 */
    66class Tests_oEmbed_Discovery extends WP_UnitTestCase {
     7       
     8        /**
     9         * @ticket 34971
     10         * @covers ::wp_oembed_add_discovery_links
     11         */
    712        function test_add_oembed_discovery_links_non_singular() {
    813                $this->assertSame( '', get_echo( 'wp_oembed_add_discovery_links' ) );
    914        }
    10 
     15       
     16        /**
     17         * @covers ::wp_oembed_add_discovery_links
     18         */
    1119        function test_add_oembed_discovery_links_front_page() {
    1220                $this->go_to( home_url() );
    1321                $this->assertSame( '', get_echo( 'wp_oembed_add_discovery_links' ) );
     
    1624
    1725        /**
    1826         * @ticket 34971
     27         * @covers ::wp_oembed_add_discovery_links
    1928         */
    2029        function test_add_oembed_discovery_links_static_front_page() {
    2130                update_option( 'show_on_front', 'page' );
     
    4049                update_option( 'show_on_front', 'posts' );
    4150        }
    4251
     52        /**
     53         * @covers ::wp_oembed_add_discovery_links
     54         */
    4355        function test_add_oembed_discovery_links_to_post() {
    4456                $post_id = self::factory()->post->create();
    4557                $this->go_to( get_permalink( $post_id ) );
     
    5062
    5163                $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) );
    5264        }
    53 
     65       
     66        /**
     67         * @covers ::wp_oembed_add_discovery_links
     68         */
    5469        function test_add_oembed_discovery_links_to_page() {
    5570                $post_id = self::factory()->post->create(
    5671                        array(
     
    6580
    6681                $this->assertSame( $expected, get_echo( 'wp_oembed_add_discovery_links' ) );
    6782        }
    68 
     83       
     84        /**
     85         * @covers ::wp_oembed_add_discovery_links
     86         */
    6987        function test_add_oembed_discovery_links_to_attachment() {
    7088                $post_id       = self::factory()->post->create();
    7189                $file          = DIR_TESTDATA . '/images/canola.jpg';
  • oembed/filterResult.php

     
    44 * @group oembed
    55 */
    66class Tests_Filter_oEmbed_Result extends WP_UnitTestCase {
     7       
     8        /**
     9         * @covers ::wp_filter_oembed_result
     10         */
    711        function test_filter_oembed_result_trusted_malicious_iframe() {
    812                $html = '<p></p><iframe onload="alert(1)"></iframe>';
    913
     
    1115
    1216                $this->assertSame( $html, $actual );
    1317        }
    14 
     18       
     19        /**
     20         * @covers ::wp_filter_oembed_result
     21         */
    1522        function test_filter_oembed_result_with_untrusted_provider() {
    1623                $html   = '<p></p><iframe onload="alert(1)" src="http://example.com/sample-page/"></iframe>';
    1724                $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), 'http://example.com/sample-page/' );
     
    2330                $this->assertTrue( isset( $matches[2] ) );
    2431                $this->assertSame( $matches[1], $matches[2] );
    2532        }
    26 
     33       
     34        /**
     35         * @covers ::wp_filter_oembed_result
     36         */
    2737        function test_filter_oembed_result_only_one_iframe_is_allowed() {
    2838                $html   = '<div><iframe></iframe><iframe></iframe><p></p></div>';
    2939                $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
     
    4353
    4454                $this->assertSame( '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"></iframe>', $actual );
    4555        }
    46 
     56       
     57        /**
     58         * @covers ::wp_filter_oembed_result
     59         */
    4760        function test_filter_oembed_result_without_iframe() {
    4861                $html   = '<span>Hello</span><p>World</p>';
    4962                $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
     
    5568
    5669                $this->assertFalse( $actual );
    5770        }
    58 
     71       
     72        /**
     73         * @covers ::wp_filter_oembed_result
     74         */
    5975        function test_filter_oembed_result_secret_param_available() {
    6076                $html   = '<iframe src="https://wordpress.org"></iframe>';
    6177                $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
     
    6783                $this->assertTrue( isset( $matches[2] ) );
    6884                $this->assertSame( $matches[1], $matches[2] );
    6985        }
    70 
     86       
     87        /**
     88         * @covers ::wp_filter_oembed_result
     89         */
    7190        function test_filter_oembed_result_wrong_type_provided() {
    7291                $actual = wp_filter_oembed_result( 'some string', (object) array( 'type' => 'link' ), '' );
    7392
    7493                $this->assertSame( 'some string', $actual );
    7594        }
    76 
     95       
     96        /**
     97         * @covers ::wp_filter_oembed_result
     98         */
    7799        function test_filter_oembed_result_invalid_result() {
    78100                $this->assertFalse( wp_filter_oembed_result( false, (object) array( 'type' => 'rich' ), '' ) );
    79101                $this->assertFalse( wp_filter_oembed_result( '', (object) array( 'type' => 'rich' ), '' ) );
    80102        }
    81 
     103       
     104        /**
     105         * @covers ::wp_filter_oembed_result
     106         */
    82107        function test_filter_oembed_result_blockquote_adds_style_to_iframe() {
    83108                $html   = '<blockquote></blockquote><iframe></iframe>';
    84109                $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
     
    85110
    86111                $this->assertSame( '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"></iframe>', $actual );
    87112        }
    88 
     113       
     114        /**
     115         * @covers ::wp_filter_oembed_result
     116         */
    89117        function test_filter_oembed_result_allowed_html() {
    90118                $html   = '<blockquote class="foo" id="bar"><strong><a href="" target=""></a></strong></blockquote><iframe></iframe>';
    91119                $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' );
     
    92120
    93121                $this->assertSame( '<blockquote class="wp-embedded-content"><a href=""></a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"></iframe>', $actual );
    94122        }
    95 
     123       
    96124        public function _data_oembed_test_strings() {
    97125                return array(
    98126                        array(
     
    115143        }
    116144
    117145        /**
    118          * @dataProvider _data_oembed_test_strings
     146         * @dataProvider
     147         *
     148         * @covers ::_wp_oembed_get_object
     149         * @covers WP_oEmbed::data2html
    119150         */
    120151        public function test_wp_filter_pre_oembed_custom_result( $html, $expected ) {
    121152                $data   = (object) array(
     
    129160
    130161        /**
    131162         * @group feed
     163         *
     164         * @covers ::_oembed_filter_feed_content
     165         * @covers ::wp_filter_oembed_result
    132166         */
    133167        function test_filter_feed_content() {
    134168                $html   = '<blockquote></blockquote><iframe></iframe>';
  • oembed/filterTitleAttributes.php

     
    6363
    6464        /**
    6565         * @dataProvider data_filter_oembed_iframe_title_attribute
     66         *
     67         * @covers ::wp_filter_oembed_iframe_title_attribute
    6668         */
    6769        public function test_oembed_iframe_title_attribute( $html, $oembed_data, $url, $expected ) {
    6870                $actual = wp_filter_oembed_iframe_title_attribute( $html, (object) $oembed_data, $url );
     
    6971
    7072                $this->assertSame( $expected, $actual );
    7173        }
    72 
     74       
     75        /**
     76         * @covers ::wp_filter_oembed_iframe_title_attribute
     77         */
    7378        public function test_filter_oembed_iframe_title_attribute() {
    7479                add_filter( 'oembed_iframe_title_attribute', array( $this, '_filter_oembed_iframe_title_attribute' ) );
    7580
     
    8691
    8792                $this->assertSame( '<iframe title="Baz" src=""></iframe>', $actual );
    8893        }
    89 
     94       
     95        /**
     96         * @covers ::wp_filter_oembed_iframe_title_attribute
     97         */
    9098        public function test_filter_oembed_iframe_title_attribute_does_not_modify_other_tags() {
    9199                add_filter( 'oembed_iframe_title_attribute', array( $this, '_filter_oembed_iframe_title_attribute' ) );
    92100
  • oembed/getResponseData.php

     
    44 * @group oembed
    55 */
    66class Tests_oEmbed_Response_Data extends WP_UnitTestCase {
     7       
     8        /**
     9         * @covers ::get_oembed_response_data
     10         */
    711        function test_get_oembed_response_data_non_existent_post() {
    812                $this->assertFalse( get_oembed_response_data( 0, 100 ) );
    913        }
    10 
     14       
     15        /**
     16         * @covers ::get_oembed_response_data
     17         * @covers ::get_post_embed_html
     18         */
    1119        function test_get_oembed_response_data() {
    1220                $post = self::factory()->post->create_and_get(
    1321                        array(
     
    3644
    3745        /**
    3846         * Test get_oembed_response_data with an author.
     47         *
     48         * @covers ::get_oembed_response_data
     49         * @covers ::get_post_embed_html
    3950         */
    4051        function test_get_oembed_response_data_author() {
    4152                $user_id = self::factory()->user->create(
     
    6980                        $data
    7081                );
    7182        }
    72 
     83       
     84        /**
     85         * @covers ::get_oembed_response_data
     86         */
    7387        function test_get_oembed_response_link() {
    7488                remove_filter( 'oembed_response_data', 'get_oembed_response_data_rich' );
    7589
     
    96110
    97111                add_filter( 'oembed_response_data', 'get_oembed_response_data_rich', 10, 4 );
    98112        }
    99 
     113       
     114        /**
     115         * @covers ::get_oembed_response_data
     116         */
    100117        function test_get_oembed_response_data_with_draft_post() {
    101118                $post = self::factory()->post->create_and_get(
    102119                        array(
     
    106123
    107124                $this->assertFalse( get_oembed_response_data( $post, 100 ) );
    108125        }
    109 
     126       
     127        /**
     128         * @covers ::get_oembed_response_data
     129         */
    110130        function test_get_oembed_response_data_with_scheduled_post() {
    111131                $post = self::factory()->post->create_and_get(
    112132                        array(
     
    117137
    118138                $this->assertFalse( get_oembed_response_data( $post, 100 ) );
    119139        }
    120 
     140       
     141        /**
     142         * @covers ::get_oembed_response_data
     143         */
    121144        function test_get_oembed_response_data_with_private_post() {
    122145                $post = self::factory()->post->create_and_get(
    123146                        array(
     
    127150
    128151                $this->assertFalse( get_oembed_response_data( $post, 100 ) );
    129152        }
    130 
     153       
     154        /**
     155         * @covers ::get_oembed_response_data
     156         */
    131157        function test_get_oembed_response_data_maxwidth_too_high() {
    132158                $post = self::factory()->post->create_and_get();
    133159
     
    136162                $this->assertSame( 600, $data['width'] );
    137163                $this->assertSame( 338, $data['height'] );
    138164        }
    139 
     165       
     166        /**
     167         * @covers ::get_oembed_response_data
     168         */
    140169        function test_get_oembed_response_data_maxwidth_too_low() {
    141170                $post = self::factory()->post->create_and_get();
    142171
     
    145174                $this->assertSame( 200, $data['width'] );
    146175                $this->assertSame( 200, $data['height'] );
    147176        }
    148 
     177       
     178        /**
     179         * @covers ::get_oembed_response_data
     180         */
    149181        function test_get_oembed_response_data_maxwidth_invalid() {
    150182                $post = self::factory()->post->create_and_get();
    151183
     
    159191                $this->assertSame( 200, $data['width'] );
    160192                $this->assertSame( 200, $data['height'] );
    161193        }
    162 
     194       
     195        /**
     196         * @covers ::get_oembed_response_data
     197         */
    163198        function test_get_oembed_response_data_with_thumbnail() {
    164199                $post          = self::factory()->post->create_and_get();
    165200                $file          = DIR_TESTDATA . '/images/canola.jpg';
     
    179214                $this->assertArrayHasKey( 'thumbnail_height', $data );
    180215                $this->assertTrue( 400 >= $data['thumbnail_width'] );
    181216        }
    182 
     217       
     218        /**
     219         * @covers ::get_oembed_response_data
     220         */
    183221        function test_get_oembed_response_data_for_attachment() {
    184222                $parent = self::factory()->post->create();
    185223                $file   = DIR_TESTDATA . '/images/canola.jpg';
  • oembed/headers.php

     
    1111
    1212        /**
    1313         * @requires function xdebug_get_headers
     14         *
     15         * @covers WP_REST_Request
     16         * @covers WP_REST_Server::dispatch
    1417         */
    1518        function test_rest_pre_serve_request_headers() {
    1619                $post = $this->factory()->post->create_and_get(
  • oembed/postEmbedUrl.php

     
    44 * @group oembed
    55 */
    66class Tests_Post_Embed_URL extends WP_UnitTestCase {
     7       
     8        /**
     9         * @covers ::get_post_embed_url
     10         */
    711        function test_non_existent_post() {
    812                $embed_url = get_post_embed_url( 0 );
    913                $this->assertFalse( $embed_url );
    1014        }
    11 
     15       
     16        /**
     17         * @uses ::get_permalink
     18         * @covers ::get_post_embed_url
     19         */
    1220        function test_with_pretty_permalinks() {
    1321                $this->set_permalink_structure( '/%postname%' );
    1422
     
    1826
    1927                $this->assertSame( $permalink . '/embed', $embed_url );
    2028        }
    21 
     29       
     30        /**
     31         * @covers ::get_post_embed_url
     32         */
    2233        function test_with_ugly_permalinks() {
    2334                $post_id   = self::factory()->post->create();
    2435                $permalink = get_permalink( $post_id );
     
    2940
    3041        /**
    3142         * @ticket 34971
     43         *
     44         * @covers ::get_post_embed_url
    3245         */
    3346        function test_static_front_page() {
    3447                $this->set_permalink_structure( '/%postname%/' );
     
    4760
    4861        /**
    4962         * @ticket 34971
     63         *
     64         * @covers ::get_post_embed_url
    5065         */
    5166        function test_static_front_page_with_ugly_permalinks() {
    5267                $post_id = self::factory()->post->create( array( 'post_type' => 'page' ) );
     
    6378
    6479        /**
    6580         * @ticket 34971
     81         *
     82         * @covers ::get_post_embed_url
    6683         */
    6784        function test_page_conflicts_with_embed_slug() {
    6885                $this->set_permalink_structure( '/%postname%/' );
     
    85102
    86103        /**
    87104         * @ticket 34971
     105         *
     106         * @covers ::get_post_embed_url
    88107         */
    89108        function test_static_front_page_conflicts_with_embed_slug() {
    90109                $this->set_permalink_structure( '/%postname%/' );
  • oembed/template.php

     
    44 * @group oembed
    55 */
    66class Tests_Embed_Template extends WP_UnitTestCase {
     7       
     8        /**
     9         * @covers ::get_post_embed_url
     10         */
    711        function test_oembed_output_post() {
    812                $user = self::factory()->user->create_and_get(
    913                        array(
     
    3236                $this->assertFalse( strpos( $actual, 'That embed can&#8217;t be found.' ) );
    3337                $this->assertNotFalse( strpos( $actual, 'Hello World' ) );
    3438        }
    35 
     39       
     40        /**
     41         * @covers ::get_post_embed_url
     42         */
    3643        function test_oembed_output_post_with_thumbnail() {
    3744                $post_id       = self::factory()->post->create(
    3845                        array(
     
    6572                $this->assertNotFalse( strpos( $actual, 'Hello World' ) );
    6673                $this->assertNotFalse( strpos( $actual, 'canola.jpg' ) );
    6774        }
    68 
     75       
     76        /**
     77         * @covers ::get_post_embed_url
     78         */
    6979        function test_oembed_output_404() {
    7080                $this->go_to( home_url( '/?p=123&embed=true' ) );
    7181                $GLOBALS['wp_query']->query_vars['embed'] = true;
     
    109119                $this->assertNotFalse( strpos( $actual, 'Hello World' ) );
    110120                $this->assertNotFalse( strpos( $actual, 'canola.jpg' ) );
    111121        }
    112 
     122       
     123        /**
     124         * @covers ::get_post_embed_url
     125         */
    113126        function test_oembed_output_draft_post() {
    114127                $post_id = self::factory()->post->create(
    115128                        array(
     
    132145                $this->assertTrue( $doc->loadHTML( $actual ) );
    133146                $this->assertNotFalse( strpos( $actual, 'That embed can&#8217;t be found.' ) );
    134147        }
    135 
     148       
     149        /**
     150         * @covers ::get_post_embed_url
     151         */
    136152        function test_oembed_output_scheduled_post() {
    137153                $post_id = self::factory()->post->create(
    138154                        array(
     
    156172                $this->assertTrue( $doc->loadHTML( $actual ) );
    157173                $this->assertNotFalse( strpos( $actual, 'That embed can&#8217;t be found.' ) );
    158174        }
    159 
     175       
     176        /**
     177         * @covers ::get_post_embed_url
     178         */
    160179        function test_oembed_output_private_post() {
    161180                $post_id = self::factory()->post->create(
    162181                        array(
     
    179198                $this->assertTrue( $doc->loadHTML( $actual ) );
    180199                $this->assertNotFalse( strpos( $actual, 'That embed can&#8217;t be found.' ) );
    181200        }
    182 
     201       
     202        /**
     203         * @covers ::get_post_embed_url
     204         */
    183205        function test_oembed_output_private_post_with_permissions() {
    184206                $user_id = self::factory()->user->create( array( 'role' => 'editor' ) );
    185207                wp_set_current_user( $user_id );
     
    207229                $this->assertFalse( strpos( $actual, 'That embed can&#8217;t be found.' ) );
    208230                $this->assertNotFalse( strpos( $actual, 'Hello World' ) );
    209231        }
    210 
     232       
     233        /**
     234         * @covers ::wp_embed_excerpt_more
     235         */
    211236        function test_wp_embed_excerpt_more_no_embed() {
    212237                $GLOBALS['wp_query'] = new WP_Query();
    213238
    214239                $this->assertSame( 'foo bar', wp_embed_excerpt_more( 'foo bar' ) );
    215240        }
    216 
     241       
     242        /**
     243         * @covers ::wp_embed_excerpt_more
     244         * @covers ::get_post_embed_url
     245         */
    217246        function test_wp_embed_excerpt_more() {
    218247                $post_id = self::factory()->post->create(
    219248                        array(
     
    235264
    236265                $this->assertSame( $expected, $actual );
    237266        }
    238 
     267       
     268        /**
     269         * @covers ::is_embed
     270         * @covers ::get_post_embed_url
     271         */
    239272        function test_is_embed_post() {
    240273                $this->assertFalse( is_embed() );
    241274
     
    243276                $this->go_to( get_post_embed_url( $post_id ) );
    244277                $this->assertTrue( is_embed() );
    245278        }
    246 
     279       
     280        /**
     281         * @covers ::is_embed
     282         * @covers ::get_post_embed_url
     283         */
    247284        function test_is_embed_attachment() {
    248285                $post_id       = self::factory()->post->create();
    249286                $file          = DIR_TESTDATA . '/images/canola.jpg';
     
    257294                $this->go_to( get_post_embed_url( $attachment_id ) );
    258295                $this->assertTrue( is_embed() );
    259296        }
    260 
     297       
     298        /**
     299         * @uses ::home_url
     300         * @covers ::is_embed
     301         */
    261302        function test_is_embed_404() {
    262303                $this->go_to( home_url( '/?p=12345&embed=true' ) );
    263304                $this->assertTrue( is_embed() );
    264305        }
    265 
     306       
     307        /**
     308         * @covers ::get_post_embed_html
     309         */
    266310        function test_get_post_embed_html_non_existent_post() {
    267311                $this->assertFalse( get_post_embed_html( 200, 200, 0 ) );
    268312                $this->assertFalse( get_post_embed_html( 200, 200 ) );
    269313        }
    270 
     314       
     315        /**
     316         * @covers ::get_post_embed_url
     317         * @covers ::get_post_embed_html
     318         */
    271319        function test_get_post_embed_html() {
    272320                $post_id = self::factory()->post->create();
    273321                $title   = esc_attr(
     
    282330
    283331                $this->assertStringEndsWith( $expected, get_post_embed_html( 200, 200, $post_id ) );
    284332        }
    285 
     333       
     334        /**
     335         * @covers ::wp_oembed_add_host_js
     336         */
    286337        function test_add_host_js() {
    287338                wp_oembed_add_host_js();
    288339
  • oembed/WpEmbed.php

     
    2121        public function _pre_oembed_result_callback() {
    2222                return '<b>Embedded content</b>';
    2323        }
    24 
     24       
     25        /**
     26         * @covers WP_Embed::maybe_run_ajax_cache
     27         */
    2528        public function test_maybe_run_ajax_cache_should_return_nothing_if_there_is_no_post() {
    2629                $this->expectOutputString( '' );
    2730                $this->wp_embed->maybe_run_ajax_cache();
    2831        }
    29 
     32       
     33        /**
     34         * @covers WP_Embed::maybe_run_ajax_cache
     35         */
    3036        public function test_maybe_run_ajax_cache_should_return_nothing_if_there_is_no_message() {
    3137                $GLOBALS['post'] = $this->factory()->post->create_and_get(
    3238                        array(
     
    3945                $this->wp_embed->maybe_run_ajax_cache();
    4046                unset( $GLOBALS['post'] );
    4147        }
    42 
     48       
     49        /**
     50         * @covers WP_Embed::maybe_run_ajax_cache
     51         */
    4352        public function test_maybe_run_ajax_cache_should_return_javascript() {
    4453                $GLOBALS['post'] = $this->factory()->post->create_and_get(
    4554                        array(
     
    91100
    92101                $this->assertContains( $expected, $actual );
    93102        }
    94 
     103       
    95104        public function test_wp_embed_unregister_handler() {
    96105                $this->assertArrayHasKey( 'youtube_embed_url', $GLOBALS['wp_embed']->handlers[10] );
    97106
     
    104113
    105114                $this->assertArrayNotHasKey( 'youtube_embed_url', $handlers );
    106115        }
    107 
     116       
     117        /**
     118         * @covers WP_Embed::autoembed
     119         */
    108120        public function test_autoembed_should_do_nothing_without_matching_handler() {
    109121                $content = "\nhttp://example.com/embed/foo\n";
    110122
     
    111123                $actual = $this->wp_embed->autoembed( $content );
    112124                $this->assertSame( $content, $actual );
    113125        }
    114 
     126       
     127        /**
     128         * @covers WP_Embed::autoembed
     129         */
    115130        public function test_autoembed_should_return_modified_content() {
    116131                $handle   = __FUNCTION__;
    117132                $regex    = '#https?://example\.com/embed/([^/]+)#i';
     
    126141
    127142                $this->assertSame( "\nEmbedded http://example.com/embed/foo\n", $actual );
    128143        }
    129 
     144       
     145        /**
     146         * @covers WP_Embed::delete_oembed_caches
     147         */
    130148        public function test_delete_oembed_caches() {
    131149                $post_id = $this->factory()->post->create();
    132150
     
    139157                $this->assertSame( array(), get_post_meta( $post_id, '_oembed_foo' ) );
    140158                $this->assertSame( array(), get_post_meta( $post_id, '_oembed_baz' ) );
    141159        }
    142 
     160       
     161        /**
     162         * @covers WP_Embed::cache_oembed
     163         */
    143164        public function test_cache_oembed_invalid_post_type() {
    144165                $post_id = $this->factory()->post->create( array( 'post_type' => 'nav_menu_item' ) );
    145166
     
    146167                $this->wp_embed->cache_oembed( $post_id );
    147168                $this->assertNotSame( $post_id, $this->wp_embed->post_ID );
    148169        }
    149 
     170       
     171        /**
     172         * @covers WP_Embed::cache_oembed
     173         */
    150174        public function test_cache_oembed_empty_content() {
    151175                $post_id = $this->factory()->post->create( array( 'post_content' => '' ) );
    152176
     
    153177                $this->wp_embed->cache_oembed( $post_id );
    154178                $this->assertNotSame( $post_id, $this->wp_embed->post_ID );
    155179        }
    156 
     180       
     181        /**
     182         * @covers WP_Embed::cache_oembed
     183         */
    157184        public function test_cache_oembed_for_post() {
    158185                $url           = 'https://example.com/';
    159186                $expected      = '<b>Embedded content</b>';
     
    171198                $this->assertSame( $expected, get_post_meta( $post_id, $cachekey, true ) );
    172199                $this->assertNotEmpty( get_post_meta( $post_id, $cachekey_time, true ) );
    173200        }
    174 
     201       
     202        /**
     203         * @covers WP_Embed::shortcode
     204         */
    175205        public function test_shortcode_should_get_cached_data_from_post_meta_for_known_post() {
    176206                global $post;
    177207
     
    198228                $this->assertSame( $expected, $actual_2 );
    199229                $this->assertSame( $expected, $cached );
    200230        }
    201 
     231       
     232        /**
     233         * @covers WP_Embed::shortcode
     234         */
    202235        public function test_shortcode_should_get_cached_failure_from_post_meta_for_known_post() {
    203236                global $post;
    204237
     
    233266
    234267        /**
    235268         * @ticket 34115
     269         *
     270         * @covers WP_Embed::shortcode
    236271         */
    237272        public function test_shortcode_should_cache_data_in_custom_post() {
    238273                $url        = 'https://example.com/';
     
    259294
    260295        /**
    261296         * @ticket 34115
     297         *
     298         * @covers WP_Embed::shortcode
     299         * @covers WP_Embed::find_oembed_post_id
    262300         */
    263301        public function test_shortcode_should_cache_failure_in_custom_post() {
    264302                $url        = 'https://example.com/';
     
    287325         * Test that parsing an embed shortcode should cause oembed_cache to be updated.
    288326         *
    289327         * @ticket 42310
     328         *
     329         * @covers WP_Embed::shortcode
     330         * @covers WP_Embed::find_oembed_post_id
    290331         */
    291332        public function test_shortcode_should_update_custom_post() {
    292333                add_filter( 'oembed_ttl', '__return_zero' );
     
    316357                $this->wp_embed->usecache = $previous_usecache;
    317358                remove_filter( 'oembed_ttl', '__return_zero' );
    318359        }
    319 
     360       
     361        /**
     362         * @covers WP_Embed::shortcode
     363         */
    320364        public function test_shortcode_should_get_url_from_src_attribute() {
    321365                $url    = 'http://example.com/embed/foo';
    322366                $actual = $this->wp_embed->shortcode( array( 'src' => $url ) );
     
    323367
    324368                $this->assertSame( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
    325369        }
    326 
     370       
     371        /**
     372         * @covers WP_Embed::shortcode
     373         */
    327374        public function test_shortcode_should_return_empty_string_for_missing_url() {
    328375                $this->assertEmpty( $this->wp_embed->shortcode( array() ) );
    329376        }
    330 
     377       
     378        /**
     379         * @covers WP_Embed::shortcode
     380         */
    331381        public function test_shortcode_should_make_link_for_unknown_url() {
    332382                $url    = 'http://example.com/embed/foo';
    333383                $actual = $this->wp_embed->shortcode( array(), $url );
     
    334384
    335385                $this->assertSame( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
    336386        }
    337 
     387       
     388        /**
     389         * @covers WP_Embed::run_shortcode
     390         */
    338391        public function test_run_shortcode_url_only() {
    339392                $url    = 'http://example.com/embed/foo';
    340393                $actual = $this->wp_embed->run_shortcode( '[embed]' . $url . '[/embed]' );
    341394                $this->assertSame( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
    342395        }
    343 
     396       
     397        /**
     398         * @covers WP_Embed::maybe_make_link
     399         */
    344400        public function test_maybe_make_link() {
    345401                $url    = 'http://example.com/embed/foo';
    346402                $actual = $this->wp_embed->maybe_make_link( $url );
     
    347403
    348404                $this->assertSame( '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>', $actual );
    349405        }
    350 
     406       
     407        /**
     408         * @covers WP_Embed::maybe_make_link
     409         */
    351410        public function test_maybe_make_link_return_false_on_fail() {
    352411                $this->wp_embed->return_false_on_fail = true;
    353412                $this->assertFalse( $this->wp_embed->maybe_make_link( 'http://example.com/' ) );
    354413        }
    355 
     414       
     415        /**
     416         * @covers WP_Embed::maybe_make_link
     417         */
    356418        public function test_maybe_make_link_do_not_link_if_unknown() {
    357419                $url = 'http://example.com/';
    358420
  • oembed/wpOembed.php

     
    2727                // Return false to prevent HTTP requests during tests.
    2828                return $result ? $result : false;
    2929        }
    30 
     30       
     31        /**
     32         * @covers WP_oEmbed::get_html
     33         */
    3134        public function test_wp_filter_pre_oembed_result_prevents_http_request_for_internal_permalinks() {
    3235                $post_id   = self::factory()->post->create();
    3336                $permalink = get_permalink( $post_id );
     
    3942                $this->assertNotFalse( $this->pre_oembed_result_filtered );
    4043                $this->assertSame( $this->pre_oembed_result_filtered, $actual );
    4144        }
    42 
     45       
     46        /**
     47         * @covers WP_oEmbed::get_html
     48         */
    4349        public function test_wp_filter_pre_oembed_result_prevents_http_request_when_viewing_the_post() {
    4450                $post_id   = self::factory()->post->create();
    4551                $permalink = get_permalink( $post_id );
     
    5460                $this->assertNotFalse( $this->pre_oembed_result_filtered );
    5561                $this->assertSame( $this->pre_oembed_result_filtered, $actual );
    5662        }
    57 
     63       
     64        /**
     65         * @covers WP_oEmbed::get_html
     66         */
    5867        public function test_wp_filter_pre_oembed_result_non_existent_post() {
    5968                $post_id   = self::factory()->post->create();
    6069                $permalink = get_permalink( $post_id );
     
    7483         * @ticket 40673
    7584         * @group multisite
    7685         * @group ms-required
     86         *
     87         * @covers WP_oEmbed::get_html
    7788         */
    7889        public function test_wp_filter_pre_oembed_result_multisite_root_root() {
    7990                $post_id   = self::factory()->post->create();
     
    91102         * @ticket 40673
    92103         * @group multisite
    93104         * @group ms-required
     105         *
     106         * @covers WP_oEmbed::get_html
    94107         */
    95108        public function test_wp_filter_pre_oembed_result_multisite_sub_samesub() {
    96109                $user_id = self::factory()->user->create();
     
    120133         * @ticket 40673
    121134         * @group multisite
    122135         * @group ms-required
     136         *
     137         * @covers WP_oEmbed::get_html
    123138         */
    124139        public function test_wp_filter_pre_oembed_result_multisite_sub_othersub() {
    125140                $user_id = self::factory()->user->create();
     
    157172         * @ticket 40673
    158173         * @group multisite
    159174         * @group ms-required
     175         *
     176         * @covers WP_oEmbed::get_html
    160177         */
    161178        public function test_wp_filter_pre_oembed_result_multisite_sub_main() {
    162179                $post_id   = self::factory()->post->create();
     
    184201         * @ticket 40673
    185202         * @group multisite
    186203         * @group ms-required
     204         *
     205         * @covers WP_oEmbed::get_html
    187206         */
    188207        public function test_wp_filter_pre_oembed_result_multisite_preserves_switched_state() {
    189208                $user_id = self::factory()->user->create();
     
    213232         * @ticket 40673
    214233         * @group multisite
    215234         * @group ms-required
     235         *
     236         * @covers WP_oEmbed::get_html
    216237         */
    217238        public function test_wp_filter_pre_oembed_result_multisite_restores_state_if_no_post_is_found() {
    218239                $current_blog_id = get_current_blog_id();
  • option/multisite.php

     
    2323                        $wpdb->suppress_errors( $this->suppress );
    2424                        parent::tearDown();
    2525                }
    26 
     26       
     27                /**
     28                 * @covers ::get_blog_option
     29                 * @covers ::get_option
     30                 * @covers ::add_blog_option
     31                 * @covers ::update_blog_option
     32                 * @covers ::delete_blog_option
     33                 */
    2734                function test_from_same_site() {
    2835                        $key    = __FUNCTION__ . '_1';
    2936                        $key2   = __FUNCTION__ . '_2';
     
    6067                        $this->assertFalse( get_blog_option( 1, $key2 ) );
    6168                        $this->assertFalse( get_option( $key2 ) );                    // Check get_option().
    6269                }
    63 
     70       
     71                /**
     72                 * @covers ::get_blog_option
     73                 * @covers ::get_option
     74                 * @covers ::add_blog_option
     75                 * @covers ::update_blog_option
     76                 * @covers ::delete_blog_option
     77                 */
    6478                function test_from_same_site_with_null_blog_id() {
    6579                        $key    = __FUNCTION__ . '_1';
    6680                        $key2   = __FUNCTION__ . '_2';
     
    96110                        $this->assertFalse( get_blog_option( null, $key2 ) );
    97111                        $this->assertFalse( get_option( $key2 ) );                       // Check get_option().
    98112                }
    99 
     113               
     114                /**
     115                 * @covers ::get_blog_option
     116                 * @covers ::get_option
     117                 * @covers ::add_blog_option
     118                 * @covers ::update_blog_option
     119                 * @covers ::delete_blog_option
     120                 */
    100121                function test_with_another_site() {
    101122                        $user_id = self::factory()->user->create();
    102123                        $this->assertInternalType( 'integer', $user_id );
     
    146167
    147168                /**
    148169                 * @group multisite
     170                 *
     171                 * @covers ::get_site_option
    149172                 */
    150173                function test_site_notoptions() {
    151174                        $network_id     = get_current_network_id();
     
    163186                        $notoptions1 = wp_cache_get( $notoptions_key, 'site-options' );
    164187                        $this->assertNotEmpty( $notoptions1 );
    165188                }
    166 
     189               
     190                /**
     191                 * @covers ::users_can_register_signup_filter
     192                 * @covers ::get_site_option
     193                 */
    167194                function test_users_can_register_signup_filter() {
    168195
    169196                        $registration = get_site_option( 'registration' );
     
    181208
    182209                /**
    183210                 * @dataProvider data_illegal_names
     211                 *
     212                 * @covers ::update_site_option
     213                 * @covers ::get_site_option
    184214                 */
    185215                function test_sanitize_network_option_illegal_names( $option_value, $sanitized_option_value ) {
    186216                        update_site_option( 'illegal_names', $option_value );
     
    200230                 *
    201231                 * @param $option_value
    202232                 * @param $sanitized_option_value
     233                 *
     234                 * @covers ::update_site_option
     235                 * @covers ::get_site_option
    203236                 */
    204237                function test_sanitize_network_option_limited_email_domains( $option_value, $sanitized_option_value ) {
    205238                        update_site_option( 'limited_email_domains', $option_value );
     
    211244                 *
    212245                 * @param $option_value
    213246                 * @param $sanitized_option_value
     247                 *
     248                 * @covers ::update_site_option
     249                 * @covers ::get_site_option
    214250                 */
    215251                function test_sanitize_network_option_banned_email_domains( $option_value, $sanitized_option_value ) {
    216252                        update_site_option( 'banned_email_domains', $option_value );
  • option/networkOption.php

     
    1414
    1515        /**
    1616         * @group ms-required
     17         *
     18         * @covers ::add_site_option
    1719         */
    1820        function test_add_network_option_not_available_on_other_network() {
    1921                $id     = self::factory()->network->create();
     
    2628
    2729        /**
    2830         * @group ms-required
     31         *
     32         * @covers ::add_network_option
    2933         */
    3034        function test_add_network_option_available_on_same_network() {
    3135                $id     = self::factory()->network->create();
     
    3842
    3943        /**
    4044         * @group ms-required
     45         *
     46         * @covers ::delete_site_option
    4147         */
    4248        function test_delete_network_option_on_only_one_network() {
    4349                $id     = self::factory()->network->create();
     
    5359        /**
    5460         * @ticket 22846
    5561         * @group ms-excluded
     62         *
     63         * @covers ::add_network_option
    5664         */
    5765        public function test_add_network_option_is_not_stored_as_autoload_option() {
    5866                $key = __FUNCTION__;
     
    6775        /**
    6876         * @ticket 22846
    6977         * @group ms-excluded
     78         *
     79         * @covers ::update_network_option
    7080         */
    7181        public function test_update_network_option_is_not_stored_as_autoload_option() {
    7282                $key = __FUNCTION__;
     
    8393         *
    8494         * @param $network_id
    8595         * @param $expected_response
     96         *
     97         * @covers ::add_network_option
    8698         */
    8799        function test_add_network_option_network_id_parameter( $network_id, $expected_response ) {
    88100                $option = rand_str();
     
    96108         *
    97109         * @param $network_id
    98110         * @param $expected_response
     111         *
     112         * @covers ::get_network_option
    99113         */
    100114        function test_get_network_option_network_id_parameter( $network_id, $expected_response ) {
    101115                $option = rand_str();
     
    125139        /**
    126140         * @ticket 43506
    127141         * @group ms-required
     142         *
     143         * @covers ::get_network_option
     144         * @covers ::wp_cache_get
     145         * @covers ::wp_cache_delete
    128146         */
    129147        public function test_get_network_option_sets_notoptions_if_option_found() {
    130148                $network_id     = get_current_network_id();
     
    149167        /**
    150168         * @ticket 43506
    151169         * @group ms-required
     170         *
     171         * @covers ::get_network_option
     172         * @covers ::wp_cache_get
    152173         */
    153174        public function test_get_network_option_sets_notoptions_if_option_not_found() {
    154175                $network_id     = get_current_network_id();
     
    174195         * Ensure updating network options containing an object do not result in unneeded database calls.
    175196         *
    176197         * @ticket 44956
     198         *
     199         * @covers ::update_network_option
    177200         */
    178201        public function test_update_network_option_array_with_object() {
    179202                $array_w_object = array(
  • option/option.php

     
    88        function __return_foo() {
    99                return 'foo';
    1010        }
    11 
     11       
     12        /**
     13         * @covers ::get_option
     14         * @covers ::add_option
     15         * @covers ::update_option
     16         * @covers ::delete_option
     17         */
    1218        function test_the_basics() {
    1319                $key    = 'key1';
    1420                $key2   = 'key2';
     
    3339                $this->assertTrue( delete_option( $key2 ) );
    3440                $this->assertFalse( get_option( $key2 ) );
    3541        }
    36 
     42       
     43        /**
     44         * @covers ::get_option
     45         * @covers ::add_option
     46         * @covers ::delete_option
     47         */
    3748        function test_default_filter() {
    3849                $value = 'value';
    3950
     
    6172
    6273        /**
    6374         * @ticket 31047
     75         *
     76         * @covers ::get_option
     77         * @covers ::add_option
    6478         */
    6579        public function test_add_option_should_respect_default_option_filter() {
    6680                add_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) );
     
    7084                $this->assertTrue( $added );
    7185                $this->assertSame( 'bar', get_option( 'doesnotexist' ) );
    7286        }
    73 
     87       
     88        /**
     89         * @covers ::get_option
     90         * @covers ::add_option
     91         * @covers ::delete_option
     92         * @covers ::update_option
     93         */
    7494        function test_serialized_data() {
    7595                $key   = __FUNCTION__;
    7696                $value = array(
     
    89109
    90110        /**
    91111         * @ticket 23289
     112         *
     113         * @covers ::get_option
     114         * @covers ::add_option
     115         * @covers ::delete_option
     116         * @covers ::update_option
    92117         */
    93118        function test_bad_option_names() {
    94119                foreach ( array( '', '0', ' ', 0, false, null ) as $empty ) {
     
    101126
    102127        /**
    103128         * @ticket 23289
     129         *
     130         * @covers ::delete_option
    104131         */
    105132        function test_special_option_name_alloption() {
    106133                $this->expectException( 'WPDieException' );
     
    109136
    110137        /**
    111138         * @ticket 23289
     139         *
     140         * @covers ::delete_option
    112141         */
    113142        function test_special_option_name_notoptions() {
    114143                $this->expectException( 'WPDieException' );
     
    131160         *
    132161         * @ticket 31119
    133162         * @dataProvider data_option_autoloading
     163         *
     164         * @covers ::add_option
    134165         */
    135166        function test_option_autoloading( $name, $autoload_value, $expected ) {
    136167                global $wpdb;
  • option/registration.php

     
    44 * @group option
    55 */
    66class Tests_Option_Registration extends WP_UnitTestCase {
     7       
     8        /**
     9         * @covers ::get_registered_settings
     10         */
    711        public function test_register() {
    812                register_setting( 'test_group', 'test_option' );
    913
     
    1822                $this->assertFalse( $args['show_in_rest'] );
    1923                $this->assertSame( '', $args['description'] );
    2024        }
    21 
     25       
     26        /**
     27         * @covers ::register_setting
     28         * @covers ::apply_filters
     29         */
    2230        public function test_register_with_callback() {
    2331                register_setting( 'test_group', 'test_option', array( $this, 'filter_registered_setting' ) );
    2432
     
    2533                $filtered = apply_filters( 'sanitize_option_test_option', 'smart', 'test_option', 'smart' );
    2634                $this->assertSame( 'S-M-R-T', $filtered );
    2735        }
    28 
     36       
     37        /**
     38         * @covers ::register_setting
     39         * @covers WP_REST_Settings_Controller::sanitize_callback
     40         * @covers ::apply_filters
     41         */
    2942        public function test_register_with_array() {
    3043                register_setting(
    3144                        'test_group',
     
    4558
    4659        /**
    4760         * @ticket 38176
     61         *
     62         * @covers ::register_setting
    4863         */
    4964        public function test_register_with_default() {
    5065                register_setting(
     
    6075
    6176        /**
    6277         * @ticket 38176
     78         *
     79         * @covers ::register_setting
    6380         */
    6481        public function test_register_with_default_override() {
    6582                register_setting(
     
    7794
    7895        /**
    7996         * @ticket 38930
     97         *
     98         * @covers ::register_setting
    8099         */
    81100        public function test_add_option_with_no_options_cache() {
    82101                register_setting(
     
    93112
    94113        /**
    95114         * @expectedDeprecated register_setting
     115         *
     116         * @covers ::register_setting
    96117         */
    97118        public function test_register_deprecated_group_misc() {
    98119                register_setting( 'misc', 'test_option' );
     
    100121
    101122        /**
    102123         * @expectedDeprecated register_setting
     124         *
     125         * @covers ::register_setting
    103126         */
    104127        public function test_register_deprecated_group_privacy() {
    105128                register_setting( 'privacy', 'test_option' );
     
    107130
    108131        /**
    109132         * @ticket 43207
     133         *
     134         * @covers ::register_setting
     135         * @covers ::unregister_setting
    110136         */
    111137        public function test_unregister_setting_removes_default() {
    112138                register_setting(
  • option/sanitize-option.php

     
    8181
    8282        /**
    8383         * @dataProvider sanitize_option_provider
     84         *
     85         * @covers ::sanitize_option
    8486         */
    8587        public function test_sanitize_option( $option_name, $sanitized, $original ) {
    8688                $this->assertSame( $sanitized, sanitize_option( $option_name, $original ) );
     
    9799
    98100        /**
    99101         * @dataProvider upload_path_provider
     102         *
     103         * @covers ::sanitize_option
    100104         */
    101105        public function test_sanitize_option_upload_path( $provided, $expected ) {
    102106                $this->assertSame( $expected, sanitize_option( 'upload_path', $provided ) );
     
    104108
    105109        /**
    106110         * @ticket 36122
     111         *
     112         * @covers ::sanitize_option
    107113         */
    108114        public function test_emoji_in_blogname_and_description() {
    109115                global $wpdb;
     
    122128
    123129        /**
    124130         * @dataProvider permalink_structure_provider
     131         *
     132         * @covers ::sanitize_option
     133         * @covers ::get_settings_errors
    125134         */
    126135        public function test_sanitize_permalink_structure( $provided, $expected, $valid ) {
    127136                global $wp_settings_errors;
  • option/siteOption.php

     
    77        function __return_foo() {
    88                return 'foo';
    99        }
    10 
     10       
     11        /**
     12         * @covers ::get_site_option
     13         */
    1114        function test_get_site_option_returns_false_if_option_does_not_exist() {
    1215                $this->assertFalse( get_site_option( 'doesnotexist' ) );
    1316        }
    14 
     17       
     18        /**
     19         * @covers ::add_site_option
     20         * @covers ::delete_site_option
     21         * @covers ::get_site_option
     22         */
    1523        function test_get_site_option_returns_false_after_deletion() {
    1624                $key   = __FUNCTION__;
    1725                $value = __FUNCTION__;
     
    1927                delete_site_option( $key );
    2028                $this->assertFalse( get_site_option( $key ) );
    2129        }
    22 
     30       
     31        /**
     32         * @covers ::add_site_option
     33         * @covers ::get_site_option
     34         */
    2335        function test_get_site_option_returns_value() {
    2436                $key   = __FUNCTION__;
    2537                $value = __FUNCTION__;
     
    2638                add_site_option( $key, $value );
    2739                $this->assertSame( $value, get_site_option( $key ) );
    2840        }
    29 
     41       
     42        /**
     43         * @covers ::add_site_option
     44         * @covers ::update_site_option
     45         * @covers ::get_site_option
     46         */
    3047        function test_get_site_option_returns_updated_value() {
    3148                $key       = __FUNCTION__;
    3249                $value     = __FUNCTION__ . '_1';
     
    3552                update_site_option( $key, $new_value );
    3653                $this->assertSame( $new_value, get_site_option( $key ) );
    3754        }
    38 
     55       
     56        /**
     57         * @covers ::add_filter
     58         * @covers ::get_site_option
     59         * @covers ::remove_filter
     60         */
    3961        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' ) );
    4163                $site_option = get_site_option( 'doesnotexist' );
     
    4264                remove_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
    4365                $this->assertSame( 'foo', $site_option );
    4466        }
    45 
     67       
     68        /**
     69         * @covers ::add_filter
     70         * @covers ::get_site_option
     71         * @covers ::remove_filter
     72         */
    4673        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' ) );
    4875                $site_option = get_site_option( 'doesnotexist', 'bar' );
     
    4976                remove_filter( 'default_site_option_doesnotexist', array( $this, '__return_foo' ) );
    5077                $this->assertSame( 'foo', $site_option );
    5178        }
    52 
     79       
     80        /**
     81         * @covers ::get_site_option
     82         */
    5383        function test_get_site_option_does_not_exist_returns_provided_default() {
    5484                $this->assertSame( 'bar', get_site_option( 'doesnotexist', 'bar' ) );
    5585        }
    56 
     86       
     87        /**
     88         * @covers ::add_site_option
     89         * @covers ::get_site_option
     90         */
    5791        function test_get_site_option_exists_does_not_return_provided_default() {
    5892                $key   = __FUNCTION__;
    5993                $value = __FUNCTION__;
     
    6094                add_site_option( $key, $value );
    6195                $this->assertSame( $value, get_site_option( $key, 'foo' ) );
    6296        }
    63 
     97       
     98        /**
     99         * @covers ::add_site_option
     100         * @covers ::add_filter
     101         * @covers ::get_site_option
     102         * @covers ::remove_filter
     103         */
    64104        function test_get_site_option_exists_does_not_return_filtered_default() {
    65105                $key   = __FUNCTION__;
    66106                $value = __FUNCTION__;
     
    70110                remove_filter( 'default_site_option_' . $key, array( $this, '__return_foo' ) );
    71111                $this->assertSame( $value, $site_option );
    72112        }
    73 
     113       
     114        /**
     115         * @covers ::add_site_option
     116         */
    74117        function test_add_site_option_returns_true_for_new_option() {
    75118                $key   = __FUNCTION__;
    76119                $value = __FUNCTION__;
    77120                $this->assertTrue( add_site_option( $key, $value ) );
    78121        }
    79 
     122       
     123        /**
     124         * @covers ::add_site_option
     125         */
    80126        function test_add_site_option_returns_false_for_existing_option() {
    81127                $key   = __FUNCTION__;
    82128                $value = __FUNCTION__;
     
    83129                add_site_option( $key, $value );
    84130                $this->assertFalse( add_site_option( $key, $value ) );
    85131        }
    86 
     132       
     133        /**
     134         * @covers ::add_site_option
     135         * @covers ::update_site_option
     136         */
    87137        function test_update_site_option_returns_false_for_same_value() {
    88138                $key   = __FUNCTION__;
    89139                $value = __FUNCTION__;
     
    90140                add_site_option( $key, $value );
    91141                $this->assertFalse( update_site_option( $key, $value ) );
    92142        }
    93 
     143       
     144        /**
     145         * @covers ::add_site_option
     146         * @covers ::update_site_option
     147         */
    94148        function test_update_site_option_returns_true_for_new_value() {
    95149                $key       = 'key';
    96150                $value     = 'value1';
     
    98152                add_site_option( $key, $value );
    99153                $this->assertTrue( update_site_option( $key, $new_value ) );
    100154        }
    101 
     155       
     156        /**
     157         * @covers ::add_site_option
     158         * @covers ::delete_site_option
     159         */
    102160        function test_delete_site_option_returns_true_if_option_exists() {
    103161                $key   = __FUNCTION__;
    104162                $value = __FUNCTION__;
     
    105163                add_site_option( $key, $value );
    106164                $this->assertTrue( delete_site_option( $key ) );
    107165        }
    108 
     166       
     167        /**
     168         * @covers ::add_site_option
     169         * @covers ::delete_site_option
     170         */
    109171        function test_delete_site_option_returns_false_if_option_does_not_exist() {
    110172                $key   = __FUNCTION__;
    111173                $value = __FUNCTION__;
     
    113175                delete_site_option( $key );
    114176                $this->assertFalse( delete_site_option( $key ) );
    115177        }
    116 
     178       
     179        /**
     180         * @covers ::add_site_option
     181         * @covers ::get_site_option
     182         */
    117183        function test_site_option_add_and_get_serialized_array() {
    118184                $key   = __FUNCTION__;
    119185                $value = array(
     
    123189                add_site_option( $key, $value );
    124190                $this->assertSame( $value, get_site_option( $key ) );
    125191        }
    126 
     192       
     193        /**
     194         * @covers ::add_site_option
     195         * @covers ::get_site_option
     196         */
    127197        function test_site_option_add_and_get_serialized_object() {
    128198                $key        = __FUNCTION__;
    129199                $value      = new stdClass();
     
    137207         * Ensure update_site_option() will add options with false-y values.
    138208         *
    139209         * @ticket 15497
     210         *
     211         * @covers ::update_site_option
     212         * @covers ::flush_cache
     213         * @covers ::get_site_option
    140214         */
    141215        function test_update_adds_falsey_value() {
    142216                $key   = __FUNCTION__;
     
    152226         * Ensure get_site_option() doesn't cache the default value for non-existent options.
    153227         *
    154228         * @ticket 18955
     229         *
     230         * @covers ::get_site_option
    155231         */
    156232        function test_get_doesnt_cache_default_value() {
    157233                $option  = __FUNCTION__;
  • option/siteTransient.php

     
    1212                        $this->markTestSkipped( 'Not testable with an external object cache.' );
    1313                }
    1414        }
    15 
     15       
     16        /**
     17         * @covers ::get_site_transient
     18         * @covers ::set_site_transient
     19         * @covers ::delete_site_transient
     20         */
    1621        function test_the_basics() {
    1722                $key    = 'key1';
    1823                $value  = 'value1';
     
    2833                $this->assertFalse( get_site_transient( $key ) );
    2934                $this->assertFalse( delete_site_transient( $key ) );
    3035        }
    31 
     36       
     37        /**
     38         * @covers ::get_site_transient
     39         * @covers ::set_site_transient
     40         * @covers ::delete_site_transient
     41         */
    3242        function test_serialized_data() {
    3343                $key   = __FUNCTION__;
    3444                $value = array(
     
    4858        /**
    4959         * @ticket 22846
    5060         * @group ms-excluded
     61         *
     62         * @covers ::set_site_transient
     63         * @covers ::wp_load_alloptions
    5164         */
    5265        public function test_set_site_transient_is_not_stored_as_autoload_option() {
    5366                $key = 'not_autoloaded';
  • option/slashes.php

     
    2323
    2424        /**
    2525         * Tests the model function that expects un-slashed data
     26         *
     27         * @covers ::add_option
     28         * @covers ::get_option
    2629         */
    2730        function test_add_option() {
    2831                add_option( 'slash_test_1', $this->slash_1 );
     
    3841
    3942        /**
    4043         * Tests the model function that expects un-slashed data
     44         *
     45         * @covers ::add_option
     46         * @covers ::update_option
     47         * @covers ::get_option
    4148         */
    4249        function test_update_option() {
    4350                add_option( 'slash_test_5', 'foo' );
  • option/themeMods.php

     
    44 * @group option
    55 */
    66class Tests_Option_Theme_Mods extends WP_UnitTestCase {
    7 
     7       
     8        /**
     9         * @covers ::get_theme_mod
     10         */
    811        function test_theme_mod_default() {
    912                $this->assertFalse( get_theme_mod( 'non_existent' ) );
    1013        }
    11 
     14       
     15        /**
     16         * @covers ::get_theme_mod
     17         */
    1218        function test_theme_mod_defined_default() {
    1319                $this->assertSame( 'default', get_theme_mod( 'non_existent', 'default' ) );
    1420        }
    15 
     21       
     22        /**
     23         * @covers ::get_theme_mod
     24         */
    1625        function test_theme_mod_set() {
    1726                $expected = 'value';
    1827                set_theme_mod( 'test_name', $expected );
    1928                $this->assertSame( $expected, get_theme_mod( 'test_name' ) );
    2029        }
    21 
     30       
     31        /**
     32         * @covers ::get_theme_mod
     33         * @covers ::set_theme_mod
     34         */
    2235        function test_theme_mod_update() {
    2336                set_theme_mod( 'test_update', 'first_value' );
    2437                $expected = 'updated_value';
     
    2538                set_theme_mod( 'test_update', $expected );
    2639                $this->assertSame( $expected, get_theme_mod( 'test_update' ) );
    2740        }
    28 
     41       
     42        /**
     43         * @covers ::set_theme_mod
     44         * @covers ::remove_theme_mod
     45         * @covers ::get_theme_mod
     46         */
    2947        function test_theme_mod_remove() {
    3048                set_theme_mod( 'test_remove', 'value' );
    3149                remove_theme_mod( 'test_remove' );
     
    3654         * @ticket 34290
    3755         *
    3856         * @dataProvider data_theme_mod_default_value_with_percent_symbols
     57         *
     58         * @covers ::get_theme_mod
    3959         */
    4060        function test_theme_mod_default_value_with_percent_symbols( $default, $expected ) {
    4161                $this->assertSame( $expected, get_theme_mod( 'test_name', $default ) );
  • option/transient.php

     
    1212                        $this->markTestSkipped( 'Not testable with an external object cache.' );
    1313                }
    1414        }
    15 
     15       
     16        /**
     17         * @covers ::get_transient
     18         * @covers ::set_transient
     19         * @covers ::delete_transient
     20         */
    1621        function test_the_basics() {
    1722                $key    = 'key1';
    1823                $value  = 'value1';
     
    2833                $this->assertFalse( get_transient( $key ) );
    2934                $this->assertFalse( delete_transient( $key ) );
    3035        }
    31 
     36       
     37        /**
     38         * @covers ::get_transient
     39         * @covers ::set_transient
     40         * @covers ::delete_transient
     41         */
    3242        function test_serialized_data() {
    3343                $key   = rand_str();
    3444                $value = array(
     
    4757
    4858        /**
    4959         * @ticket 22807
     60         *
     61         * @covers ::get_option
     62         * @covers ::set_transient
     63         * @covers ::update_option
    5064         */
    5165        function test_transient_data_with_timeout() {
    5266                $key   = rand_str();
     
    6882
    6983        /**
    7084         * @ticket 22807
     85         *
     86         * @covers ::set_transient
     87         * @covers ::get_transient
     88         * @covers ::get_option
     89         * @covers ::update_option
    7190         */
    7291        function test_transient_add_timeout() {
    7392                $key    = rand_str();
     
    91110         * If get_option( $transient_timeout ) returns false, don't bother trying to delete the transient.
    92111         *
    93112         * @ticket 30380
     113         *
     114         * @covers ::set_transient
     115         * @covers ::get_transient
    94116         */
    95117        function test_nonexistent_key_dont_delete_if_false() {
    96118                // Create a bogus a transient.
     
    119141
    120142        /**
    121143         * @ticket 30380
     144         *
     145         * @covers ::set_transient
     146         * @covers ::get_transient
    122147         */
    123148        function test_nonexistent_key_old_timeout() {
    124149                // Create a transient.
  • option/updateOption.php

     
    66class Tests_Option_UpdateOption extends WP_UnitTestCase {
    77        /**
    88         * @ticket 31047
     9         *
     10         * @covers ::add_filter
     11         * @covers ::update_option
     12         * @covers ::remove_filter
    913         */
    1014        public function test_should_respect_default_option_filter_when_option_does_not_yet_exist_in_database() {
    1115                add_filter( 'default_option_doesnotexist', array( $this, '__return_foo' ) );
     
    1822
    1923        /**
    2024         * @ticket 26394
     25         *
     26         * @covers ::update_option
     27         * @covers ::wp_load_alloptions
     28         * @covers ::get_option
    2129         */
    2230        public function test_should_set_autoload_yes_for_nonexistent_option_when_autoload_param_is_missing() {
    2331                global $wpdb;
     
    3846
    3947        /**
    4048         * @ticket 26394
     49         *
     50         * @covers ::update_option
     51         * @covers ::wp_load_alloptions
     52         * @covers ::get_option
    4153         */
    4254        public function test_should_set_autoload_yes_for_nonexistent_option_when_autoload_param_is_yes() {
    4355                global $wpdb;
     
    5870
    5971        /**
    6072         * @ticket 26394
     73         *
     74         * @covers ::update_option
     75         * @covers ::wp_load_alloptions
     76         * @covers ::get_option
    6177         */
    6278        public function test_should_set_autoload_no_for_nonexistent_option_when_autoload_param_is_no() {
    6379                global $wpdb;
     
    7995
    8096        /**
    8197         * @ticket 26394
     98         *
     99         * @covers ::update_option
     100         * @covers ::wp_load_alloptions
     101         * @covers ::get_option
    82102         */
    83103        public function test_should_set_autoload_no_for_nonexistent_option_when_autoload_param_is_false() {
    84104                global $wpdb;
     
    100120
    101121        /**
    102122         * @ticket 26394
     123         *
     124         * @covers ::update_option
     125         * @covers ::wp_load_alloptions
     126         * @covers ::get_option
    103127         */
    104128        public function test_autoload_should_be_updated_for_existing_option_when_value_is_changed() {
    105129                global $wpdb;
     
    121145
    122146        /**
    123147         * @ticket 26394
     148         *
     149         * @covers ::update_option
     150         * @covers ::wp_load_alloptions
     151         * @covers ::get_option
    124152         */
    125153        public function test_autoload_should_not_be_updated_for_existing_option_when_value_is_unchanged() {
    126154                global $wpdb;
     
    143171
    144172        /**
    145173         * @ticket 26394
     174         *
     175         * @covers ::update_option
     176         * @covers ::wp_load_alloptions
     177         * @covers ::get_option
    146178         */
    147179        public function test_autoload_should_not_be_updated_for_existing_option_when_value_is_changed_but_no_value_of_autoload_is_provided() {
    148180                global $wpdb;
     
    167199
    168200        /**
    169201         * @ticket 38903
     202         *
     203         * @covers ::add_option
     204         * @covers ::get_num_queries
     205         * @covers ::update_option
    170206         */
    171207        public function test_update_option_array_with_object() {
    172208                $array_w_object = array(
  • option/userSettings.php

     
    1919
    2020                parent::tearDown();
    2121        }
    22 
     22       
     23        /**
     24         * @covers ::get_user_setting
     25         * @covers ::get_all_user_settings
     26         * @covers ::wp_set_all_user_settings
     27         */
    2328        function test_set_user_setting() {
    2429                $foo = get_user_setting( 'foo' );
    2530
     
    2934
    3035                $this->assertSame( 'bar', get_user_setting( 'foo' ) );
    3136        }
    32 
     37       
     38        /**
     39         * @covers ::get_user_setting
     40         * @covers ::wp_set_all_user_settings
     41         */
    3342        function test_set_user_setting_dashes() {
    3443                $foo = get_user_setting( 'foo' );
    3544
     
    3948
    4049                $this->assertSame( 'foo-bar-baz', get_user_setting( 'foo' ) );
    4150        }
    42 
     51       
     52        /**
     53         * @covers ::get_user_setting
     54         * @covers ::wp_set_all_user_settings
     55         */
    4356        function test_set_user_setting_strip_asterisks() {
    4457                $foo = get_user_setting( 'foo' );
    4558
  • option/wpLoadAllOptions.php

     
    1111                $this->alloptions = null;
    1212                parent::tearDown();
    1313        }
    14 
     14       
     15        /**
     16         * @covers ::wp_cache_get
     17         */
    1518        function test_if_alloptions_is_cached() {
    1619                $this->assertNotEmpty( wp_cache_get( 'alloptions', 'options' ) );
    1720        }
     
    1821
    1922        /**
    2023         * @depends test_if_alloptions_is_cached
     24         *
     25         * @covers ::wp_cache_delete
    2126         */
    2227        function test_if_cached_alloptions_is_deleted() {
    2328                $this->assertTrue( wp_cache_delete( 'alloptions', 'options' ) );
     
    2530
    2631        /**
    2732         * @depends test_if_alloptions_is_cached
     33         *
     34         * @covers ::wp_load_alloptions
    2835         */
    2936        function test_if_alloptions_are_retrieved_from_cache() {
    3037                global $wpdb;
     
    3845
    3946        /**
    4047         * @depends test_if_cached_alloptions_is_deleted
     48         *
     49         * @covers ::wp_load_alloptions
    4150         */
    4251        function test_if_alloptions_are_retrieved_from_database() {
    4352                global $wpdb;
     
    5564
    5665        /**
    5766         * @depends test_if_cached_alloptions_is_deleted
     67         *
     68         * @covers ::wp_load_alloptions
    5869         */
    5970        function test_filter_pre_cache_alloptions_is_called() {
    6071                $temp = wp_installing();
     
    8192
    8293        /**
    8394         * @depends test_if_alloptions_is_cached
     95         *
     96         * @covers ::wp_load_alloptions
    8497         */
    8598        function test_filter_pre_cache_alloptions_is_not_called() {
    8699                $temp = wp_installing();