Changeset 50284 for trunk/tests/phpunit/tests/post.php
- Timestamp:
- 02/10/2021 01:24:24 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post.php
r50012 r50284 1412 1412 $post = get_post( $post_id ); 1413 1413 $this->assertEqualsWithDelta( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date ), 2, 'The dates should be equal' ); 1414 $this->assert Equals( '0000-00-00 00:00:00', $post->post_date_gmt );1414 $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt ); 1415 1415 1416 1416 $post_id = self::factory()->post->create( … … 1422 1422 $post = get_post( $post_id ); 1423 1423 $this->assertEqualsWithDelta( strtotime( gmdate( 'Y-m-d H:i:s' ) ), strtotime( $post->post_date ), 2, 'The dates should be equal' ); 1424 $this->assert Equals( '0000-00-00 00:00:00', $post->post_date_gmt );1424 $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt ); 1425 1425 1426 1426 // Empty post_date_gmt without floating status … … 1451 1451 ); 1452 1452 $post = get_post( $post_id ); 1453 $this->assert Equals( get_date_from_gmt( $post_date_gmt ), $post->post_date );1454 $this->assert Equals( $post_date_gmt, $post->post_date_gmt );1453 $this->assertSame( get_date_from_gmt( $post_date_gmt ), $post->post_date ); 1454 $this->assertSame( $post_date_gmt, $post->post_date_gmt ); 1455 1455 1456 1456 // Invalid post_date_gmt … … 1461 1461 ); 1462 1462 $post = get_post( $post_id ); 1463 $this->assert Equals( '1970-01-01 00:00:00', $post->post_date );1464 $this->assert Equals( '0000-00-00 00:00:00', $post->post_date_gmt );1463 $this->assertSame( '1970-01-01 00:00:00', $post->post_date ); 1464 $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt ); 1465 1465 } 1466 1466 … … 1481 1481 ); 1482 1482 $post = get_post( $post_id ); 1483 $this->assert Equals( $post_date, $post->post_date );1484 $this->assert Equals( '0000-00-00 00:00:00', $post->post_date_gmt );1483 $this->assertSame( $post_date, $post->post_date ); 1484 $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt ); 1485 1485 1486 1486 $post_id = self::factory()->post->create( … … 1492 1492 ); 1493 1493 $post = get_post( $post_id ); 1494 $this->assert Equals( $post_date, $post->post_date );1495 $this->assert Equals( '0000-00-00 00:00:00', $post->post_date_gmt );1494 $this->assertSame( $post_date, $post->post_date ); 1495 $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt ); 1496 1496 1497 1497 // Empty post_date_gmt without floating status … … 1503 1503 ); 1504 1504 $post = get_post( $post_id ); 1505 $this->assert Equals( $post_date, $post->post_date );1506 $this->assert Equals( get_gmt_from_date( $post_date ), $post->post_date_gmt );1505 $this->assertSame( $post_date, $post->post_date ); 1506 $this->assertSame( get_gmt_from_date( $post_date ), $post->post_date_gmt ); 1507 1507 1508 1508 $post_id = self::factory()->post->create( … … 1514 1514 ); 1515 1515 $post = get_post( $post_id ); 1516 $this->assert Equals( $post_date, $post->post_date );1517 $this->assert Equals( get_gmt_from_date( $post_date ), $post->post_date_gmt );1516 $this->assertSame( $post_date, $post->post_date ); 1517 $this->assertSame( get_gmt_from_date( $post_date ), $post->post_date_gmt ); 1518 1518 1519 1519 // Valid post_date_gmt … … 1525 1525 ); 1526 1526 $post = get_post( $post_id ); 1527 $this->assert Equals( $post_date, $post->post_date );1528 $this->assert Equals( $post_date_gmt, $post->post_date_gmt );1527 $this->assertSame( $post_date, $post->post_date ); 1528 $this->assertSame( $post_date_gmt, $post->post_date_gmt ); 1529 1529 1530 1530 // Invalid post_date_gmt … … 1536 1536 ); 1537 1537 $post = get_post( $post_id ); 1538 $this->assert Equals( $post_date, $post->post_date );1539 $this->assert Equals( '0000-00-00 00:00:00', $post->post_date_gmt );1538 $this->assertSame( $post_date, $post->post_date ); 1539 $this->assertSame( '0000-00-00 00:00:00', $post->post_date_gmt ); 1540 1540 } 1541 1541 … … 1555 1555 ) 1556 1556 ); 1557 $this->assert Equals( 0, $post_id );1557 $this->assertSame( 0, $post_id ); 1558 1558 1559 1559 $post_id = self::factory()->post->create( … … 1564 1564 ) 1565 1565 ); 1566 $this->assert Equals( 0, $post_id );1566 $this->assertSame( 0, $post_id ); 1567 1567 1568 1568 // Empty post_date_gmt without floating status … … 1573 1573 ) 1574 1574 ); 1575 $this->assert Equals( 0, $post_id );1575 $this->assertSame( 0, $post_id ); 1576 1576 1577 1577 $post_id = self::factory()->post->create( … … 1582 1582 ) 1583 1583 ); 1584 $this->assert Equals( 0, $post_id );1584 $this->assertSame( 0, $post_id ); 1585 1585 1586 1586 // Valid post_date_gmt … … 1591 1591 ) 1592 1592 ); 1593 $this->assert Equals( 0, $post_id );1593 $this->assertSame( 0, $post_id ); 1594 1594 1595 1595 // Invalid post_date_gmt … … 1600 1600 ) 1601 1601 ); 1602 $this->assert Equals( 0, $post_id );1602 $this->assertSame( 0, $post_id ); 1603 1603 } 1604 1604 … … 1615 1615 1616 1616 $resolved_post_date = wp_resolve_post_date( '', $post_date_gmt ); 1617 $this->assert Equals( get_date_from_gmt( $post_date_gmt ), $resolved_post_date );1617 $this->assertSame( get_date_from_gmt( $post_date_gmt ), $resolved_post_date ); 1618 1618 1619 1619 $resolved_post_date = wp_resolve_post_date( '', $invalid_date ); 1620 $this->assert Equals( '1970-01-01 00:00:00', $resolved_post_date );1620 $this->assertSame( '1970-01-01 00:00:00', $resolved_post_date ); 1621 1621 1622 1622 $resolved_post_date = wp_resolve_post_date( $post_date ); 1623 $this->assert Equals( $post_date, $resolved_post_date );1623 $this->assertSame( $post_date, $resolved_post_date ); 1624 1624 1625 1625 $resolved_post_date = wp_resolve_post_date( $post_date, $post_date_gmt ); 1626 $this->assert Equals( $post_date, $resolved_post_date );1626 $this->assertSame( $post_date, $resolved_post_date ); 1627 1627 1628 1628 $resolved_post_date = wp_resolve_post_date( $post_date, $invalid_date ); 1629 $this->assert Equals( $post_date, $resolved_post_date );1629 $this->assertSame( $post_date, $resolved_post_date ); 1630 1630 1631 1631 $resolved_post_date = wp_resolve_post_date( $invalid_date );
Note: See TracChangeset
for help on using the changeset viewer.