使用PHPUnit群
如何在PHPUnit中配置测试组?我觉得这些文件有点欠缺。。。它只是说使用PHPUnit群,php,unit-testing,phpunit,Php,Unit Testing,Phpunit,如何在PHPUnit中配置测试组?我觉得这些文件有点欠缺。。。它只是说 元素及其 ,和 子项可用于选择组 一组测试中的测试 应该(不)运行 名称 名称 但是如何将目录/文件添加到这些组中?将添加到测试方法中。链接文档中的一个简单示例: class MyTest extends PHPUnit_Framework_TestCase { /** * @group specification */ public function testSomething()
元素及其
,
和
子项可用于选择组
一组测试中的测试
应该(不)运行
名称
名称
但是如何将目录/文件添加到这些组中?将添加到测试方法中。链接文档中的一个简单示例:
class MyTest extends PHPUnit_Framework_TestCase
{
/**
* @group specification
*/
public function testSomething()
{
}
/**
* @group regresssion
* @group bug2204
*/
public function testSomethingElse()
{
}
}
然后可以运行上面文档中提到的PHPUnit:
{how you normally run phpunit} --group {GroupName}
或者您可以按需排除测试组,如下所示:
phpunit--exclude group regression
。
{how you normally run phpunit} --group {GroupName}