phpunit 9 不打印错误堆栈跟踪

时间:2021-02-02 06:40:58

标签: phpunit

我最近将我的单元测试环境从 phpunit v8.5.13 更新到了 v9.5.1。相同的配置文件,相同的php版本,除了命令行中的php单元phar文件外都相同。

一切正常,但当出现意外异常时,不再打印堆栈跟踪(直到 v8):

PHPUnit 9.5.1 by Sebastian Bergmann and contributors.

E

Time: 00:00.973, Memory: 42.00 MB

There was 1 error:

1) moduleTmEmployeeTest::testAdd with data set "default" (array(), array())
mobEx: this is my exception

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

phpunit 8

PHPUnit 8.5.13 by Sebastian Bergmann and contributors.

E

Time: 1.36 seconds, Memory: 36.00 MB

There was 1 error:

1) moduleTmEmployeeTest::testAdd with data set "default" (array(), array())
mobEx: this is my exception

[path]\unittests\phpunit\tm\moduleTmEmployeeTest.php:54

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

我查看了文档和迁移指南,但不知道要设置哪个新标志或我还能做什么。有人知道吗?

1 个答案:

答案 0 :(得分:1)

正如@sebastian 在他的评论中所引用的,这是当前版本 v9.5.2 中修复的一个错误。