Make WordPress Core

Changeset 49006


Ignore:
Timestamp:
09/19/2020 03:52:03 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Tests: Add missing @covers tags for files in phpunit/tests/functions/.

Props pbearne, jrf.
See #39265.

Location:
trunk/tests/phpunit/tests/functions
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/functions/addMagicQuotes.php

    r48205 r49006  
    44 * @group formatting
    55 * @group functions.php
     6 * @covers ::add_magic_quotes
    67 */
    78class Tests_Functions_AddMagicQuotes extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/allowedProtocols.php

    r48939 r49006  
    44 * @group formatting
    55 * @group functions.php
     6 * @covers ::wp_allowed_protocols
    67 */
    78class Tests_Functions_AllowedProtocols extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/anonymization.php

    r48937 r49006  
    1111 * Class Tests_Functions_Anonymization.
    1212 *
     13 * @since 4.9.6
     14 *
    1315 * @group functions.php
    1416 * @group privacy
    15  *
    16  * @since 4.9.6
     17 * @covers ::wp_privacy_anonymize_data
    1718 */
    1819class Tests_Functions_Anonymization extends WP_UnitTestCase {
     20
    1921        /**
    2022         * Test that wp_privacy_anonymize_ip() properly anonymizes all possible IP address formats.
  • trunk/tests/phpunit/tests/functions/canonicalCharset.php

    r48937 r49006  
    11<?php
    22
    3 /*
     3/**
    44 * Validate that badly named charsets always return the correct format for UTF-8 and ISO-8859-1.
    55 *
    6  *  @since 4.8.0
     6 * @since 4.8.0
     7 *
     8 * @group functions.php
     9 * @covers ::_canonical_charset
    710 */
    8 
    911class Tests_Functions_CanonicalCharset extends WP_UnitTestCase {
    1012
     
    5153        /**
    5254         * @ticket 23688
     55         *
     56         * @covers ::get_option
    5357         */
    5458        function test_update_option_blog_charset() {
  • trunk/tests/phpunit/tests/functions/cleanupHeaderComment.php

    r48937 r49006  
    11<?php
    2 /*
     2/**
    33 * Test _cleanup_header_comment().
    44 *
    5  * @group functions.php
    65 * @ticket 8497
    76 * @ticket 38101
     7 *
     8 * @group functions.php
     9 * @covers ::_cleanup_header_comment
    810 */
    911class Tests_Functions_CleanupHeaderComment extends WP_UnitTestCase {
     12
    1013        /**
    1114         * Test cleanup header of header comment.
    1215         *
    13          * @covers ::_cleanup_header_comment
    1416         * @dataProvider data_cleanup_header_comment
    1517         *
  • trunk/tests/phpunit/tests/functions/deprecated.php

    r48221 r49006  
    44 * Test cases for deprecated functions, arguments, and files
    55 *
    6  * @package    WordPress
     6 * @package WordPress
    77 * @subpackage Unit Tests
    8  * @since      3.5.0
    9  * @group      deprecated
     8 *
     9 * @since 3.5.0
     10 *
     11 * @group functions.php
     12 * @group deprecated
    1013 */
    1114class Tests_Functions_Deprecated extends WP_UnitTestCase {
     
    141144         * @ticket 6821
    142145         * @expectedDeprecated wp_save_image_file
     146         *
     147         * @covers ::wp_save_image_file
    143148         */
    144149        public function test_wp_save_image_file_deprecated_with_gd_resource() {
     
    164169         *
    165170         * @ticket 6821
     171         *
     172         * @covers ::wp_save_image_file
    166173         */
    167174        public function test_wp_save_image_file_not_deprecated_with_wp_image_editor() {
  • trunk/tests/phpunit/tests/functions/doEnclose.php

    r48848 r49006  
    1111 * Tests_Functions_DoEnclose class.
    1212 *
     13 * @since 5.3.0
     14 *
    1315 * @group functions.php
    1416 * @group post
    1517 * @covers ::do_enclose
    16  *
    17  * @since 5.3.0
    1818 */
    1919class Tests_Functions_DoEnclose extends WP_UnitTestCase {
     
    254254         *
    255255         * @param  int    $post_id Post ID.
    256          * @return string          All enclosure data for the given post.
     256         * @return string  All enclosure data for the given post.
    257257         */
    258258        protected function get_enclosed_by_post_id( $post_id ) {
  • trunk/tests/phpunit/tests/functions/getStatusHeaderDesc.php

    r47780 r49006  
    77 *
    88 * @group functions.php
     9 * @covers ::get_status_header_desc
    910 */
    1011class Tests_Functions_GetStatusHeaderDesc extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/getWeekstartend.php

    r48937 r49006  
    33/**
    44 * @group functions.php
     5 * @covers ::get_weekstartend
    56 */
    67class Tests_Functions_GetWeekstartend extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/isNewDay.php

    r47780 r49006  
    66 *
    77 * @group functions.php
     8 * @covers ::is_new_day
    89 */
    910class Tests_Functions_IsNewDate extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/isSerializedString.php

    r47780 r49006  
    44 * Tests for `is_serialized_string()`.
    55 *
     6 * @ticket 42870
     7 *
    68 * @group functions.php
    7  * @ticket 42870
     9 * @covers ::is_serialized_string
    810 */
    911class Tests_Functions_IsSerializedString extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/listFiles.php

    r46586 r49006  
    55 *
    66 * @group functions.php
     7 * @covers ::list_files
    78 */
    89class Tests_Functions_ListFiles extends WP_UnitTestCase {
     10
    911        public function test_list_files_returns_a_list_of_files() {
    1012                $admin_files = list_files( ABSPATH . 'wp-admin/' );
  • trunk/tests/phpunit/tests/functions/numberFormatI18n.php

    r48937 r49006  
    66 * @group functions.php
    77 * @group i18n
     8 * @covers ::number_format_i18n
    89 */
    910class Tests_Functions_NumberFormatI18n extends WP_UnitTestCase {
     11
    1012        public function test_should_fall_back_to_number_format_when_wp_locale_is_not_set() {
    1113                $locale               = clone $GLOBALS['wp_locale'];
  • trunk/tests/phpunit/tests/functions/pluginBasename.php

    r47780 r49006  
    66 * @group functions.php
    77 * @group plugins
     8 * @covers ::plugin_basename
    89 */
    910class Tests_Functions_PluginBasename extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/referer.php

    r42343 r49006  
    55 *
    66 * @group functions.php
     7 * @covers ::wp_get_referer
     8 * @covers ::wp_get_raw_referer
    79 */
    810class Tests_Functions_Referer extends WP_UnitTestCase {
     11
    912        public function setUp() {
    1013                parent::setUp();
  • trunk/tests/phpunit/tests/functions/removeQueryArg.php

    r48937 r49006  
    33/**
    44 * @group functions.php
     5 * @covers ::remove_query_arg
    56 */
    67class Tests_Functions_RemoveQueryArg extends WP_UnitTestCase {
     8
    79        /**
    810         * @dataProvider remove_query_arg_provider
  • trunk/tests/phpunit/tests/functions/sizeFormat.php

    r47780 r49006  
    44 * Tests for size_format()
    55 *
     6 * @ticket 36635
     7 *
    68 * @group functions.php
    7  * @ticket 36635
     9 * @covers ::size_format
    810 */
    911class Tests_Functions_SizeFormat extends WP_UnitTestCase {
     12
    1013        public function _data_size_format() {
    1114                return array(
  • trunk/tests/phpunit/tests/functions/underscoreReturn.php

    r47780 r49006  
    99class Tests_Functions_UnderscoreReturn extends WP_UnitTestCase {
    1010
     11        /**
     12         * @covers ::__return_true
     13         */
    1114        public function test__return_true() {
    1215                $this->assertTrue( __return_true() );
    1316        }
    1417
     18        /**
     19         * @covers ::__return_false
     20         */
    1521        public function test__return_false() {
    1622                $this->assertFalse( __return_false() );
    1723        }
    1824
     25        /**
     26         * @covers ::__return_zero
     27         */
    1928        public function test__return_zero() {
    2029                $this->assertSame( 0, __return_zero() );
    2130        }
    2231
     32        /**
     33         * @covers ::__return_empty_array
     34         */
    2335        public function test__return_empty_array() {
    2436                $this->assertSame( array(), __return_empty_array() );
    2537        }
    2638
     39        /**
     40         * @covers ::__return_null
     41         */
    2742        public function test__return_null() {
    2843                $this->assertNull( __return_null() );
    2944        }
    3045
     46        /**
     47         * @covers ::__return_empty_string
     48         */
    3149        public function test__return_empty_string() {
    3250                $this->assertSame( '', __return_empty_string() );
  • trunk/tests/phpunit/tests/functions/wp.php

    r47212 r49006  
    44 * @group functions.php
    55 * @group query
     6 * @covers ::wp
    67 */
    78class Tests_Functions_WP extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/wpArraySliceAssoc.php

    r48848 r49006  
    66 * @since 5.3.0
    77 *
     8 * @group functions.php
    89 * @covers ::wp_array_slice_assoc
    9  * @group functions.php
    1010 */
    1111class Tests_Functions_wpArraySliceAssoc extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/wpAuthCheck.php

    r47780 r49006  
    55 *
    66 * @group functions.php
     7 * @covers ::is_user_logged_in
     8 * @covers ::wp_auth_check
    79 */
    810class Tests_Functions_wpAuthCheck extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/wpGetArchives.php

    r48937 r49006  
    11<?php
    2 /*
    3 $defaults = array(
    4         'type' => 'monthly', 'limit' => '',
    5         'format' => 'html', 'before' => '',
    6         'after' => '', 'show_post_count' => false,
    7         'echo' => 1, 'order' => 'DESC',
    8 );
    9 */
     2
     3/**
     4 * @group functions.php
     5 * @covers ::wp_get_archives
     6 */
    107class Tests_Functions_wpGetArchives extends WP_UnitTestCase {
    118        protected static $post_ids;
  • trunk/tests/phpunit/tests/functions/wpGetMimeTypes.php

    r47780 r49006  
    55 *
    66 * @group functions.php
     7 * @covers ::wp_get_mime_types
    78 */
    89class Tests_Functions_wpGetMimeTypes extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/wpListFilter.php

    r48937 r49006  
    55 *
    66 * @group functions.php
     7 * @covers ::wp_filter_object_list
     8 * @covers ::wp_list_pluck
    79 */
    810class Tests_Functions_wpListFilter extends WP_UnitTestCase {
     
    318320        }
    319321
    320 
    321322        function test_filter_object_list_nested_array_and_field() {
    322323                $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND', 'name' );
  • trunk/tests/phpunit/tests/functions/wpListUtil.php

    r48939 r49006  
    155155        /**
    156156         * @dataProvider data_test_wp_list_pluck
     157         *
     158         * @covers ::wp_list_pluck
    157159         *
    158160         * @param array      $list      List of objects or arrays.
     
    359361        /**
    360362         * @dataProvider data_test_wp_list_filter
     363         *
     364         * @covers ::wp_list_filter
    361365         *
    362366         * @param array  $list     An array of objects to filter.
     
    687691         * @dataProvider data_test_wp_list_sort
    688692         *
     693         * @covers ::wp_list_sort
     694         *
    689695         * @param string|array $orderby Either the field name to order by or an array
    690696         *                              of multiple orderby fields as $orderby => $order.
     
    10111017        /**
    10121018         * @dataProvider data_test_wp_list_sort_preserve_keys
     1019         *
     1020         * @covers ::wp_list_sort
    10131021         *
    10141022         * @param string|array $orderby Either the field name to order by or an array
     
    10201028        }
    10211029
     1030        /**
     1031         * @covers WP_List_Util::get_input
     1032         */
    10221033        public function test_wp_list_util_get_input() {
    10231034                $input = array( 'foo', 'bar' );
     
    10271038        }
    10281039
     1040        /**
     1041         * @covers WP_List_Util::get_output
     1042         */
    10291043        public function test_wp_list_util_get_output_immediately() {
    10301044                $input = array( 'foo', 'bar' );
     
    10341048        }
    10351049
     1050        /**
     1051         * @covers WP_List_Util::get_output
     1052         */
    10361053        public function test_wp_list_util_get_output() {
    10371054                $expected = array(
  • trunk/tests/phpunit/tests/functions/wpRemoteFopen.php

    r48937 r49006  
    44 * @group external-http
    55 * @group functions.php
     6 * @covers ::wp_remote_fopen
    67 */
    78class Tests_Functions_wpRemoteFopen extends WP_UnitTestCase {
  • trunk/tests/phpunit/tests/functions/wpValidateBoolean.php

    r47780 r49006  
    44 * Tests the wp_validate_boolean function.
    55 *
     6 * @group functions.php
    67 * @covers ::wp_validate_boolean
    7  * @group functions.php
    88 */
    99class Tests_Functions_wpValidateBoolean extends WP_UnitTestCase {
     
    4848         * @dataProvider data_provider
    4949         *
    50          * @param mixed $test_value.
    51          * @param bool $expected.
     50         * @param mixed $test_value
     51         * @param bool $expected
    5252         *
    5353         * @ticket 30238
Note: See TracChangeset for help on using the changeset viewer.