【发布时间】:2015-03-03 23:36:07
【问题描述】:
我正在尝试使用 PHPUnit 在 Zend Framework 1 上运行测试。我可以运行测试,但它给了我错误:
$ ./library/bin/phpunit tests/application/controllers/IndexControllerTest.php
PHPUnit 3.7.27 by Sebastian Bergmann.
Configuration read from /var/www/vhosts/qasystem/qasystem/phpunit.xml
F
Time: 3.38 seconds, Memory: 15.75Mb
There was 1 failure:
1) IndexControllerTest::testIndexAction
Failed asserting last controller used <"error"> was "index"
/var/www/vhosts/qasystem/qasystem/library/zendframework/zendframework1/library/Zend/Test/PHPUnit/ControllerTestCase.php:1000
/var/www/vhosts/qasystem/qasystem/tests/application/controllers/IndexControllerTest.php:18
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
如果它抛出错误,我如何查看错误是什么?我已将 application.ini 设置为
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
...对于那个环境。如果这是一个浏览器,我将能够看到屏幕上的错误/异常。无论如何在 CLI 中查看 PHPUnit 中的错误是什么?谢谢
【问题讨论】:
标签: php zend-framework phpunit