lundi 27 avril 2015

How can I write unittest in this specific scenario? Or is it a bad unittest?

I have two date variables like below:

$startDate = new \DateTime('2013-01-01');
$endDate = new \DateTime()->format(\DateTime::ISO8601);

If I count the difference between two dates, on every different day the difference will be different.So, I can't use any constant number to assert the difference is correct but my test should make sure that at any given time the difference between those two dates are perfect!

How can I acieve that? Any comments or suggestions would be really beneficial! Cheers!

Aucun commentaire:

Enregistrer un commentaire