PHPunit - 错误 [英] PHPunit - Errors

查看:20
本文介绍了PHPunit - 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当发生 PHPunit 框架不希望发生的错误时,测试停止,PHP 抛出错误,但 PHPunit 不会记录这是一个错误.如何确保 PHPunit 将其记录为错误.

When an error that the PHPunit framework does not expect to occur happens, the testing stops, and PHP throws the error, but PHPunit does not record that it was an error. How do I make sure PHPunit records it as an error.

推荐答案

免责声明,我是 PHPUnit 的新手,我也想弄清楚发生错误时会发生什么".

来自 PHPUnit 的文档:

当测试代码包含 PHP 语法错误时,TextUI 测试运行器可能会退出而不打印错误信息.标准测试套件加载器可以选择检查测试套件源文件是否存在 PHP 语法错误,但不能检查测试套件源文件包含的源文件.

When the tested code contains PHP syntax errors, the TextUI test runner might exit without printing error information. The standard test suite loader can optionally check the test suite sourcefile for PHP syntax errors, but not sourcefiles included by the test suite sourcefile.

还有选项:

--syntax-check           Try to check source files for syntax errors.

这篇关于PHPunit - 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆