Make WordPress Core


Ignore:
Timestamp:
08/31/2020 10:49:18 PM (6 years ago)
Author:
desrosj
Message:

Tests: Move the tests for get_the_modified_time() to a more appropriate place.

Add some new tests to better cover the functionality, for consistency with get_the_date() and get_the_time().

Follow-up to [48911], [48912], [48918].

Props wittich.
Merges [48924] to the 5.5 branch.
Fixes #51184.

Location:
branches/5.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.5

  • branches/5.5/tests/phpunit/tests/date/getTheDate.php

    r48921 r48926  
    1111         * @ticket 13771
    1212         */
    13         function test_get_the_date_returns_correct_time_with_post_id() {
     13        public function test_get_the_date_returns_correct_time_with_post_id() {
    1414                $post_id = self::factory()->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
    1515
     
    2020         * @ticket 28310
    2121         */
    22         function test_get_the_date_returns_false_with_null_or_non_existing_post() {
     22        public function test_get_the_date_returns_false_with_null_or_non_existing_post() {
    2323                $this->assertFalse( get_the_date() );
    2424                $this->assertFalse( get_the_date( 'F j, Y h:i:s' ) );
     
    3030         * @ticket 51184
    3131         */
    32         function test_get_the_date_returns_correct_time_with_empty_format() {
     32        public function test_get_the_date_returns_correct_time_with_empty_format() {
    3333                $post_id = self::factory()->post->create( array( 'post_date' => '2020-08-29 01:51:00' ) );
    3434
     
    4040         * @ticket 28310
    4141         */
    42         function test_get_the_time_returns_correct_time_with_post_id() {
     42        public function test_get_the_time_returns_correct_time_with_post_id() {
    4343                $post_id = self::factory()->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
    4444
     
    4949         * @ticket 28310
    5050         */
    51         function test_get_the_time_returns_false_with_null_or_non_existing_post() {
     51        public function test_get_the_time_returns_false_with_null_or_non_existing_post() {
    5252                $this->assertFalse( get_the_time() );
    5353                $this->assertFalse( get_the_time( 'h:i:s' ) );
     
    5959         * @ticket 51184
    6060         */
    61         function test_get_the_time_returns_correct_time_with_empty_format() {
     61        public function test_get_the_time_returns_correct_time_with_empty_format() {
    6262                $post_id = self::factory()->post->create( array( 'post_date' => '2020-08-29 01:51:00' ) );
    6363
Note: See TracChangeset for help on using the changeset viewer.