gpt4 book ai didi

php - 什么是 .phpunit.result.cache

转载 作者:行者123 更新时间:2023-12-02 04:50:58 25 4
gpt4 key购买 nike

当我在为 Laravel 创建的新包上使用 PhpUnit 运行测试时,它会生成文件 .phpunit.result.cache

那该怎么办?我是否将其添加到我的 .gitignore 文件中?

我使用的是 PHPUnit 8.0.4

最佳答案

此文件可帮助 PHPUnit 记住之前失败的测试,如果您仅在开发期间重新运行失败的测试,这可以加快测试流程。这对于测试驱动的工作流程非常有用,在该工作流程中您已将测试配置为自动运行(例如在文件保存时),并且重复运行相同的测试集合。

It is also a good idea to add the cache file .phpunit.result.cache toyour .gitignore so that it does not end up being committed to yourrepository.

https://laravel-news.com/tips-to-speed-up-phpunit-tests

如果您不想生成文件,那么您可以使用 --do-not-cache-result 选项运行 phpunit,正如 @Slack Undertow 在评论中指出的那样。例如,当将测试作为构建管道的一部分运行时,这可能是需要的。或者,正如 @codekandis 指出的,相同的选项可用作 phpunit.xml 中的 cacheResult 属性。

关于php - 什么是 .phpunit.result.cache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55091768/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com