如何隐藏cakephp日志在控制台结果phpunit


How to hide cakephp log in console result phpunit?

当phpunit在控制台上运行单元测试时,它总是显示我在logfile中输入的消息:下面是我要测试的示例文件:

Sample.php

public funtion testThis() {
    CakeLog::write('error', "This is a test");
}

那么当我在控制台运行

$ ./Console/cake test app

我将得到这样的结果:
PHPUnit 3.7.38 by Sebastian Bergmann.
............This is a test..........50/50 (100%)

您需要检查配置/配置日志记录器。我的猜测是,它没有地方写,所以使用STDOUTSTDERR输出。

尝试从这里设置说明(选择合适的Cake版本)