gpt4 book ai didi

PHPUnit 问题 - 没有错误消息

转载 作者:行者123 更新时间:2023-12-01 19:22:21 24 4
gpt4 key购买 nike

我已经尝试解决这个问题很长一段时间了。

我有一个简单的 PHPUnit 测试用例,有 2 个测试。当我运行它时,我得到以下输出:

PHPUnit 3.5.14 by Sebastian Bergmann.

.

因此第一个断言运行并通过。然而,第二个断言会导致一些 PHP 错误(异常或其他),并且 PHPUnit 就死掉了,没有任何关于可能出现问题的信息。

这是我的 phpunit.xml:

<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
syntaxCheck="false"
bootstrap="bootstrap.php.cache"
>
<testsuites>
<testsuite name="Portal Test Suite">
<directory>../src/OneSolution/Portal/*Bundle/Tests</directory>
</testsuite>
</testsuites>
</phpunit>

设置syntaxChecktrue没有提供有关该错误的任何附加信息。但是,它确实打印了两次(在运行任何测试之前) The filename, directory name, or volume label syntax is incorrect.

<强>???

那么,有谁知道我可以做什么来让 PHPUnit 报告这些错误消息(--verbose 选项也没有帮助)?

编辑:我已经找出导致测试失败的原因。方法名称输入错误(我猜我太依赖代码辅助了)。然而,这并没有解决主要问题。 PHPUnit 不会报告任何警告、错误或异常

最佳答案

好的,如果有人无法从 PHPUnit 命令行获取任何输出或不完整的输出,请仔细检查您的 php.ini 配置指令:

  • error_reporting - 应设置为 E_ALL | E_STRICT 适用于您的开发环境
  • display_errors - 应设置为On

关于PHPUnit 问题 - 没有错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6378845/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com