User tests: Successful: Unsuccessful:
JHtmlDate::relative()
will compare a time against "now" if a comparison time is not injected, however previously this would test against a JDate
object pulled from the JFactory::$dates
cache which could cause minor unexpected results on a long running process (specifically if comparing a time under a minute in difference, see the now uncommented unit test case). The method will now always use a new JDate
instance for "now" instead of pulling a potentially cached object.
JHtmlDateTest
is improved by:
JDate
instances instead of polluting the global cache by calling JFactory::getDate()
JHtml::_()
method resolver (causes additional unneeded code to be ran and tested)The return values for JHtmlDate::relative()
will return as compared to when the method is triggered. No longer does it compare against the time the "now" object was stored to JFactory::$dates
. This may cause a difference of seconds on some comparisons, this would be especially noticeable in a longer running process.
N/A
Status | New | ⇒ | Pending |
Labels |
Added:
?
?
|
Category | ⇒ | Libraries Unit Tests |
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-28 00:22:08 |
Closed_By | ⇒ | wilsonge |