如何从Zend Controller测试调度方法捕获输出



在执行控制器测试方法时,运行调度方法我发现它与输出相呼应,

如何捕获该输出而不是将其打印到命令行?

您可以在phpunit中使用内置支持:http://phpunit.de/manual/manual/current/current/en/writing-tests-for-phpunit.html#writing-writing-tests-for-for-phpunit.output


从旧答案中进行了编辑,提及输出缓冲。

最新更新