| | 878 | * @ticket 28310 |
| | 879 | */ |
| | 880 | function test_get_the_date_returns_false_with_null_post() { |
| | 881 | $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() { |
| | 888 | $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() { |
| | 895 | $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() { |
| | 902 | $this->assertFalse( get_the_date( 'F j, Y h:i:s', 9 ) ); |
| | 903 | } |
| | 904 | |
| | 905 | /** |
| | 906 | * @ticket 28310 |
| | 907 | */ |
| | 908 | function test_get_the_time_with_id_returns_correct_time() { |
| | 909 | $post_id = $this->factory->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) ); |
| | 910 | $this->assertEquals( '16:35:00', get_the_time( 'H:i:s', $post_id ) ); |
| | 911 | } |
| | 912 | |
| | 913 | /** |
| | 914 | * @ticket 28310 |
| | 915 | */ |
| | 916 | function test_get_the_time_returns_false_with_null_post() { |
| | 917 | $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() { |
| | 924 | $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() { |
| | 931 | $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() { |
| | 938 | $this->assertFalse( get_the_time( 'h:i:s', 9 ) ); |
| | 939 | } |
| | 940 | |
| | 941 | /** |
| | 942 | * @ticket 28310 |
| | 943 | */ |
| | 944 | function test_get_post_time_with_id_returns_correct_time() { |
| | 945 | $post_id = $this->factory->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) ); |
| | 946 | $this->assertEquals( '16:35:00', get_post_time( 'H:i:s', false, $post_id ) ); |
| | 947 | } |
| | 948 | |
| | 949 | /** |
| | 950 | * @ticket 28310 |
| | 951 | */ |
| | 952 | function test_get_post_time_returns_false_with_null_post() { |
| | 953 | $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() { |
| | 960 | $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() { |
| | 967 | $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() { |
| | 974 | $this->assertFalse( get_post_time( 'h:i:s', false, 9 ) ); |
| | 975 | } |
| | 976 | |
| | 977 | /** |
| | 978 | * @ticket 28310 |
| | 979 | */ |
| | 980 | function test_get_post_modified_time_with_id_returns_correct_time() { |
| | 981 | $post_id = $this->factory->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) ); |
| | 982 | $this->assertEquals( '16:35:00', get_post_modified_time( 'H:i:s', false, $post_id ) ); |
| | 983 | } |
| | 984 | |
| | 985 | /** |
| | 986 | * @ticket 28310 |
| | 987 | */ |
| | 988 | function test_get_post_modified_time_returns_false_with_null_post() { |
| | 989 | $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() { |
| | 996 | $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() { |
| | 1003 | $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() { |
| | 1010 | $this->assertFalse( get_post_modified_time( 'h:i:s', false, 9 ) ); |
| | 1011 | } |
| | 1012 | |
| | 1013 | /** |
| | 1014 | * @ticket 28310 |
| | 1015 | */ |
| | 1016 | function test_mysql2date_returns_false_with_no_date() { |
| | 1017 | $this->assertFalse( mysql2date( 'F j, Y H:i:s', '' ) ); |
| | 1018 | } |
| | 1019 | |
| | 1020 | /** |
| | 1021 | * @ticket 28310 |
| | 1022 | */ |
| | 1023 | function test_mysql2date_returns_gmt_unix_timestamp() { |
| | 1024 | $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() { |
| | 1031 | $this->assertEquals( '441013392', mysql2date( 'U', '1983-12-23 07:43:12' ) ); |
| | 1032 | } |
| | 1033 | |
| | 1034 | /** |