Fixed issue #403 where a DateTime::createFromFormat('U.u', $microtime) w...#406
Fixed issue #403 where a DateTime::createFromFormat('U.u', $microtime) w...#406ryasmi merged 2 commits intoLearningLocker:masterfrom
Conversation
…u', $microtime) would be FALSE if microtime's subseconds were 0.
|
#403 @pondermatic thanks for the pull request! Is this only done in those two files and have you tested that this works under both normal and previously erroneous conditions. If you have tested this please describe how so that these tests can be replicated in the future and for reference. Once that's done I'll merge it and get this in for |
|
@pondermatic this appears to fail two tests. You can run these tests yourself in the terminal by running |
|
I searched and found that these two were the only places that microtime is converted to a DateTime object. To be honest, I am not currently set up to run learning locker on my development machine due to a recent rebuild. I tested this code to determine the fix: while (TRUE) {
$time = microtime(TRUE);
if ((int)$time == $time) {
var_dump(DateTime::createFromFormat('U.u', sprintf('%.4f', $time)));
}
}I will try to get set up today to run unit tests. |
Brilliant thanks 👍
Ok. Nice that seems fair enough to me.
Ok that's great! Keep me posted on your progress via this pull request if you can 😄 Thanks for taking the time to make a pull request for this issue. |
…teTime. Changed strftime() to sprintf(). Brain fart.
|
I used the correct command, sprintf, in my test code, but for some unknown idiotic reason used strftime in the code that I committed. Thanks for your help and your patience. I haven't contributed to LL since June, which was before Travis CI. Very slick! |
|
Haha brilliant! I'm glad it was something simple. Thanks for updating your pull request. No worries, you're very welcome. Thanks for the pull request. Ah right, yeah we think so too, a lot of work has gone into improving the workflow for contributors. It's great to hear your feedback. |
...ould be FALSE if microtime's subseconds were 0.