Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在执行控制器测试方法并运行调度方法时,我发现它与输出相呼应,
如何捕获该输出而不是将其打印到命令行?
您可以在 PHPUnit 中使用内置支持:http: //phpunit.de/manual/current/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.output
从提到输出缓冲的旧答案编辑。