如何跳过PHPunit中的测试? [英] How to skip tests in PHPunit?

查看:79
本文介绍了如何跳过PHPunit中的测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将phpunit与jenkins结合使用,并且我想通过在XML文件phpunit.xml

I am using phpunit in connection with jenkins, and I want to skip certain tests by setting the configuration in the XML file phpunit.xml

我知道我可以在命令行上使用

I know that I can use on the command line:

phpunit --filter testStuffThatBrokeAndIOnlyWantToRunThatOneSingleTest

由于<filters>标签仅用于代码覆盖,我如何将其转换为XML文件?

how do I translate that to the XML file since the <filters> tag is only for code-coverage?

除了testStuffThatAlwaysBreaks

推荐答案

跳过已损坏或您以后需要继续进行的测试的最快,最简单的方法是,将以下内容添加到各个单元的顶部测试:

The fastest and easiest way to skip tests that are either broken or you need to continue working on later is to just add the following to the top of your individual unit test:

$this->markTestSkipped('must be revisited.');

这篇关于如何跳过PHPunit中的测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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