Make WordPress Core


Ignore:
Timestamp:
01/28/2020 12:51:42 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Disable WPCS warnings for date_default_timezone_set() and current_time( 'timestamp' ) calls in Date/Time tests.

These calls are intentional and required for the tests.

See #49222.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/date/getPermalink.php

    r46795 r47118  
    1111        delete_option( 'permalink_structure' );
    1212        update_option( 'timezone_string', 'UTC' );
     13        // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set
    1314        date_default_timezone_set( 'UTC' );
    1415
     
    2324        update_option( 'timezone_string', $timezone );
    2425        update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%hour%/%minute%/%second%' );
     26        // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set
    2527        date_default_timezone_set( 'UTC' );
    2628
     
    3436        $this->assertEquals( 'http://example.org/2018/07/22/21/13/23', get_permalink( $post_id ) );
    3537
     38        // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set
    3639        date_default_timezone_set( $timezone );
    3740        $this->assertEquals( 'http://example.org/2018/07/22/21/13/23', get_permalink( $post_id ) );
Note: See TracChangeset for help on using the changeset viewer.