首页 > 解决方案 > phpUnit: Stop on Notice

问题描述

how can I make phpUnit to stop on any notices like this:

Notice: Undefined property: _global::$tra in 
/Applications/MAMP/htdocs/sakkadentrainer/classes/_global.php on line 1684
✔ Check if trainer chooser popup works [569.58 ms]

This Test passed, even-though I got some errors.

In the phpUnit Doc I cant find something like

--stop-on-error

https://phpunit.de/manual/6.5/en/textui.html

Thanks!

标签: phpphpunit

解决方案


phpUnit 选项beStrictAboutOutputDuringTests="true" (--disallow-test-output)有帮助。这样测试仍然通过,但我得到了一个“有风险的”测试输出。


推荐阅读