用PhpUnit测试使用DateTime对象的方法

50 阅读1分钟

当涉及到测试使用DateTime 对象的方法时,这可能有点棘手。这个例子告诉我们如何测试这样的方法。

declare(strict_types=1);
declare(strict_types=1);