为什么Codeception为每个Test*方法创建新的\测试实例?

为什么Codeception为每个Test*方法创建新的\测试实例?,codeception,Codeception,作为基础,我使用\Codeception\TestCase\Test类 我注意到,对于类中定义的每个test*方法,codeception都会重新创建TestCase\test类 但是为什么呢 因此,我不能使用类字段 public function getName() { if (!empty($this->_name)) { return $this->_name; } else $this->_name = uniqid('_name');

作为基础,我使用\Codeception\TestCase\Test类

我注意到,对于类中定义的每个test*方法,codeception都会重新创建TestCase\test类

但是为什么呢

因此,我不能使用类字段

public function getName() {
    if (!empty($this->_name)) {
        return $this->_name;
    } else $this->_name = uniqid('_name');
}
每个测试方法的getName()将返回新生成的名称。。对我来说,那是错误的行为。如果我想为每个测试方法使用类字段,就像在普通的OOP中一样,那么有可能解决这种情况吗