Make WordPress Core


Ignore:
Timestamp:
08/31/2020 03:33:45 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Tests: Bring some consistency to Date/Time tests:

  • Move some tests from post.php to a more appropriate location in the date directory.
  • Rename date/postTime.php to date/getPostTime.php to match the function name.

Props Rarst.
See #51184.

File:
1 edited

Legend:

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

    r47118 r48911  
    1212
    1313        parent::tearDown();
     14    }
     15
     16    /**
     17     * @ticket 28310
     18     */
     19    function test_mysql2date_returns_false_with_no_date() {
     20        $this->assertFalse( mysql2date( 'F j, Y H:i:s', '' ) );
     21    }
     22
     23    /**
     24     * @ticket 28310
     25     */
     26    function test_mysql2date_returns_gmt_or_unix_timestamp() {
     27        $this->assertEquals( '441013392', mysql2date( 'G', '1983-12-23 07:43:12' ) );
     28        $this->assertEquals( '441013392', mysql2date( 'U', '1983-12-23 07:43:12' ) );
    1429    }
    1530
Note: See TracChangeset for help on using the changeset viewer.