PHPunit-错误 [英] PHPunit - Errors

查看:65
本文介绍了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天全站免登陆