Make WordPress Core

Ticket #39265: d_folders.2.patch

File d_folders.2.patch, 60.8 KB (added by patopaiar, 4 years ago)
  • date/currentTime.php

     
    88
    99        /**
    1010         * @ticket 34378
     11         *
     12         * @covers ::current_time
    1113         */
    1214        public function test_current_time_with_date_format_string() {
    1315                update_option( 'gmt_offset', 6 );
     
    2224
    2325        /**
    2426         * @ticket 34378
     27         *
     28         * @covers ::current_time
    2529         */
    2630        public function test_current_time_with_mysql_format() {
    2731                update_option( 'gmt_offset', 6 );
     
    3640
    3741        /**
    3842         * @ticket 34378
     43         *
     44         * @covers ::current_time
    3945         */
    4046        public function test_current_time_with_timestamp() {
    4147                update_option( 'gmt_offset', 6 );
     
    5157
    5258        /**
    5359         * @ticket 37440
     60         *
     61         * @covers ::current_time
    5462         */
    5563        public function test_should_work_with_changed_timezone() {
    5664                $format          = 'Y-m-d H:i:s';
     
    7886
    7987        /**
    8088         * @ticket 40653
     89         *
     90         * @covers ::current_time
    8191         */
    8292        public function test_should_return_wp_timestamp() {
    8393                update_option( 'timezone_string', 'Europe/Kiev' );
     
    103113
    104114        /**
    105115         * @ticket 40653
     116         *
     117         * @covers ::current_time
    106118         */
    107119        public function test_should_return_correct_local_time() {
    108120                update_option( 'timezone_string', 'Europe/Kiev' );
  • date/dateI18n.php

     
    88
    99        /**
    1010         * @ticket 28636
     11         *
     12         * @covers ::date_i18n
    1113         */
    1214        public function test_should_return_current_time_on_invalid_timestamp() {
    1315                $timezone = 'Europe/Kiev';
     
    2123
    2224        /**
    2325         * @ticket 28636
     26         *
     27         * @covers ::date_i18n
    2428         */
    2529        public function test_should_handle_zero_timestamp() {
    2630                $timezone = 'Europe/Kiev';
     
    3640                $this->assertSame( 0, date_i18n( 'U', 0 ) );
    3741                $this->assertSame( $rfc3339, date_i18n( DATE_RFC3339, 0 ) );
    3842        }
    39 
     43       
     44        /**
     45         * @covers ::date_i18n
     46         */
    4047        public function test_should_format_date() {
    4148                $this->assertEquals( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( date_i18n( 'Y-m-d H:i:s' ) ), 'The dates should be equal', 2 );
    4249        }
    43 
     50       
     51        /**
     52         * @covers ::date_i18n
     53         */
    4454        public function test_should_use_custom_timestamp() {
    4555                $this->assertSame( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) );
    4656        }
    47 
     57       
     58        /**
     59         * @covers ::date_i18n
     60         */
    4861        public function test_date_should_be_in_gmt() {
    4962                $this->assertEquals( strtotime( gmdate( DATE_RFC3339 ) ), strtotime( date_i18n( DATE_RFC3339, false, true ) ), 'The dates should be equal', 2 );
    5063        }
    51 
     64       
     65        /**
     66         * @covers ::date_i18n
     67         */
    5268        public function test_custom_timezone_setting() {
    5369                update_option( 'timezone_string', 'America/Regina' );
    5470
    5571                $this->assertEquals( strtotime( gmdate( 'Y-m-d H:i:s', time() + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ), strtotime( date_i18n( 'Y-m-d H:i:s' ) ), 'The dates should be equal', 2 );
    5672        }
    57 
     73       
     74        /**
     75         * @covers ::date_i18n
     76         */
    5877        public function test_date_should_be_in_gmt_with_custom_timezone_setting() {
    5978                update_option( 'timezone_string', 'America/Regina' );
    6079
     
    6685
    6786                $this->assertSame( '2012-12-01 00:00:00', date_i18n( 'Y-m-d H:i:s', strtotime( '2012-12-01 00:00:00' ) ) );
    6887        }
    69 
     88       
     89        /**
     90         * @covers ::date_i18n
     91         */
    7092        public function test_adjusts_format_based_on_locale() {
    7193                $original_locale = $GLOBALS['wp_locale'];
    72                 /* @var WP_Locale $locale */
     94                /** @var WP_Locale $locale */
    7395                $locale = clone $GLOBALS['wp_locale'];
    7496
    7597                $locale->weekday[6]                            = 'Saturday_Translated';
     
    89111
    90112                $this->assertSame( $expected, $actual );
    91113        }
    92 
     114       
     115        /**
     116         * @covers ::date_i18n
     117         */
    93118        public function test_adjusts_format_based_on_timezone_string() {
    94119                update_option( 'timezone_string', 'America/Regina' );
    95120
     
    98123
    99124        /**
    100125         * @ticket 34835
     126         *
     127         * @covers ::date_i18n
    101128         */
    102129        public function test_gmt_offset_should_output_correct_timezone() {
    103130                $timezone_formats = 'P I O T Z e';
     
    117144         * @ticket 20973
    118145         *
    119146         * @dataProvider data_formats
     147         *
     148         * @covers ::date_i18n
    120149         */
    121150        public function test_date_i18n_handles_shorthand_formats( $short, $full ) {
    122151                update_option( 'timezone_string', 'America/Regina' );
     
    140169
    141170        /**
    142171         * @ticket 25768
     172         *
     173         * @covers ::date_i18n
    143174         */
    144175        public function test_should_return_wp_timestamp() {
    145176                update_option( 'timezone_string', 'Europe/Kiev' );
     
    155186
    156187        /**
    157188         * @ticket 43530
     189         *
     190         * @covers ::date_i18n
    158191         */
    159192        public function test_swatch_internet_time_with_wp_timestamp() {
    160193                update_option( 'timezone_string', 'America/Regina' );
     
    164197
    165198        /**
    166199         * @ticket 25768
     200         *
     201         * @covers ::date_i18n
    167202         */
    168203        public function test_should_handle_escaped_formats() {
    169204                $format = 'D | \D | \\D | \\\D | \\\\D | \\\\\D | \\\\\\D';
     
    178213         *
    179214         * @param string $time     Time to test in Y-m-d H:i:s format.
    180215         * @param string $timezone PHP timezone string to use.
     216         *
     217         * @covers ::date_i18n
    181218         */
    182219        public function test_should_handle_dst( $time, $timezone ) {
    183220                update_option( 'timezone_string', $timezone );
  • date/getCommentDate.php

     
    99
    1010        /**
    1111         * @ticket 51184
     12         *
     13         * @covers ::get_comment_date
    1214         */
    1315        public function test_get_comment_date_returns_correct_time_with_comment_id() {
    1416                $c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
     
    1820
    1921        /**
    2022         * @ticket 51184
     23         *
     24         * @covers ::get_comment_date
    2125         */
    2226        public function test_get_comment_date_returns_correct_time_with_empty_format() {
    2327                $c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
     
    2832
    2933        /**
    3034         * @ticket 51184
     35         *
     36         * @covers ::get_comment_time
    3137         */
    3238        public function test_get_comment_time_returns_correct_time() {
    3339                $c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
     
    3844
    3945        /**
    4046         * @ticket 51184
     47         *
     48         * @covers ::get_comment_time
    4149         */
    4250        public function test_get_comment_time_returns_correct_time_with_empty_format() {
    4351                $c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
  • date/getFeedBuildDate.php

     
    1919
    2020        /**
    2121         * @ticket 48675
     22         *
     23         * @covers ::get_feed_build_date
    2224         */
    2325        public function test_should_return_correct_feed_build_date() {
    2426                global $wp_query;
     
    4244         * Test that get_feed_build_date() works with invalid post dates.
    4345         *
    4446         * @ticket 48957
     47         *
     48         * @covers ::get_feed_build_date
    4549         */
    4650        public function test_should_fall_back_to_last_post_modified() {
    4751                global $wp_query;
  • date/getPermalink.php

     
    1818
    1919        /**
    2020         * @ticket 48623
     21         *
     22         * @covers ::get_permalink
    2123         */
    2224        public function test_should_return_correct_date_permalink_with_changed_time_zone() {
    2325                $timezone = 'America/Chicago';
  • date/getPostTime.php

     
    99
    1010        /**
    1111         * @ticket 28310
     12         *
     13         * @covers ::get_post_time
    1214         */
    1315        public function test_get_post_time_returns_correct_time_with_post_id() {
    1416                $post_id = self::factory()->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
     
    1820
    1921        /**
    2022         * @ticket 28310
     23         *
     24         * @covers ::get_post_time
    2125         */
    2226        public function test_get_post_time_returns_false_with_null_or_non_existing_post() {
    2327                $this->assertFalse( get_post_time() );
     
    2832
    2933        /**
    3034         * @ticket 28310
     35         *
     36         * @covers ::get_post_modified_time
    3137         */
    3238        public function test_get_post_modified_time_returns_correct_time_with_post_id() {
    3339                $post_id = self::factory()->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
     
    3743
    3844        /**
    3945         * @ticket 28310
     46         *
     47         * @covers ::get_post_modified_time
    4048         */
    4149        public function test_get_post_modified_time_returns_false_with_null_or_non_existing_post() {
    4250                $this->assertFalse( get_post_modified_time() );
     
    4755
    4856        /**
    4957         * @ticket 25002
     58         *
     59         * @covers ::get_post_time
     60         * @covers ::get_post_modified_time
    5061         */
    5162        public function test_should_return_wp_timestamp() {
    5263                $timezone = 'Europe/Kiev';
     
    7687
    7788        /**
    7889         * @ticket 25002
     90         *
     91         * @covers ::get_post_time
     92         * @covers ::get_post_modified_time
    7993         */
    8094        public function test_should_return_time() {
    8195                $timezone = 'Europe/Kiev';
     
    104118
    105119        /**
    106120         * @ticket 48384
     121         *
     122         * @covers ::get_post_time
     123         * @covers ::get_post_modified_time
    107124         */
    108125        public function test_should_keep_utc_time_on_timezone_change() {
    109126                $timezone = 'UTC';
  • date/getTheDate.php

     
    99
    1010        /**
    1111         * @ticket 13771
     12         *
     13         * @covers ::get_the_date
    1214         */
    1315        public function test_get_the_date_returns_correct_time_with_post_id() {
    1416                $post_id = self::factory()->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
     
    1820
    1921        /**
    2022         * @ticket 28310
     23         *
     24         * @covers ::get_the_date
    2125         */
    2226        public function test_get_the_date_returns_false_with_null_or_non_existing_post() {
    2327                $this->assertFalse( get_the_date() );
     
    2832
    2933        /**
    3034         * @ticket 51184
     35         *
     36         * @covers ::get_the_date
    3137         */
    3238        public function test_get_the_date_returns_correct_time_with_empty_format() {
    3339                $post_id = self::factory()->post->create( array( 'post_date' => '2020-08-29 01:51:00' ) );
     
    3844
    3945        /**
    4046         * @ticket 28310
     47         *
     48         * @covers ::get_the_time
    4149         */
    4250        public function test_get_the_time_returns_correct_time_with_post_id() {
    4351                $post_id = self::factory()->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
     
    4755
    4856        /**
    4957         * @ticket 28310
     58         *
     59         * @covers ::get_the_time
    5060         */
    5161        public function test_get_the_time_returns_false_with_null_or_non_existing_post() {
    5262                $this->assertFalse( get_the_time() );
     
    5767
    5868        /**
    5969         * @ticket 51184
     70         *
     71         * @covers ::get_the_time
    6072         */
    6173        public function test_get_the_time_returns_correct_time_with_empty_format() {
    6274                $post_id = self::factory()->post->create( array( 'post_date' => '2020-08-29 01:51:00' ) );
  • date/getTheModifiedDate.php

     
    1313         * @ticket 37059
    1414         *
    1515         * @since 4.6.0
     16         *
     17         * @covers ::get_the_modified_date
    1618         */
    1719        public function test_get_the_modified_date_with_post_id() {
    1820                $details  = array(
     
    3234         * @ticket 37059
    3335         *
    3436         * @since 4.6.0
     37         *
     38         * @covers ::get_the_modified_date
    3539         */
    3640        public function test_get_the_modified_date_default() {
    3741                $details = array(
     
    5559         * @ticket 37059
    5660         *
    5761         * @since 4.6.0
     62         *
     63         * @covers ::get_the_modified_date
    5864         */
    5965        public function test_get_the_modified_date_failures_are_filtered() {
    6066                // Remove global post object.
     
    8086
    8187        /**
    8288         * @ticket 51184
     89         *
     90         * @covers ::get_the_modified_date
    8391         */
    8492        public function test_get_the_modified_date_returns_false_with_null_or_non_existing_post() {
    8593                $this->assertFalse( get_the_modified_date() );
     
    9098
    9199        /**
    92100         * @ticket 51184
     101         *
     102         * @covers ::get_the_modified_date
    93103         */
    94104        public function test_get_the_modified_date_returns_correct_time_with_empty_format() {
    95105                $post_id = self::factory()->post->create( array( 'post_date' => '2020-08-31 23:14:00' ) );
     
    104114         * @ticket 37059
    105115         *
    106116         * @since 4.6.0
     117         *
     118         * @covers ::get_the_modified_time
    107119         */
    108120        public function test_get_the_modified_time_with_post_id() {
    109121                $details  = array(
     
    123135         * @ticket 37059
    124136         *
    125137         * @since 4.6.0
     138         *
     139         * @covers ::get_the_modified_time
    126140         */
    127141        public function test_get_the_modified_time_default() {
    128142                $details = array(
     
    146160         * @ticket 37059
    147161         *
    148162         * @since 4.6.0
     163         *
     164         * @covers ::get_the_modified_time
    149165         */
    150166        public function test_get_the_modified_time_failures_are_filtered() {
    151167                // Remove global post object.
     
    171187
    172188        /**
    173189         * @ticket 51184
     190         *
     191         * @covers ::get_the_modified_time
    174192         */
    175193        public function test_get_the_modified_time_returns_false_with_null_or_non_existing_post() {
    176194                $this->assertFalse( get_the_modified_time() );
     
    181199
    182200        /**
    183201         * @ticket 51184
     202         *
     203         * @covers ::get_the_modified_time
    184204         */
    185205        public function test_get_the_modified_time_returns_correct_time_with_empty_format() {
    186206                $post_id = self::factory()->post->create( array( 'post_date' => '2020-08-31 23:14:00' ) );
  • date/maybeDeclineDate.php

     
    4141         * @ticket 48606
    4242         * @ticket 48934
    4343         * @dataProvider data_wp_maybe_decline_date
     44         *
     45         * @covers ::wp_maybe_decline_date
    4446         */
    4547        public function test_wp_maybe_decline_date( $test_locale, $format, $input, $output ) {
    4648                global $locale, $wp_locale;
     
    5860                remove_filter( 'gettext_with_context', array( $this, 'filter__enable_months_names_declension' ), 10 );
    5961
    6062                $this->assertSame( $output, $declined_date );
    61         }
    62 
     63        }       
     64       
    6365        public function filter__enable_months_names_declension( $translation, $text, $context ) {
    6466                if ( 'decline months names: on or off' === $context ) {
    6567                        $translation = 'on';
  • date/mysql2date.php

     
    1515
    1616        /**
    1717         * @ticket 28310
     18         *
     19         * @covers ::mysql2date
    1820         */
    1921        function test_mysql2date_returns_false_with_no_date() {
    2022                $this->assertFalse( mysql2date( 'F j, Y H:i:s', '' ) );
     
    2224
    2325        /**
    2426         * @ticket 28310
     27         *
     28         * @covers ::mysql2date
    2529         */
    2630        function test_mysql2date_returns_gmt_or_unix_timestamp() {
    2731                $this->assertSame( 441013392, mysql2date( 'G', '1983-12-23 07:43:12' ) );
     
    3034
    3135        /**
    3236         * @ticket 28992
     37         *
     38         * @covers ::mysql2date
    3339         */
    3440        function test_mysql2date_should_format_time() {
    3541                $timezone = 'Europe/Kiev';
     
    4450
    4551        /**
    4652         * @ticket 28992
     53         *
     54         * @covers ::mysql2date
    4755         */
    4856        function test_mysql2date_should_format_time_with_changed_time_zone() {
    4957                $timezone = 'Europe/Kiev';
     
    6068
    6169        /**
    6270         * @ticket 28992
     71         *
     72         * @covers ::mysql2date
    6373         */
    6474        function test_mysql2date_should_return_wp_timestamp() {
    6575                $timezone = 'Europe/Kiev';
     
    7484
    7585        /**
    7686         * @ticket 28992
     87         *
     88         * @covers ::mysql2date
    7789         */
    7890        function test_mysql2date_should_return_unix_timestamp_for_gmt_time() {
    7991                $timezone = 'Europe/Kiev';
  • date/query.php

     
    1616                unset( $this->q );
    1717                $this->q = new WP_Date_Query( array( 'm' => 2 ) );
    1818        }
    19 
     19       
     20        /**
     21         * Test WP_Date_Query handling of empty query.
     22         *
     23         * @covers WP_Date_Query
     24         */
    2025        public function test_construct_date_query_empty() {
    2126                $q = new WP_Date_Query( array() );
    2227                $this->assertSame( 'AND', $q->relation );
     
    2429                $this->assertSame( '=', $q->compare );
    2530                $this->assertSame( array(), $q->queries );
    2631        }
    27 
     32       
     33        /**
     34         * Test WP_Date_Query handling of non array query.
     35         *
     36         * @covers WP_Date_Query
     37         */
    2838        public function test_construct_date_query_non_array() {
    2939                $q = new WP_Date_Query( 'foo' );
    3040                $this->assertSame( 'AND', $q->relation );
     
    3242                $this->assertSame( '=', $q->compare );
    3343                $this->assertSame( array(), $q->queries );
    3444        }
    35 
     45       
     46        /**
     47         * Test WP_Date_Query handling of using a lowercase 'or' relation value.
     48         *
     49         * @covers WP_Date_Query
     50         */
    3651        public function test_construct_relation_or_lowercase() {
    3752                $q = new WP_Date_Query(
    3853                        array(
     
    4257
    4358                $this->assertSame( 'OR', $q->relation );
    4459        }
    45 
     60       
     61        /**
     62         * Test WP_Date_Query handling of an invalid relation value.
     63         *
     64         * @covers WP_Date_Query
     65         */
    4666        public function test_construct_relation_invalid() {
    4767                $q = new WP_Date_Query(
    4868                        array(
     
    5272
    5373                $this->assertSame( 'AND', $q->relation );
    5474        }
    55 
     75       
     76        /**
     77         * Test WP_Date_Query handling of the query not being an array of arrays.
     78         *
     79         * @covers WP_Date_Query
     80         */
    5681        public function test_construct_query_not_an_array_of_arrays() {
    5782                $q = new WP_Date_Query(
    5883                        array(
     
    80105
    81106                $this->assertSame( $expected, $q->queries );
    82107        }
    83 
     108       
     109        /**
     110         * Test WP_Date_Query handling of the query missing a level of array nesting.
     111         *
     112         * @covers WP_Date_Query
     113         */
    84114        public function test_construct_query_contains_non_arrays() {
    85115                $q = new WP_Date_Query(
    86116                        array(
     
    112142
    113143                $this->assertSame( $expected, $q->queries );
    114144        }
    115 
     145       
     146        /**
     147         * Test WP_Date_Query handling of not provided compare value.
     148         *
     149         * @covers WP_Date_Query
     150         */
    116151        public function test_get_compare_empty() {
    117152                $q = new WP_Date_Query( array() );
    118153                $this->assertSame( '=', $q->get_compare( array() ) );
    119154        }
    120 
     155       
     156        /**
     157         * Test WP_Date_Query handling of '=' compare value.
     158         *
     159         * @covers WP_Date_Query
     160         */
    121161        public function test_get_compare_equals() {
    122162                $q = new WP_Date_Query( array() );
    123163
     
    128168                );
    129169                $this->assertSame( '=', $found );
    130170        }
    131 
     171       
     172        /**
     173         * Test WP_Date_Query handling of '!=' compare value.
     174         *
     175         * @covers WP_Date_Query
     176         */
    132177        public function test_get_compare_not_equals() {
    133178                $q = new WP_Date_Query( array() );
    134179
     
    139184                );
    140185                $this->assertSame( '!=', $found );
    141186        }
    142 
     187       
     188        /**
     189         * Test WP_Date_Query handling of '>' compare value.
     190         *
     191         * @covers WP_Date_Query
     192         */
    143193        public function test_get_compare_greater_than() {
    144194                $q = new WP_Date_Query( array() );
    145195
     
    150200                );
    151201                $this->assertSame( '>', $found );
    152202        }
    153 
     203       
     204        /**
     205         * Test WP_Date_Query handling of '>=' compare value.
     206         *
     207         * @covers WP_Date_Query
     208         */
    154209        public function test_get_compare_greater_than_or_equal_to() {
    155210                $q = new WP_Date_Query( array() );
    156211
     
    161216                );
    162217                $this->assertSame( '>=', $found );
    163218        }
    164 
     219       
     220        /**
     221         * Test WP_Date_Query handling of '<' compare value.
     222         *
     223         * @covers WP_Date_Query
     224         */
    165225        public function test_get_compare_less_than() {
    166226                $q = new WP_Date_Query( array() );
    167227
     
    172232                );
    173233                $this->assertSame( '<', $found );
    174234        }
    175 
     235       
     236        /**
     237         * Test WP_Date_Query handling of '<=' compare value.
     238         *
     239         * @covers WP_Date_Query
     240         */
    176241        public function test_get_compare_less_than_or_equal_to() {
    177242                $q = new WP_Date_Query( array() );
    178243
     
    183248                );
    184249                $this->assertSame( '<=', $found );
    185250        }
    186 
     251       
     252        /**
     253         * Test WP_Date_Query handling of 'IN' compare value.
     254         *
     255         * @covers WP_Date_Query
     256         */
    187257        public function test_get_compare_in() {
    188258                $q = new WP_Date_Query( array() );
    189259
     
    194264                );
    195265                $this->assertSame( 'IN', $found );
    196266        }
    197 
     267       
     268        /**
     269         * Test WP_Date_Query handling of 'NOT IN' compare value.
     270         *
     271         * @covers WP_Date_Query
     272         */
    198273        public function test_get_compare_not_in() {
    199274                $q = new WP_Date_Query( array() );
    200275
     
    205280                );
    206281                $this->assertSame( 'NOT IN', $found );
    207282        }
    208 
     283       
     284        /**
     285         * Test WP_Date_Query handling of 'BETWEEN' compare value.
     286         *
     287         * @covers WP_Date_Query
     288         */
    209289        public function test_get_compare_between() {
    210290                $q = new WP_Date_Query( array() );
    211291
     
    216296                );
    217297                $this->assertSame( 'BETWEEN', $found );
    218298        }
    219 
     299       
     300        /**
     301         * @covers WP_Date_Query
     302         */
    220303        public function test_get_compare_not_between() {
    221304                $q = new WP_Date_Query( array() );
    222305
     
    227310                );
    228311                $this->assertSame( 'BETWEEN', $found );
    229312        }
    230 
     313       
     314        /**
     315         * Test WP_Date_Query validation of post_date column.
     316         *
     317         * @covers WP_Date_Query::validate_column
     318         */
    231319        public function test_validate_column_post_date() {
    232320                global $wpdb;
    233321                $q = new WP_Date_Query( array() );
     
    234322
    235323                $this->assertSame( $wpdb->posts . '.post_date', $q->validate_column( 'post_date' ) );
    236324        }
    237 
     325       
     326        /**
     327         * Test WP_Date_Query validation of post_date_gmt column.
     328         *
     329         * @covers WP_Date_Query::validate_column
     330         */
    238331        public function test_validate_column_post_date_gmt() {
    239332                global $wpdb;
    240333                $q = new WP_Date_Query( array() );
     
    241334
    242335                $this->assertSame( $wpdb->posts . '.post_date_gmt', $q->validate_column( 'post_date_gmt' ) );
    243336        }
    244 
     337       
     338        /**
     339         * Test WP_Date_Query validation of post_modified column.
     340         *
     341         * @covers WP_Date_Query::validate_column
     342         */
    245343        public function test_validate_column_post_modified() {
    246344                global $wpdb;
    247345                $q = new WP_Date_Query( array() );
     
    248346
    249347                $this->assertSame( $wpdb->posts . '.post_modified', $q->validate_column( 'post_modified' ) );
    250348        }
    251 
     349       
     350        /**
     351         * Test WP_Date_Query validation of post_modified_gmt column.
     352         *
     353         * @covers WP_Date_Query::validate_column
     354         */
    252355        public function test_validate_column_post_modified_gmt() {
    253356                global $wpdb;
    254357                $q = new WP_Date_Query( array() );
     
    255358
    256359                $this->assertSame( $wpdb->posts . '.post_modified_gmt', $q->validate_column( 'post_modified_gmt' ) );
    257360        }
    258 
     361       
     362        /**
     363         * Test WP_Date_Query validation of comment_date column.
     364         *
     365         * @covers WP_Date_Query::validate_column
     366         */
    259367        public function test_validate_column_comment_date() {
    260368                global $wpdb;
    261369                $q = new WP_Date_Query( array() );
     
    262370
    263371                $this->assertSame( $wpdb->comments . '.comment_date', $q->validate_column( 'comment_date' ) );
    264372        }
    265 
     373       
     374        /**
     375         * Test WP_Date_Query validation of comment_date_gmt column.
     376         *
     377         * @covers WP_Date_Query::validate_column
     378         */
    266379        public function test_validate_column_comment_date_gmt() {
    267380                global $wpdb;
    268381                $q = new WP_Date_Query( array() );
     
    269382
    270383                $this->assertSame( $wpdb->comments . '.comment_date_gmt', $q->validate_column( 'comment_date_gmt' ) );
    271384        }
    272 
     385       
     386        /**
     387         * Test WP_Date_Query validation of an invalid post_date value.
     388         *
     389         * @covers WP_Date_Query::validate_column
     390         */
    273391        public function test_validate_column_invalid() {
    274392                global $wpdb;
    275393                $q = new WP_Date_Query( array() );
     
    279397
    280398        /**
    281399         * @ticket 25775
     400         *
     401         * @covers WP_Date_Query::validate_column
    282402         */
    283403        public function test_validate_column_with_date_query_valid_columns_filter() {
    284404                $q = new WP_Date_Query( array() );
     
    292412
    293413        /**
    294414         * @ticket 25775
     415         *
     416         * @covers WP_Date_Query::validate_column
    295417         */
    296418        public function test_validate_column_prefixed_column_name() {
    297419                $q = new WP_Date_Query( array() );
     
    301423
    302424        /**
    303425         * @ticket 25775
     426         *
     427         * @covers WP_Date_Query::validate_column
    304428         */
    305429        public function test_validate_column_prefixed_column_name_with_illegal_characters() {
    306430                $q = new WP_Date_Query( array() );
     
    307431
    308432                $this->assertSame( 'foo.bar', $q->validate_column( 'f"\'oo\/.b;:()ar' ) );
    309433        }
    310 
     434       
     435        /**
     436         * Test WP_Date_Query::build_value when passed a null value
     437         *
     438         * @covers WP_Date_Query::build_value
     439         */
    311440        public function test_build_value_value_null() {
    312441                global $wpdb;
    313442                $q = new WP_Date_Query( array() );
     
    317446
    318447        /**
    319448         * @ticket 29801
     449         *
     450         * @covers WP_Date_Query::build_value
    320451         */
    321452        public function test_build_value_compare_in() {
    322453                $q = new WP_Date_Query( array() );
     
    340471
    341472        /**
    342473         * @ticket 29801
     474         *
     475         * @covers WP_Date_Query::build_value
    343476         */
    344477        public function test_build_value_compare_not_in() {
    345478                $q = new WP_Date_Query( array() );
     
    360493                $found = $q->build_value( 'NOT IN', array( 1, 'foo', 7 ) );
    361494                $this->assertSame( '(1,7)', $found );
    362495        }
    363 
     496       
     497        /**
     498         * Test WP_Date_Query::build_value when passed the same values as compare BETWEEN.
     499         *
     500         * @covers WP_Date_Query::build_value
     501         */
    364502        public function test_build_value_compare_between_single_integer() {
    365503                $q = new WP_Date_Query( array() );
    366504
     
    370508
    371509        /**
    372510         * @ticket 29801
     511         *
     512         * @covers WP_Date_Query::build_value
    373513         */
    374514        public function test_build_value_compare_between_single_non_numeric() {
    375515                $q = new WP_Date_Query( array() );
     
    380520
    381521        /**
    382522         * @ticket 29801
     523         *
     524         * @covers WP_Date_Query::build_value
    383525         */
    384526        public function test_build_value_compare_between_array_with_other_than_two_items() {
    385527                $q = new WP_Date_Query( array() );
     
    390532
    391533        /**
    392534         * @ticket 29801
     535         *
     536         * @covers WP_Date_Query::build_value
    393537         */
    394538        public function test_build_value_compare_between_incorrect_array_key() {
    395539                $q = new WP_Date_Query( array() );
     
    407551
    408552        /**
    409553         * @ticket 29801
     554         *
     555         * @covers WP_Date_Query::build_value
    410556         */
    411557        public function test_build_value_compare_between_array_contains_non_numeric() {
    412558                $q = new WP_Date_Query( array() );
     
    414560                $found = $q->build_value( 'BETWEEN', array( 2, 'foo' ) );
    415561                $this->assertFalse( $found );
    416562        }
    417 
     563       
     564        /**
     565         * @covers WP_Date_Query::build_value
     566         */
    418567        public function test_build_value_compare_between() {
    419568                $q = new WP_Date_Query( array() );
    420569
     
    421570                $found = $q->build_value( 'BETWEEN', array( 2, 3 ) );
    422571                $this->assertSame( '2 AND 3', $found );
    423572        }
    424 
     573       
     574        /**
     575         * @covers WP_Date_Query::build_value
     576         */
    425577        public function test_build_value_compare_not_between_single_integer() {
    426578                $q = new WP_Date_Query( array() );
    427579
     
    431583
    432584        /**
    433585         * @ticket 29801
     586         *
     587         * @covers WP_Date_Query::build_value
    434588         */
    435589        public function test_build_value_compare_not_between_single_non_numeric() {
    436590                $q = new WP_Date_Query( array() );
     
    441595
    442596        /**
    443597         * @ticket 29801
     598         *
     599         * @covers WP_Date_Query::build_value
    444600         */
    445601        public function test_build_value_compare_not_between_array_with_other_than_two_items() {
    446602                $q = new WP_Date_Query( array() );
     
    451607
    452608        /**
    453609         * @ticket 29801
     610         *
     611         * @covers WP_Date_Query::build_value
    454612         */
    455613        public function test_build_value_compare_not_between_incorrect_array_key() {
    456614                $q = new WP_Date_Query( array() );
     
    468626
    469627        /**
    470628         * @ticket 29801
     629         *
     630         * @covers WP_Date_Query::build_value
    471631         */
    472632        public function test_build_value_compare_not_between_array_contains_non_numeric() {
    473633                $q = new WP_Date_Query( array() );
     
    475635                $found = $q->build_value( 'NOT BETWEEN', array( 2, 'foo' ) );
    476636                $this->assertFalse( $found );
    477637        }
    478 
     638       
     639        /**
     640         * @covers WP_Date_Query::build_value
     641         */
    479642        public function test_build_value_compare_not_between() {
    480643                $q = new WP_Date_Query( array() );
    481644
     
    482645                $found = $q->build_value( 'NOT BETWEEN', array( 2, 3 ) );
    483646                $this->assertSame( '2 AND 3', $found );
    484647        }
    485 
     648       
     649        /**
     650         * @covers WP_Date_Query::build_value
     651         */
    486652        public function test_build_value_compare_default_value_integer() {
    487653                $q = new WP_Date_Query( array() );
    488654
     
    492658
    493659        /**
    494660         * @ticket 29801
     661         *
     662         * @covers WP_Date_Query::build_value
    495663         */
    496664        public function test_build_value_compare_default_value_non_numeric() {
    497665                $q = new WP_Date_Query( array() );
     
    499667                $found = $q->build_value( 'foo', 'foo' );
    500668                $this->assertFalse( $found );
    501669        }
    502 
     670       
     671        /**
     672         * @covers WP_Date_Query::build_mysql_datetime
     673         */
    503674        public function test_build_mysql_datetime_datetime_non_array() {
    504675                $q = new WP_Date_Query( array() );
    505676
     
    517688         * @param array|string $datetime       Array or string date input.
    518689         * @param string       $expected       Expected built result.
    519690         * @param bool         $default_to_max Flag to default missing values to max.
     691         *
     692         * @covers WP_Date_Query::build_mysql_datetime
    520693         */
    521694        public function test_build_mysql_datetime( $datetime, $expected, $default_to_max = false ) {
    522695                $q = new WP_Date_Query( array() );
     
    525698
    526699                $message = "Expected {$expected}, got {$found}";
    527700                $this->assertEquals( strtotime( $expected ), strtotime( $found ), $message, 10 );
    528         }
     701        }       
    529702
    530         public function mysql_datetime_input_provider() {
    531                 return array(
    532                         array( '2019-06-04T08:18:24+03:00', '2019-06-04 05:18:24' ),
    533                         array( '2019-06-04T05:18:24+00:00', '2019-06-04 05:18:24' ),
    534                         array( array(), current_time( 'Y' ) . '-01-01 00:00:00' ),
    535                         array( array( 'year' => 2011 ), '2011-12-31 23:59:59', true ),
    536                         array( array( 'year' => 2011 ), '2011-01-01 00:00:00' ),
    537                         array( '2011', '2011-01-01 00:00:00' ),
    538                         array( '2011-02', '2011-02-01 00:00:00' ),
    539                         array( '2011-02-03', '2011-02-03 00:00:00' ),
    540                         array( '2011-02-03 13:30', '2011-02-03 13:30:00' ),
    541                         array( '2011-02-03 13:30:35', '2011-02-03 13:30:35' ),
    542                 );
    543         }
    544 
    545703        /**
    546704         * @ticket 41782
    547705         *
     
    550708         * @param array|string $datetime       Array or string date input.
    551709         * @param string       $expected       Expected built result.
    552710         * @param bool         $default_to_max Flag to default missing values to max.
     711         *
     712         * @covers WP_Date_Query::build_mysql_datetime
    553713         */
    554714        public function test_build_mysql_datetime_with_custom_timezone( $datetime, $expected, $default_to_max = false ) {
    555715                update_option( 'timezone_string', 'Europe/Kiev' );
     
    561721                $message = "Expected {$expected}, got {$found}";
    562722                $this->assertEquals( strtotime( $expected ), strtotime( $found ), $message, 10 );
    563723
    564         }
     724        }       
    565725
    566         public function mysql_datetime_input_provider_custom_timezone() {
    567                 return array(
    568                         array( '2019-06-04T08:18:24+03:00', '2019-06-04 08:18:24' ),
    569                         array( '2019-06-04T05:18:24+00:00', '2019-06-04 08:18:24' ),
    570                 );
    571         }
    572 
    573726        /**
    574727         * @ticket 41782
     728         *
     729         * @covers WP_Date_Query::build_mysql_datetime
    575730         */
    576731        public function test_build_mysql_datetime_with_relative_date() {
    577732                update_option( 'timezone_string', 'Europe/Kiev' );
     
    585740                $message = "Expected {$expected}, got {$found}";
    586741                $this->assertEquals( strtotime( $expected ), strtotime( $found ), $message, 10 );
    587742        }
    588 
     743       
     744        /**
     745        * @covers WP_Date_Query::build_time_query
     746        */
    589747        public function test_build_time_query_insufficient_time_values() {
    590748                $q = new WP_Date_Query( array() );
    591749
     
    594752
    595753        /**
    596754         * @ticket 34228
     755         *
     756         * @covers WP_Date_Query::build_time_query
    597757         */
    598758        public function test_build_time_query_should_not_discard_hour_0() {
    599759                global $wpdb;
     
    603763
    604764                $this->assertContains( '%H', $wpdb->remove_placeholder_escape( $found ) );
    605765        }
    606 
     766       
     767        /**
     768         * @covers WP_Date_Query::build_time_query
     769         */
    607770        public function test_build_time_query_compare_in() {
    608771                $q = new WP_Date_Query( array() );
    609772
     
    619782                $found = $q->build_time_query( 'post_date', 'IN', array( 1, 2 ), array( 3, 4, 5 ), 6 );
    620783                $this->assertSame( 'HOUR( post_date ) IN (1,2) AND MINUTE( post_date ) IN (3,4,5) AND SECOND( post_date ) IN (6)', $found );
    621784        }
    622 
     785       
     786        /**
     787         * @covers WP_Date_Query::build_time_query
     788         */
    623789        public function test_build_time_query_compare_not_in() {
    624790                $q = new WP_Date_Query( array() );
    625791
     
    635801                $found = $q->build_time_query( 'post_date', 'NOT IN', array( 1, 2 ), array( 3, 4, 5 ), 6 );
    636802                $this->assertSame( 'HOUR( post_date ) NOT IN (1,2) AND MINUTE( post_date ) NOT IN (3,4,5) AND SECOND( post_date ) NOT IN (6)', $found );
    637803        }
    638 
     804       
     805        /**
     806         * @covers WP_Date_Query::build_time_query
     807         */
    639808        public function test_build_time_query_compare_between() {
    640809                $q = new WP_Date_Query( array() );
    641810
     
    651820                $found = $q->build_time_query( 'post_date', 'BETWEEN', array( 1, 2 ), array( 3, 4 ), array( 6, 7 ) );
    652821                $this->assertSame( 'HOUR( post_date ) BETWEEN 1 AND 2 AND MINUTE( post_date ) BETWEEN 3 AND 4 AND SECOND( post_date ) BETWEEN 6 AND 7', $found );
    653822        }
    654 
     823       
     824        /**
     825         * @covers WP_Date_Query::build_time_query
     826         */
    655827        public function test_build_time_query_compare_not_between() {
    656828                $q = new WP_Date_Query( array() );
    657829
     
    667839                $found = $q->build_time_query( 'post_date', 'NOT BETWEEN', array( 1, 2 ), array( 3, 4 ), array( 6, 7 ) );
    668840                $this->assertSame( 'HOUR( post_date ) NOT BETWEEN 1 AND 2 AND MINUTE( post_date ) NOT BETWEEN 3 AND 4 AND SECOND( post_date ) NOT BETWEEN 6 AND 7', $found );
    669841        }
    670 
     842       
     843        /**
     844         * @covers WP_Date_Query::build_time_query
     845         */
    671846        public function test_build_time_query_hour_only() {
    672847                $q = new WP_Date_Query( array() );
    673848
     
    681856                $found = $q->build_time_query( 'post_date', '=', null, 5 );
    682857                $this->assertSame( 'MINUTE( post_date ) = 5', $found );
    683858        }
    684 
     859       
     860        /**
     861         * @covers WP_Date_Query::build_time_query
     862         */
    685863        public function test_build_time_query_second_only() {
    686864                $q = new WP_Date_Query( array() );
    687865
     
    688866                $found = $q->build_time_query( 'post_date', '=', null, null, 5 );
    689867                $this->assertSame( 'SECOND( post_date ) = 5', $found );
    690868        }
    691 
     869       
     870        /**
     871         * @covers WP_Date_Query::build_time_query
     872         */
    692873        public function test_build_time_query_hour_and_second() {
    693874                $q = new WP_Date_Query( array() );
    694875
     
    695876                $found = $q->build_time_query( 'post_date', '=', 5, null, 5 );
    696877                $this->assertFalse( $found );
    697878        }
    698 
     879       
     880        /**
     881         * @covers WP_Date_Query::build_time_query
     882         * @covers wpdb::remove_placeholder_escape
     883         */
    699884        public function test_build_time_query_hour_minute() {
    700885                global $wpdb;
    701886                $q = new WP_Date_Query( array() );
     
    706891                // varying precision on different PHP installations.
    707892                $this->assertRegExp( "/DATE_FORMAT\( post_date, '%H\.%i' \) = 5\.150*/", $wpdb->remove_placeholder_escape( $found ) );
    708893        }
    709 
     894       
     895        /**
     896         * @covers WP_Date_Query::build_time_query
     897         * @covers wpdb::remove_placeholder_escape
     898         */
    710899        public function test_build_time_query_hour_minute_second() {
    711900                global $wpdb;
    712901                $q = new WP_Date_Query( array() );
     
    717906                // varying precision on different PHP installations.
    718907                $this->assertRegExp( "/DATE_FORMAT\( post_date, '%H\.%i%s' \) = 5\.15350*/", $wpdb->remove_placeholder_escape( $found ) );
    719908        }
    720 
     909       
     910        /**
     911         * @covers WP_Date_Query::build_time_query
     912         * @covers wpdb::remove_placeholder_escape
     913         */
    721914        public function test_build_time_query_minute_second() {
    722915                global $wpdb;
    723916                $q = new WP_Date_Query( array() );
     
    732925        /**
    733926         * @ticket 25834
    734927         * @expectedIncorrectUsage WP_Date_Query
     928         *
     929         * @covers WP_Date_Query::validate_date_values
    735930         */
    736931        public function test_validate_date_query_before_after() {
    737932                // Valid values.
     
    779974        /**
    780975         * @ticket 25834
    781976         * @expectedIncorrectUsage WP_Date_Query
     977         *
     978         * @covers WP_Date_Query::validate_date_values
    782979         */
    783980        public function test_validate_date_query_before_after_with_month() {
    784981                // Both are valid.
     
    8251022        /**
    8261023         * @ticket 25834
    8271024         * @expectedIncorrectUsage WP_Date_Query
     1025         *
     1026         * @covers WP_Date_Query::validate_date_values
    8281027         */
    8291028        public function test_validate_date_values_week() {
    8301029                // Valid values.
     
    8781077        /**
    8791078         * @ticket 25834
    8801079         * @expectedIncorrectUsage WP_Date_Query
     1080         *
     1081         * @covers WP_Date_Query::validate_date_values
    8811082         */
    8821083        public function test_validate_date_values_month() {
    8831084                // Valid values.
     
    8961097        /**
    8971098         * @ticket 25834
    8981099         * @expectedIncorrectUsage WP_Date_Query
     1100         *
     1101         * @covers WP_Date_Query::validate_date_values
    8991102         */
    9001103        public function test_validate_date_values_day() {
    9011104                // Valid values.
     
    9531156        /**
    9541157         * @ticket 25834
    9551158         * @expectedIncorrectUsage WP_Date_Query
     1159         *
     1160         * @covers WP_Date_Query::validate_date_values
    9561161         */
    9571162        public function test_validate_date_values_hour() {
    9581163                // Valid values.
     
    9711176        /**
    9721177         * @ticket 25834
    9731178         * @expectedIncorrectUsage WP_Date_Query
     1179         *
     1180         * @covers WP_Date_Query::validate_date_values
    9741181         */
    9751182        public function test_validate_date_values_minute() {
    9761183                // Valid values.
     
    9891196        /**
    9901197         * @ticket 25834
    9911198         * @expectedIncorrectUsage WP_Date_Query
     1199         *
     1200         * @covers WP_Date_Query::validate_date_values
    9921201         */
    9931202        public function test_validate_date_values_second() {
    9941203                // Valid values.
     
    10081217        /**
    10091218         * @ticket 25834
    10101219         * @expectedIncorrectUsage WP_Date_Query
     1220         *
     1221         * @covers WP_Date_Query::validate_date_values
    10111222         */
    10121223        public function test_validate_date_values_day_of_week() {
    10131224                // Valid values.
     
    10261237        /**
    10271238         * @ticket 28063
    10281239         * @expectedIncorrectUsage WP_Date_Query
     1240         *
     1241         * @covers WP_Date_Query::validate_date_values
    10291242         */
    10301243        public function test_validate_date_values_day_of_week_iso() {
    10311244                // Valid values.
     
    10441257        /**
    10451258         * @ticket 25834
    10461259         * @expectedIncorrectUsage WP_Date_Query
     1260         *
     1261         * @covers WP_Date_Query::validate_date_values
    10471262         */
    10481263        public function test_validate_date_values_day_of_year() {
    10491264                // Valid values.
     
    10611276
    10621277        /**
    10631278         * @ticket 31001
     1279         *
     1280         * @covers WP_Date_Query
    10641281         */
    10651282        public function test_validate_date_values_should_process_array_value_for_year() {
    10661283                $p1 = self::factory()->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
     
    10831300
    10841301        /**
    10851302         * @ticket 31001
     1303         *
     1304         * @covers WP_Date_Query
    10861305         */
    10871306        public function test_validate_date_values_should_process_array_value_for_day() {
    10881307                $p1 = self::factory()->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
     
    11061325        /**
    11071326         * @ticket 31001
    11081327         * @expectedIncorrectUsage WP_Date_Query
     1328         *
     1329         * @covers WP_Date_Query
    11091330         */
    11101331        public function test_validate_date_values_should_process_array_value_for_day_when_values_are_invalid() {
    11111332                $p1 = self::factory()->post->create( array( 'post_date' => '2015-01-12 00:00:00' ) );
     
    11271348                $this->assertSame( array( $p1, $p2 ), $q->posts );
    11281349        }
    11291350
    1130         /** Helpers */
     1351        /**
     1352         * Helpers
     1353         */
    11311354
    11321355        public function date_query_valid_columns_callback( $columns ) {
    11331356                $columns[] = 'my_custom_column';
    11341357                return $columns;
    11351358        }
     1359       
     1360        public function mysql_datetime_input_provider() {
     1361                return array(
     1362                        array( '2019-06-04T08:18:24+03:00', '2019-06-04 05:18:24' ),
     1363                        array( '2019-06-04T05:18:24+00:00', '2019-06-04 05:18:24' ),
     1364                        array( array(), current_time( 'Y' ) . '-01-01 00:00:00' ),
     1365                        array( array( 'year' => 2011 ), '2011-12-31 23:59:59', true ),
     1366                        array( array( 'year' => 2011 ), '2011-01-01 00:00:00' ),
     1367                        array( '2011', '2011-01-01 00:00:00' ),
     1368                        array( '2011-02', '2011-02-01 00:00:00' ),
     1369                        array( '2011-02-03', '2011-02-03 00:00:00' ),
     1370                        array( '2011-02-03 13:30', '2011-02-03 13:30:00' ),
     1371                        array( '2011-02-03 13:30:35', '2011-02-03 13:30:35' ),
     1372                );
     1373        }
     1374       
     1375        public function mysql_datetime_input_provider_custom_timezone() {
     1376                return array(
     1377                        array( '2019-06-04T08:18:24+03:00', '2019-06-04 08:18:24' ),
     1378                        array( '2019-06-04T05:18:24+00:00', '2019-06-04 08:18:24' ),
     1379                );
     1380        }
    11361381}
  • date/theDate.php

     
    5252
    5353                the_date();
    5454                get_the_date();
    55 
     55               
    5656                the_modified_date();
    5757                get_the_modified_date();
    5858
     
    8585
    8686        /**
    8787         * @ticket 33750
     88         *
     89         * @covers ::the_date
    8890         */
    8991        function test_the_date() {
    9092                ob_start();
     
    125127
    126128        /**
    127129         * @ticket 47354
     130         *
     131         * @covers ::the_weekday_date
    128132         */
    129133        function test_the_weekday_date() {
    130134                ob_start();
  • date/wpDate.php

     
    2727
    2828        /**
    2929         * @ticket 28636
     30         *       
     31         * @covers ::wp_date
    3032         */
    3133        public function test_should_return_false_on_invalid_timestamp() {
    3234                $this->assertFalse( wp_date( DATE_RFC3339, 'invalid' ) );
     
    3436
    3537        /**
    3638         * @ticket 48319
     39         *       
     40         * @covers ::wp_date
    3741         */
    3842        public function test_should_not_escape_localized_numbers() {
    3943                global $wp_locale;
     
    4852
    4953        /**
    5054         * @ticket 48319
     55         *       
     56         * @covers ::wp_date
    5157         */
    5258        public function test_should_keep_localized_slashes() {
    5359                global $wp_locale;
  • date/wpTimezone.php

     
    1313         *
    1414         * @param float  $gmt_offset Numeric offset from UTC.
    1515         * @param string $tz_name    Expected timezone name.
     16         *       
     17         * @covers ::wp_timezone_string
     18         * @covers ::wp_timezone
    1619         */
    1720        public function test_should_convert_gmt_offset( $gmt_offset, $tz_name ) {
    1821                delete_option( 'timezone_string' );
     
    2730
    2831        /**
    2932         * @ticket 24730
     33         *       
     34         * @covers ::wp_timezone_string
     35         * @covers ::wp_timezone
    3036         */
    3137        public function test_should_return_timezone_string() {
    3238                update_option( 'timezone_string', 'Europe/Kiev' );
  • date/xmlrpc.php

     
    99
    1010        /**
    1111         * @ticket 30429
     12         *       
     13         * @covers wp_xmlrpc_server::mw_newPost
     14         * @covers IXR_Date
    1215         */
    1316        public function test_date_new_post() {
    1417                $timezone = 'Europe/Kiev';
     
    127130
    128131        /**
    129132         * @ticket 30429
     133         *       
     134         * @covers wp_xmlrpc_server::mw_editPost
     135         * @covers IXR_Date
    130136         */
    131137        public function test_date_edit_post() {
    132138                $timezone = 'Europe/Kiev';
     
    194200
    195201        /**
    196202         * @ticket 30429
     203         *       
     204         * @covers wp_xmlrpc_server::wp_editComment
     205         * @covers IXR_Date
    197206         */
    198207        function test_date_edit_comment() {
    199208                $timezone = 'Europe/Kiev';
  • db/charset.php

     
    476476        /**
    477477         * @dataProvider data_strip_invalid_text
    478478         * @ticket 21212
     479         *
     480         * @covers wpdb::strip_invalid_text
    479481         */
    480482        function test_strip_invalid_text( $data, $expected, $message ) {
    481483                $charset = self::$_wpdb->charset;
     
    507509
    508510        /**
    509511         * @ticket 21212
     512         *
     513         * @covers wpdb::process_fields
    510514         */
    511515        function test_process_fields_failure() {
    512516                global $wpdb;
     
    592596        /**
    593597         * @dataProvider data_process_field_charsets
    594598         * @ticket 21212
     599         *
     600         * @covers wpdb::process_field_charsets
    595601         */
    596602        function test_process_field_charsets( $data, $expected, $message ) {
    597603                $actual = self::$_wpdb->process_field_charsets( $data, $GLOBALS['wpdb']->posts );
     
    604610         *
    605611         * @ticket 21212
    606612         * @depends test_process_field_charsets
     613         *
     614         * @covers wpdb::process_field_charsets
    607615         */
    608616        function test_process_field_charsets_on_nonexistent_table() {
    609617                $data = array(
     
    619627
    620628        /**
    621629         * @ticket 21212
     630         *
     631         * @covers wpdb::check_ascii
    622632         */
    623633        function test_check_ascii() {
    624634                $ascii = "\0\t\n\r '" . '!"#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
     
    627637
    628638        /**
    629639         * @ticket 21212
     640         *
     641         * @covers wpdb::check_ascii
    630642         */
    631643        function test_check_ascii_false() {
    632644                $this->assertFalse( self::$_wpdb->check_ascii( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ¡©«' ) );
     
    634646
    635647        /**
    636648         * @ticket 21212
     649         *
     650         * @covers wpdb::strip_invalid_text_for_column
    637651         */
    638652        function test_strip_invalid_text_for_column() {
    639653                global $wpdb;
     
    742756        /**
    743757         * @dataProvider data_test_get_table_charset
    744758         * @ticket 21212
     759         *
     760         * @covers wpdb::get_table_charset
    745761         */
    746762        function test_get_table_charset( $drop, $create, $table, $expected_charset ) {
    747763                self::$_wpdb->query( $drop );
     
    782798        /**
    783799         * @dataProvider data_test_get_column_charset
    784800         * @ticket 21212
     801         *
     802         * @covers wpdb::get_col_charset
    785803         */
    786804        function test_get_column_charset( $drop, $create, $table, $expected_charset ) {
    787805                self::$_wpdb->query( $drop );
     
    804822        /**
    805823         * @dataProvider data_test_get_column_charset
    806824         * @ticket 21212
     825         *
     826         * @covers wpdb::get_col_charset
    807827         */
    808828        function test_get_column_charset_non_mysql( $drop, $create, $table, $columns ) {
    809829                self::$_wpdb->query( $drop );
     
    830850        /**
    831851         * @dataProvider data_test_get_column_charset
    832852         * @ticket 33501
     853         *
     854         * @covers wpdb::get_col_charset
    833855         */
    834856        function test_get_column_charset_is_mysql_undefined( $drop, $create, $table, $columns ) {
    835857                self::$_wpdb->query( $drop );
     
    889911        /**
    890912         * @dataProvider data_strip_invalid_text_from_query
    891913         * @ticket 21212
     914         *
     915         * @covers wpdb::strip_invalid_text_from_query
    892916         */
    893917        function test_strip_invalid_text_from_query( $create, $query, $expected, $drop ) {
    894918                self::$_wpdb->query( $drop );
     
    932956        /**
    933957         * @dataProvider data_dont_strip_text_from_schema_queries
    934958         * @ticket 32104
     959         *
     960         * @covers wpdb::strip_invalid_text_from_query
    935961         */
    936962        function test_dont_strip_text_from_schema_queries( $query ) {
    937963                $return = self::$_wpdb->strip_invalid_text_from_query( $query );
     
    10101036        /**
    10111037         * @dataProvider data_table_collation_check
    10121038         * @ticket 21212
     1039         *
     1040         * @covers wpdb::check_safe_collation
    10131041         */
    10141042        function test_table_collation_check( $create, $expected, $query, $drop, $always_true ) {
    10151043                self::$_wpdb->query( $drop );
     
    10261054
    10271055                self::$_wpdb->query( $drop );
    10281056        }
    1029 
     1057       
     1058        /*
     1059        * @covers wpdb::strip_invalid_text_for_column
     1060        */
    10301061        function test_strip_invalid_text_for_column_bails_if_ascii_input_too_long() {
    10311062                global $wpdb;
    10321063
     
    10411072
    10421073        /**
    10431074         * @ticket 32279
     1075         *
     1076         * @covers wpdb::strip_invalid_text_from_query
    10441077         */
    10451078        function test_strip_invalid_text_from_query_cp1251_is_safe() {
    10461079                $tablename = 'test_cp1251_query_' . rand_str( 5 );
     
    10581091
    10591092        /**
    10601093         * @ticket 34708
     1094         *
     1095         * @covers wpdb::strip_invalid_text_from_query
    10611096         */
    10621097        function test_no_db_charset_defined() {
    10631098                $tablename = 'test_cp1251_query_' . rand_str( 5 );
     
    10801115
    10811116        /**
    10821117         * @ticket 36649
     1118         *
     1119         * @covers wpdb::set_charset
    10831120         */
    10841121        function test_set_charset_changes_the_connection_collation() {
    10851122                self::$_wpdb->set_charset( self::$_wpdb->dbh, 'utf8', 'utf8_general_ci' );
  • dependencies/jquery.php

     
    4747         * @ticket 22896
    4848         *
    4949         * @expectedIncorrectUsage wp_deregister_script
     50         *
     51         * @covers ::wp_script_is
    5052         */
    5153        function test_dont_allow_deregister_core_scripts_in_admin() {
    5254                set_current_screen( 'edit.php' );
     
    9092
    9193        /**
    9294         * @ticket 28404
     95         *
     96         * @covers ::wp_script_is
    9397         */
    9498        function test_wp_script_is_dep_enqueued() {
    9599                wp_enqueue_script( 'jquery-ui-accordion' );
  • dependencies/scripts.php

     
    3838         * Test versioning
    3939         *
    4040         * @ticket 11315
     41         *
     42         * @covers ::wp_print_scripts
    4143         */
    4244        function test_wp_enqueue_script() {
    4345                wp_enqueue_script( 'no-deps-no-version', 'example.com', array() );
     
    5961
    6062        /**
    6163         * @ticket 42804
     64         *
     65         * @covers ::wp_print_scripts
    6266         */
    6367        function test_wp_enqueue_script_with_html5_support_does_not_contain_type_attribute() {
    6468                add_theme_support( 'html5', array( 'script' ) );
     
    7983         *
    8084         * @global WP_Scripts $wp_scripts
    8185         * @ticket 16560
     86         *
     87         * @covers ::wp_enqueue_script
    8288         */
    8389        public function test_protocols() {
    8490                // Init.
     
    121127
    122128        /**
    123129         * Test script concatenation.
     130         *
     131         * @covers ::_print_scripts
    124132         */
    125133        public function test_script_concatenation() {
    126134                global $wp_scripts;
     
    145153         * Testing `wp_script_add_data` with the data key.
    146154         *
    147155         * @ticket 16024
     156         *
     157         * @covers ::wp_script_add_data
    148158         */
    149159        function test_wp_script_add_data_with_data_key() {
    150160                // Enqueue and add data.
     
    164174         * Testing `wp_script_add_data` with the conditional key.
    165175         *
    166176         * @ticket 16024
     177         *
     178         * @covers ::wp_script_add_data
    167179         */
    168180        function test_wp_script_add_data_with_conditional_key() {
    169181                // Enqueue and add conditional comments.
     
    182194         * Testing `wp_script_add_data` with both the data & conditional keys.
    183195         *
    184196         * @ticket 16024
     197         *
     198         * @covers ::wp_script_add_data
    185199         */
    186200        function test_wp_script_add_data_with_data_and_conditional_keys() {
    187201                // Enqueue and add data plus conditional comments for both.
     
    202216         * Testing `wp_script_add_data` with an anvalid key.
    203217         *
    204218         * @ticket 16024
     219         *
     220         * @covers ::wp_script_add_data
    205221         */
    206222        function test_wp_script_add_data_with_invalid_key() {
    207223                // Enqueue and add an invalid key.
     
    220236         * Testing 'wp_register_script' return boolean success/failure value.
    221237         *
    222238         * @ticket 31126
     239         *
     240         * @covers ::wp_register_script
    223241         */
    224242        function test_wp_register_script() {
    225243                $this->assertTrue( wp_register_script( 'duplicate-handler', 'http://example.com' ) );
     
    228246
    229247        /**
    230248         * @ticket 35229
     249         *
     250         * @covers ::wp_register_script
    231251         */
    232252        function test_wp_register_script_with_handle_without_source() {
    233253                $expected  = "<script type='text/javascript' src='http://example.com?ver=1' id='handle-one-js'></script>\n";
     
    244264
    245265        /**
    246266         * @ticket 35643
     267         *
     268         * @covers ::wp_register_script
    247269         */
    248270        function test_wp_enqueue_script_footer_alias() {
    249271                wp_register_script( 'foo', false, array( 'bar', 'baz' ), '1.0', true );
     
    264286         * Test mismatch of groups in dependencies outputs all scripts in right order.
    265287         *
    266288         * @ticket 35873
     289         *
     290         * @covers WP_Dependencies::add
     291         * @covers WP_Dependencies::enqueue
     292         * @covers WP_Dependencies::do_items
    267293         */
    268294        public function test_group_mismatch_in_deps() {
    269295                $scripts = new WP_Scripts;
     
    308334
    309335        /**
    310336         * @ticket 35873
     337         *
     338         * @covers ::wp_register_script
    311339         */
    312340        function test_wp_register_script_with_dependencies_in_head_and_footer() {
    313341                wp_register_script( 'parent', '/parent.js', array( 'child-head' ), null, true );            // In footer.
     
    329357
    330358        /**
    331359         * @ticket 35956
     360         *
     361         * @covers ::wp_register_script
    332362         */
    333363        function test_wp_register_script_with_dependencies_in_head_and_footer_in_reversed_order() {
    334364                wp_register_script( 'child-head', '/child-head.js', array(), null, false );                      // In head.
     
    350380
    351381        /**
    352382         * @ticket 35956
     383         *
     384         * @covers ::wp_register_script
    353385         */
    354386        function test_wp_register_script_with_dependencies_in_head_and_footer_in_reversed_order_and_two_parent_scripts() {
    355387                wp_register_script( 'grandchild-head', '/grandchild-head.js', array(), null, false );             // In head.
     
    381413
    382414        /**
    383415         * @ticket 14853
     416         *
     417         * @covers ::wp_add_inline_script
    384418         */
    385419        function test_wp_add_inline_script_returns_bool() {
    386420                $this->assertFalse( wp_add_inline_script( 'test-example', 'console.log("before");', 'before' ) );
     
    390424
    391425        /**
    392426         * @ticket 14853
     427         *
     428         * @covers ::wp_add_inline_script
    393429         */
    394430        function test_wp_add_inline_script_unknown_handle() {
    395431                $this->assertFalse( wp_add_inline_script( 'test-invalid', 'console.log("before");', 'before' ) );
     
    398434
    399435        /**
    400436         * @ticket 14853
     437         *
     438         * @covers ::wp_add_inline_script
    401439         */
    402440        function test_wp_add_inline_script_before() {
    403441                wp_enqueue_script( 'test-example', 'example.com', array(), null );
     
    411449
    412450        /**
    413451         * @ticket 14853
     452         *
     453         * @covers ::wp_add_inline_script
    414454         */
    415455        function test_wp_add_inline_script_after() {
    416456                wp_enqueue_script( 'test-example', 'example.com', array(), null );
     
    424464
    425465        /**
    426466         * @ticket 14853
     467         *
     468         * @covers ::wp_add_inline_script
    427469         */
    428470        function test_wp_add_inline_script_before_and_after() {
    429471                wp_enqueue_script( 'test-example', 'example.com', array(), null );
     
    439481
    440482        /**
    441483         * @ticket 44551
     484         *
     485         * @covers ::wp_add_inline_script
    442486         */
    443487        function test_wp_add_inline_script_before_for_handle_without_source() {
    444488                wp_register_script( 'test-example', '' );
     
    452496
    453497        /**
    454498         * @ticket 44551
     499         *
     500         * @covers ::wp_add_inline_script
    455501         */
    456502        function test_wp_add_inline_script_after_for_handle_without_source() {
    457503                wp_register_script( 'test-example', '' );
     
    465511
    466512        /**
    467513         * @ticket 44551
     514         *
     515         * @covers ::wp_add_inline_script
    468516         */
    469517        function test_wp_add_inline_script_before_and_after_for_handle_without_source() {
    470518                wp_register_script( 'test-example', '' );
     
    480528
    481529        /**
    482530         * @ticket 14853
     531         *
     532         * @covers ::wp_add_inline_script
    483533         */
    484534        function test_wp_add_inline_script_multiple() {
    485535                wp_enqueue_script( 'test-example', 'example.com', array(), null );
     
    497547
    498548        /**
    499549         * @ticket 14853
     550         *
     551         * @covers ::wp_add_inline_script
    500552         */
    501553        function test_wp_add_inline_script_localized_data_is_added_first() {
    502554                wp_enqueue_script( 'test-example', 'example.com', array(), null );
     
    514566
    515567        /**
    516568         * @ticket 14853
     569         *
     570         * @covers ::wp_add_inline_script
    517571         */
    518572        public function test_wp_add_inline_script_before_with_concat() {
    519573                global $wp_scripts;
     
    540594
    541595        /**
    542596         * @ticket 14853
     597         * @covers ::wp_add_inline_script
    543598         */
    544599        public function test_wp_add_inline_script_before_with_concat2() {
    545600                global $wp_scripts;
     
    564619
    565620        /**
    566621         * @ticket 14853
     622         *
     623         * @covers ::wp_add_inline_script
    567624         */
    568625        public function test_wp_add_inline_script_after_with_concat() {
    569626                global $wp_scripts;
     
    592649
    593650        /**
    594651         * @ticket 14853
     652         *
     653         * @covers ::wp_add_inline_script
    595654         */
    596655        public function test_wp_add_inline_script_after_and_before_with_concat_and_conditional() {
    597656                global $wp_scripts;
     
    622681
    623682        /**
    624683         * @ticket 36392
     684     *
     685         * @covers ::wp_add_inline_script
    625686         */
    626687        public function test_wp_add_inline_script_after_with_concat_and_core_dependency() {
    627688                global $wp_scripts;
     
    647708
    648709        /**
    649710         * @ticket 36392
     711         *
     712         * @covers ::wp_add_inline_script
    650713         */
    651714        public function test_wp_add_inline_script_after_with_concat_and_conditional_and_core_dependency() {
    652715                global $wp_scripts;
     
    675738
    676739        /**
    677740         * @ticket 36392
     741         *       
     742         * @covers ::wp_add_inline_script
    678743         */
    679744        public function test_wp_add_inline_script_before_with_concat_and_core_dependency() {
    680745                global $wp_scripts;
     
    701766
    702767        /**
    703768         * @ticket 36392
     769         *
     770         * @covers ::wp_add_inline_script
    704771         */
    705772        public function test_wp_add_inline_script_before_after_concat_with_core_dependency() {
    706773                global $wp_scripts;
     
    757824
    758825        /**
    759826         * @ticket 36392
     827         *
     828         * @covers ::wp_add_inline_script
    760829         */
    761830        public function test_wp_add_inline_script_customize_dependency() {
    762831                global $wp_scripts;
     
    785854
    786855        /**
    787856         * @ticket 36392
     857         *
     858         * @covers ::wp_add_inline_script
    788859         */
    789860        public function test_wp_add_inline_script_after_for_core_scripts_with_concat_is_limited_and_falls_back_to_no_concat() {
    790861                global $wp_scripts;
     
    810881
    811882        /**
    812883         * @ticket 36392
     884         *
     885         * @covers ::wp_add_inline_script
    813886         */
    814887        public function test_wp_add_inline_script_before_third_core_script_prints_two_concat_scripts() {
    815888                global $wp_scripts;
     
    834907
    835908        /**
    836909         * @ticket 45103
     910         *
     911         * @covers ::wp_set_script_translations
    837912         */
    838913        public function test_wp_set_script_translations() {
    839914                wp_register_script( 'wp-i18n', '/wp-includes/js/dist/wp-i18n.js', array(), null );
     
    861936
    862937        /**
    863938         * @ticket 45103
     939     *
     940         * @covers ::wp_set_script_translations
    864941         */
    865942        public function test_wp_set_script_translations_for_plugin() {
    866943                wp_register_script( 'wp-i18n', '/wp-includes/js/dist/wp-i18n.js', array(), null );
     
    888965
    889966        /**
    890967         * @ticket 45103
     968         *
     969         * @covers ::wp_set_script_translations
    891970         */
    892971        public function test_wp_set_script_translations_for_theme() {
    893972                wp_register_script( 'wp-i18n', '/wp-includes/js/dist/wp-i18n.js', array(), null );
     
    915994
    916995        /**
    917996         * @ticket 45103
     997         *
     998         * @covers ::wp_set_script_translations
    918999         */
    9191000        public function test_wp_set_script_translations_with_handle_file() {
    9201001                wp_register_script( 'wp-i18n', '/wp-includes/js/dist/wp-i18n.js', array(), null );
     
    9421023
    9431024        /**
    9441025         * @ticket 45103
     1026         *
     1027         * @covers ::wp_set_script_translations
    9451028         */
    9461029        public function test_wp_set_script_translations_i18n_dependency() {
    9471030                global $wp_scripts;
     
    9571040
    9581041        /**
    9591042         * @ticket 45103
     1043         *
     1044         * @covers ::wp_set_script_translations
    9601045         */
    9611046        public function test_wp_set_script_translations_when_translation_file_does_not_exist() {
    9621047                wp_register_script( 'wp-i18n', '/wp-includes/js/dist/wp-i18n.js', array(), null );
     
    9841069
    9851070        /**
    9861071         * @ticket 45103
     1072         *
     1073         * @covers ::wp_set_script_translations
    9871074         */
    9881075        public function test_wp_set_script_translations_after_register() {
    9891076                wp_register_script( 'wp-i18n', '/wp-includes/js/dist/wp-i18n.js', array(), null );
     
    10131100
    10141101        /**
    10151102         * @ticket 45103
     1103         *
     1104         * @covers ::wp_set_script_translations
    10161105         */
    10171106        public function test_wp_set_script_translations_dependency() {
    10181107                wp_register_script( 'wp-i18n', '/wp-includes/js/dist/wp-i18n.js', array(), null );
     
    14011490                        array_keys( $wp_enqueue_code_editor['htmlhint'] )
    14021491                );
    14031492        }
    1404 
     1493       
    14051494        function test_no_source_mapping() {
    14061495                $all_files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( dirname( ABSPATH ) . '/build/' ) );
    14071496                $js_files  = new RegexIterator( $all_files, '/\.js$/' );
  • dependencies/styles.php

     
    5050         * Test versioning
    5151         *
    5252         * @ticket 11315
     53         *
     54         * @covers ::wp_enqueue_style
    5355         */
    5456        function test_wp_enqueue_style() {
    5557                wp_enqueue_style( 'no-deps-no-version', 'example.com' );
     
    7173
    7274        /**
    7375         * @ticket 42804
     76         *
     77         * @covers ::wp_enqueue_style
    7478         */
    7579        function test_wp_enqueue_style_with_html5_support_does_not_contain_type_attribute() {
    7680                add_theme_support( 'html5', array( 'style' ) );
     
    9195         *
    9296         * @global WP_Styles $wp_styles
    9397         * @ticket 16560
     98         *
     99         * @covers ::wp_enqueue_style
    94100         */
    95101        public function test_protocols() {
    96102                // Init.
     
    135141         * Test if inline styles work
    136142         *
    137143         * @ticket 24813
     144         *
     145         * @covers ::wp_add_inline_style
    138146         */
    139147        public function test_inline_styles() {
    140148
     
    159167         *
    160168         * @global WP_Styles $wp_styles
    161169         * @ticket 24813
     170         *
     171         * @covers ::wp_add_inline_style
    162172         */
    163173        public function test_inline_styles_concat() {
    164174
     
    188198         * Test if multiple inline styles work
    189199         *
    190200         * @ticket 24813
     201         *
     202         * @covers ::wp_add_inline_style
    191203         */
    192204        public function test_multiple_inline_styles() {
    193205
     
    219231         *
    220232         * @expectedIncorrectUsage wp_add_inline_style
    221233         * @ticket 24813
     234         *
     235         * @covers ::wp_add_inline_style
    222236         */
    223237        public function test_plugin_doing_inline_styles_wrong() {
    224238
     
    243257         * Test to make sure <style> tags aren't output if there are no inline styles.
    244258         *
    245259         * @ticket 24813
     260         *
     261         * @covers ::wp_enqueue_style
    246262         */
    247263        public function test_unnecessary_style_tags() {
    248264
     
    257273        /**
    258274         * Test to make sure that inline styles attached to conditional
    259275         * stylesheets are also conditional.
     276         *
     277         * @covers ::wp_enqueue_style
     278         * @covers ::wp_style_add_data
     279         * @covers ::wp_add_inline_style
    260280         */
    261281        public function test_conditional_inline_styles_are_also_conditional() {
    262282                $expected = <<<CSS
     
    279299         * Testing 'wp_register_style' return boolean success/failure value.
    280300         *
    281301         * @ticket 31126
     302         *
     303         * @covers ::wp_register_style
    282304         */
    283305        function test_wp_register_style() {
    284306                $this->assertTrue( wp_register_style( 'duplicate-handler', 'http://example.com' ) );
     
    287309
    288310        /**
    289311         * @ticket 35229
     312         *
     313         * @covers ::wp_add_inline_style
    290314         */
    291315        function test_wp_add_inline_style_for_handle_without_source() {
    292316                $style = 'a { color: blue; }';
     
    310334        /**
    311335         * @ticket 35921
    312336         * @dataProvider data_styles_with_media
     337         *
     338         * @covers ::wp_enqueue_style
    313339         */
    314340        function test_wp_enqueue_style_with_media( $expected, $media ) {
    315341                wp_enqueue_style( 'handle', 'http://example.com', array(), 1, $media );
     
    349375         * Tests that visual block styles are enqueued in the editor even when there is not theme support for 'wp-block-styles'.
    350376         *
    351377         * Visual block styles should always be enqueued when editing to avoid the appearance of a broken editor.
     378         *
     379         * @covers ::wp_enqueue_style
    352380         */
    353381        function test_block_styles_for_editing_without_theme_support() {
    354382                // Confirm we are without theme support by default.
     
    365393         * Tests that visual block styles are enqueued when there is theme support for 'wp-block-styles'.
    366394         *
    367395         * Visual block styles should always be enqueued when editing to avoid the appearance of a broken editor.
     396         *
     397         * @covers ::wp_common_block_scripts_and_styles
    368398         */
    369399        function test_block_styles_for_editing_with_theme_support() {
    370400                add_theme_support( 'wp-block-styles' );
     
    381411         *
    382412         * Visual block styles should not be enqueued unless a theme opts in.
    383413         * This way we avoid style conflicts with existing themes.
     414         *
     415         * @covers ::wp_enqueue_style
    384416         */
    385417        function test_no_block_styles_for_viewing_without_theme_support() {
    386418                // Confirm we are without theme support by default.
     
    397429         * Tests that visual block styles are enqueued for viewing when there is theme support for 'wp-block-styles'.
    398430         *
    399431         * Visual block styles should be enqueued when a theme opts in.
     432         *
     433         * @covers ::wp_common_block_scripts_and_styles
    400434         */
    401435        function test_block_styles_for_viewing_with_theme_support() {
    402436                add_theme_support( 'wp-block-styles' );