作为基础,我使用 \Codeception\TestCase\Test 类。
我注意到,对于类中定义的每个 test* 方法,codeception 都会重新创建 TestCase\Test 类!
But Why?
结果我不能使用类字段!
public function getName() {
if (!empty($this->_name)) {
return $this->_name;
} else $this->_name = uniqid('_name');
}
每个测试方法的 getName() 都会返回新生成的名称..这对我来说是错误的行为。如果我想为每个测试方法使用类字段,就像在普通的 OOP 中一样,是否可以解决这种情况?
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)