September 4th, 2007 at 11:57 pm by Nio
PHPUnit 支持的 group 测试
via TestNG-style Grouping of Tests
从 PHPUnit 3.2 开始,支持像 TestNG 那样的 group 测试了,使用非常简单,只需要加上 @group 即可。
<?php
class TestTest extends PHPUnit_Framework_TestCase
{
/**
* @group a
*/
public function testOne()
{
}
/**
* @group a
* @group b
*/
public function testTwo()
{
}
}
?>
使用 –group 选项运行 group 测试:
# phpunit –group a TestTest
PHPUnit 3.2.0-dev by Sebastian Bergmann.
..
Time: 0 seconds
OK (2 tests)
# phpunit –group b TestTest
PHPUnit 3.2.0-dev by Sebastian Bergmann.
.
Time: 0 seconds
OK (1 test)