我正在使用Laravel Carbon创建一个基于时间的(时间跟踪)应用程序。我想通过将时间缩短x60来测试该应用。我正在寻找类似快速前进时间的测试环境。我希望秒数像分钟,而分钟数像小时。有没有办法在laravel中做到这一点?
答案 0 :(得分:1)
使用碳酸盐:https://github.com/kylekatarnls/carbonite
Carbonite::speed(60);
如官方Carbon文件中所建议: https://carbon.nesbot.com/docs/#api-testing