Changeset 46280
- Timestamp:
- 09/23/2019 09:17:04 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r46272 r46280 4414 4414 } 4415 4415 4416 /** 4417 * @ticket 39953 4418 */ 4416 4419 public function test_putting_same_publish_date_does_not_remove_floating_date() { 4417 4420 … … 4441 4444 $body = $response->get_data(); 4442 4445 4443 $this->assertEquals( $get_body['date'], $body['date']);4444 $this->assertEquals( $get_body['date_gmt'], $body['date_gmt']);4446 $this->assertEquals( strtotime( $get_body['date'] ), strtotime( $body['date'] ), 'The dates should be equal', 2 ); 4447 $this->assertEquals( strtotime( $get_body['date_gmt'] ), strtotime( $body['date_gmt'] ), 'The dates should be equal', 2 ); 4445 4448 4446 4449 $this->assertEquals( '0000-00-00 00:00:00', get_post( $post->ID )->post_date_gmt ); 4447 4450 } 4448 4451 4452 /** 4453 * @ticket 39953 4454 */ 4449 4455 public function test_putting_different_publish_date_removes_floating_date() { 4450 4456 … … 4482 4488 $body = $response->get_data(); 4483 4489 4484 $this->assertEquals( mysql_to_rfc3339( $new_time ), $body['date']);4490 $this->assertEquals( strtotime( mysql_to_rfc3339( $new_time ) ), strtotime( $body['date'] ), 'The dates should be equal', 2 ); 4485 4491 4486 4492 $this->assertNotEquals( '0000-00-00 00:00:00', get_post( $post->ID )->post_date_gmt ); 4487 4493 } 4488 4494 4495 /** 4496 * @ticket 39953 4497 */ 4489 4498 public function test_publishing_post_with_same_date_removes_floating_date() { 4490 4499 … … 4521 4530 $body = $response->get_data(); 4522 4531 4523 $this->assertEquals( $get_body['date'], $body['date']);4524 $this->assertEquals( $get_body['date_gmt'], $body['date_gmt']);4532 $this->assertEquals( strtotime( $get_body['date'] ), strtotime( $body['date'] ), 'The dates should be equal', 2 ); 4533 $this->assertEquals( strtotime( $get_body['date_gmt'] ), strtotime( $body['date_gmt'] ), 'The dates should be equal', 2 ); 4525 4534 4526 4535 $this->assertNotEquals( '0000-00-00 00:00:00', get_post( $post->ID )->post_date_gmt );
Note: See TracChangeset
for help on using the changeset viewer.