[wp-trac] [WordPress Trac] #34378: unit tests for the current_time() in functions.php

WordPress Trac noreply at wordpress.org
Thu Jan 16 06:06:11 UTC 2020


#34378: unit tests for the current_time() in functions.php
-------------------------+---------------------
 Reporter:  pbearne      |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  5.4
Component:  Date/Time    |     Version:  4.4
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:
-------------------------+---------------------
Changes (by talldanwp):

 * keywords:  has-unit-tests has-patch => needs-patch
 * component:  General => Date/Time
 * milestone:   => 5.4


Comment:

 Hi @pbearne, thanks so much for working on this! Tests are always welcome.

 I applied the patch and ran the tests, and it looks like there's one
 failing test:

 {{{
 1) Tests_Functions_current_time::test_current_time_pass_random_String
 Random_String passed
 Failed asserting that two strings are equal.
 --- Expected
 +++ Actual
 @@ @@
 -'Ram116202001_th31Thu, 16 Jan 2020 05:53:23 +00005315_pam2323UTC16'
 +'Ram116202001_th31Thu, 16 Jan 2020 05:53:23 +00005315_pam2323+00:0016'
 }}}

 This would need to be addressed. A couple of other points looking at code
 consistency:
 - Most other test filenames are camelCased instead of kebab-cased.
 - The documentation at the top of the file seems to be the docs for the
 function. I don't think this is needed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/34378#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list