phpunit 9 不打印错误堆栈跟踪
phpunit 9 does not print error stack trace
我最近将单元测试环境从 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.
php单元 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.
我查看了文档和迁移指南,但不知道要设置哪个新标志或我还能做什么。有人知道吗?
正如@sebastian 在他的评论中所提到的,这是一个在当前版本 v9.5.2 中修复的错误。
我最近将单元测试环境从 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.
php单元 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.
我查看了文档和迁移指南,但不知道要设置哪个新标志或我还能做什么。有人知道吗?
正如@sebastian 在他的评论中所提到的,这是一个在当前版本 v9.5.2 中修复的错误。