Make WordPress Core

Changeset 29351


Ignore:
Timestamp:
08/01/2014 09:06:49 PM (12 years ago)
Author:
SergeyBiryukov
Message:

Consolidate some of the test functions added in [29344].

see #28310.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post.php

    r29344 r29351  
    870870         * @ticket 13771
    871871         */
    872         function test_get_the_date_with_id() {
     872        function test_get_the_date_with_id_returns_correct_time() {
    873873                $post_id = $this->factory->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
    874874                $this->assertEquals( 'March 1, 2014', get_the_date( 'F j, Y', $post_id ) );
    … …  
    878878         * @ticket 28310
    879879         */
    880         function test_get_the_date_returns_false_with_null_post() {
     880        function test_get_the_date_returns_false_with_null_or_non_existing_post() {
    881881                $this->assertFalse( get_the_date() );
    882         }
    883 
    884         /**
    885          * @ticket 28310
    886          */
    887         function test_get_the_date_returns_false_with_format_and_null_post() {
    888882                $this->assertFalse( get_the_date( 'F j, Y h:i:s' ) );
    889         }
    890 
    891         /**
    892          * @ticket 28310
    893          */
    894         function test_get_the_date_returns_false_with_post_that_is_not_found() {
    895883                $this->assertFalse( get_the_date( '', 9 ) );
    896         }
    897 
    898         /**
    899          * @ticket 28310
    900          */
    901         function test_get_the_date_returns_false_with_format_and_post_that_is_not_found() {
    902884                $this->assertFalse( get_the_date( 'F j, Y h:i:s', 9 ) );
    903885        }
    … …  
    914896         * @ticket 28310
    915897         */
    916         function test_get_the_time_returns_false_with_null_post() {
     898        function test_get_the_time_returns_false_with_null_or_non_existing_post() {
    917899                $this->assertFalse( get_the_time() );
    918         }
    919 
    920         /**
    921          * @ticket 28310
    922          */
    923         function test_get_the_time_returns_false_with_format_and_null_post() {
    924900                $this->assertFalse( get_the_time( 'h:i:s' ) );
    925         }
    926 
    927         /**
    928          * @ticket 28310
    929          */
    930         function test_get_the_time_returns_false_with_post_that_is_not_found() {
    931901                $this->assertFalse( get_the_time( '', 9 ) );
    932         }
    933 
    934         /**
    935          * @ticket 28310
    936          */
    937         function test_get_the_time_returns_false_with_format_and_post_that_is_not_found() {
    938902                $this->assertFalse( get_the_time( 'h:i:s', 9 ) );
    939903        }
    … …  
    950914         * @ticket 28310
    951915         */
    952         function test_get_post_time_returns_false_with_null_post() {
     916        function test_get_post_time_returns_false_with_null_or_non_existing_post() {
    953917                $this->assertFalse( get_post_time() );
    954         }
    955 
    956         /**
    957          * @ticket 28310
    958          */
    959         function test_get_post_time_returns_false_with_format_and_null_post() {
    960918                $this->assertFalse( get_post_time( 'h:i:s' ) );
    961         }
    962 
    963         /**
    964          * @ticket 28310
    965          */
    966         function test_get_post_time_returns_false_with_post_that_is_not_found() {
    967919                $this->assertFalse( get_post_time( '', false, 9 ) );
    968         }
    969 
    970         /**
    971          * @ticket 28310
    972          */
    973         function test_get_post_time_returns_false_with_format_and_post_that_is_not_found() {
    974920                $this->assertFalse( get_post_time( 'h:i:s', false, 9 ) );
    975921        }
    … …  
    986932         * @ticket 28310
    987933         */
    988         function test_get_post_modified_time_returns_false_with_null_post() {
     934        function test_get_post_modified_time_returns_false_with_null_or_non_existing_post() {
    989935                $this->assertFalse( get_post_modified_time() );
    990         }
    991 
    992         /**
    993          * @ticket 28310
    994          */
    995         function test_get_post_modified_time_returns_false_with_format_and_null_post() {
    996936                $this->assertFalse( get_post_modified_time( 'h:i:s' ) );
    997         }
    998 
    999         /**
    1000          * @ticket 28310
    1001          */
    1002         function test_get_post_modified_time_returns_false_with_post_that_is_not_found() {
    1003937                $this->assertFalse( get_post_modified_time( '', false, 9 ) );
    1004         }
    1005 
    1006         /**
    1007          * @ticket 28310
    1008          */
    1009         function test_get_post_modified_time_returns_false_with_format_and_post_that_is_not_found() {
    1010938                $this->assertFalse( get_post_modified_time( 'h:i:s', false, 9 ) );
    1011939        }
    … …  
    1021949         * @ticket 28310
    1022950         */
    1023         function test_mysql2date_returns_gmt_unix_timestamp() {
     951        function test_mysql2date_returns_gmt_or_unix_timestamp() {
    1024952                $this->assertEquals( '441013392', mysql2date( 'G', '1983-12-23 07:43:12' ) );
    1025         }
    1026 
    1027         /**
    1028          * @ticket 28310
    1029          */
    1030         function test_mysql2date_returns_unix_timestamp() {
    1031953                $this->assertEquals( '441013392', mysql2date( 'U', '1983-12-23 07:43:12' ) );
    1032954        }
Note: See TracChangeset for help on using the changeset viewer.