- Timestamp:
- 02/24/2017 06:14:21 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase-rest-post-type-controller.php
r40080 r40108 11 11 $this->assertEquals( get_permalink( $post->ID ), $data['link'] ); 12 12 if ( '0000-00-00 00:00:00' === $post->post_date_gmt ) { 13 $this->assertNull( $data['date_gmt'] ); 13 $post_date_gmt = date( 'Y-m-d H:i:s', strtotime( $post->post_date ) - ( get_option( 'gmt_offset' ) * 3600 ) ); 14 $this->assertEquals( mysql_to_rfc3339( $post_date_gmt ), $data['date_gmt'] ); 15 } else { 16 $this->assertEquals( mysql_to_rfc3339( $post->post_date_gmt ), $data['date_gmt'] ); 14 17 } 15 18 $this->assertEquals( mysql_to_rfc3339( $post->post_date ), $data['date'] ); 16 19 17 20 if ( '0000-00-00 00:00:00' === $post->post_modified_gmt ) { 18 $this->assertNull( $data['modified_gmt'] ); 21 $post_modified_gmt = date( 'Y-m-d H:i:s', strtotime( $post->post_modified ) - ( get_option( 'gmt_offset' ) * 3600 ) ); 22 $this->assertEquals( mysql_to_rfc3339( $post_modified_gmt ), $data['modified_gmt'] ); 23 } else { 24 $this->assertEquals( mysql_to_rfc3339( $post->post_modified_gmt ), $data['modified_gmt'] ); 19 25 } 20 26 $this->assertEquals( mysql_to_rfc3339( $post->post_modified ), $data['modified'] ); … … 140 146 if ( 'edit' === $context ) { 141 147 $this->assertEquals( $post->guid, $data['guid']['raw'] ); 142 143 if ( '0000-00-00 00:00:00' === $post->post_date_gmt ) {144 $this->assertNull( $data['date_gmt'] );145 } else {146 $this->assertEquals( mysql_to_rfc3339( $post->post_date_gmt ), $data['date_gmt'] );147 }148 149 if ( '0000-00-00 00:00:00' === $post->post_modified_gmt ) {150 $this->assertNull( $data['modified_gmt'] );151 } else {152 $this->assertEquals( mysql_to_rfc3339( $post->post_modified_gmt ), $data['modified_gmt'] );153 }154 148 } 155 149
Note: See TracChangeset
for help on using the changeset viewer.