Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHPUnit群_Php_Unit Testing_Phpunit - Fatal编程技术网

使用PHPUnit群

使用PHPUnit群,php,unit-testing,phpunit,Php,Unit Testing,Phpunit,如何在PHPUnit中配置测试组?我觉得这些文件有点欠缺。。。它只是说 元素及其 ,和 子项可用于选择组 一组测试中的测试 应该(不)运行 名称 名称 但是如何将目录/文件添加到这些组中?将添加到测试方法中。链接文档中的一个简单示例: class MyTest extends PHPUnit_Framework_TestCase { /** * @group specification */ public function testSomething()

如何在PHPUnit中配置测试组?我觉得这些文件有点欠缺。。。它只是说

元素及其
子项可用于选择组 一组测试中的测试 应该(不)运行


名称
名称
但是如何将目录/文件添加到这些组中?

将添加到测试方法中。链接文档中的一个简单示例:

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}