如何从PHP Artisan测试中捕获文件中的输出?
当我运行PHP Artisan Test
时,我想保存所有输出测试生成的生成在文件中。我尝试做PHP Artisan测试2> te.txt 1> to.txt
。但是文件是空的。我在做什么错?
我还尝试了PHP手工测试| Tee Test.txt
或php工匠测试> test.txt
。他们俩都不起作用。
When I run php artisan test
, I want to save all the output test generates in a file. I tried doing php artisan test 2> te.txt 1> to.txt
. But the files are empty. What am I doing wrong?
I also tried php artisan test | tee test.txt
or php artisan test > test.txt
. Both of them doesn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了使其正常工作,
您需要无关的选项:
但是请注意,它将填充有颜色代码,例如:
为了正确显示它,您需要猫文件。
For it to work,
you need the without-tty option :
but be aware that it will be filled with color codes, like :
so to display it correctly you will need to cat the file
您可以使用此语法用控制台输出填充文件
you can use this syntax to fill the file with console output