Changeset 47118
- Timestamp:
- 01/28/2020 12:51:42 AM (5 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/date/currentTime.php
r47081 r47118 44 44 $wp_timestamp = $timestamp + 6 * HOUR_IN_SECONDS; 45 45 46 // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.RequestedUTC 46 47 $this->assertEquals( $timestamp, current_time( 'timestamp', true ), 'The dates should be equal', 2 ); 48 // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested 47 49 $this->assertEquals( $wp_timestamp, current_time( 'timestamp' ), 'The dates should be equal', 2 ); 48 50 } … … 57 59 $datetime = new DateTime( 'now', new DateTimeZone( $timezone_string ) ); 58 60 61 // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set 59 62 date_default_timezone_set( $timezone_string ); 60 63 … … 62 65 $current_time_custom_timezone = current_time( $format ); 63 66 67 // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set 64 68 date_default_timezone_set( 'UTC' ); 65 69 … … 84 88 $wp_timestamp = $timestamp + $datetime->getOffset(); 85 89 90 // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.RequestedUTC 86 91 $this->assertEquals( $timestamp, current_time( 'timestamp', true ), 'The dates should be equal', 2 ); 92 // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.RequestedUTC 87 93 $this->assertEquals( $timestamp, current_time( 'U', true ), 'The dates should be equal', 2 ); 88 94 95 // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested 89 96 $this->assertEquals( $wp_timestamp, current_time( 'timestamp' ), 'The dates should be equal', 2 ); 97 // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested 90 98 $this->assertEquals( $wp_timestamp, current_time( 'U' ), 'The dates should be equal', 2 ); 91 99 100 // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested 92 101 $this->assertInternalType( 'int', current_time( 'timestamp' ) ); 93 102 } -
trunk/tests/phpunit/tests/date/getPermalink.php
r46795 r47118 11 11 delete_option( 'permalink_structure' ); 12 12 update_option( 'timezone_string', 'UTC' ); 13 // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set 13 14 date_default_timezone_set( 'UTC' ); 14 15 … … 23 24 update_option( 'timezone_string', $timezone ); 24 25 update_option( 'permalink_structure', '/%year%/%monthnum%/%day%/%hour%/%minute%/%second%' ); 26 // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set 25 27 date_default_timezone_set( 'UTC' ); 26 28 … … 34 36 $this->assertEquals( 'http://example.org/2018/07/22/21/13/23', get_permalink( $post_id ) ); 35 37 38 // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set 36 39 date_default_timezone_set( $timezone ); 37 40 $this->assertEquals( 'http://example.org/2018/07/22/21/13/23', get_permalink( $post_id ) ); -
trunk/tests/phpunit/tests/date/mysql2date.php
r46586 r47118 8 8 9 9 function tearDown() { 10 // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set 10 11 date_default_timezone_set( 'UTC' ); 11 12 … … 32 33 function test_mysql2date_should_format_time_with_changed_time_zone() { 33 34 $timezone = 'Europe/Kiev'; 35 // phpcs:ignore WordPress.DateTime.RestrictedFunctions.timezone_change_date_default_timezone_set 34 36 date_default_timezone_set( $timezone ); 35 37 update_option( 'timezone_string', $timezone ); -
trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php
r46657 r47118 999 999 'id', 1000 1000 $this->factory->category->create( 1001 [1001 array( 1002 1002 'parent' => $old_parent_term->term_id, 1003 ]1003 ) 1004 1004 ), 1005 1005 'category'
Note: See TracChangeset
for help on using the changeset viewer.