的NetBeans PHPUnit的测试生成忽略@assert标注
问题描述:
我有一个抽象类,其中的源代码如下所示:的NetBeans PHPUnit的测试生成忽略@assert标注
/*
* @assert (0) == NULL
*/
public static function factory($num) {
if ($num==0)
return NULL;
//do some other stuff
}
如果我删除以前生成的测试文件,并使用“创建PHPUnit测试”,它会创建一个似乎没有新的单元测试文件所采取的断言考虑在所有:
/**
* @covers {className}::{origMethodName}
* @todo Implement testFactory().
*/
public function testFactory() {
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
我必须做一些愚蠢的,但我想不出什么。是否在生成的@covers注释中扩展类名称和方法名称可能是一条线索?
我在使用PHP 5.3.6和PHPUnit 3.6.2的Mac上运行NetBeans 7.0.1。
答
所有注释必须出现在以/**
开头的DocBlock注释中,而不是/*
。你错过了一个星号。
/**
* @assert (0) == NULL
*/
public static function factory($num) {