将PHPUnit测试类标记为被忽略 [英] Mark a PHPUnit test class as to be ignored

查看:62
本文介绍了将PHPUnit测试类标记为被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了一个抽象的测试用例类,该类将通过具体的测试用例类进行扩展.

I have written an abstract test case class that is to be extended by concrete test case classes.

它是从 PHPUnit_TestCase 扩展的.

是否存在一种方法或注释,指示Phpunit不执行此抽象测试(但不会将其标记为已跳过或未完成)?

Is there a method or annotation that signals Phpunit to not execute this abstract test (but does not mark it as skipped or incomplete)?

现在,Phpunit也运行抽象测试类,然后报告一个无法实例化它的错误-这是通过语言得出的:无法实例化抽象类.

Right now Phpunit runs the abstract test class as well and then reports an error that it can not instantiate it - which is by language: An abstract class can not be instantiated.

推荐答案

如果命名为FooTest,则将其重命名为FooTestCase.

If it is named FooTest rename it to FooTestCase.

这篇关于将PHPUnit测试类标记为被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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