多次调用设置函数。我只需要执行一次。我是phpunit的新手,任何人都可以为此提供解决方案。我需要在此文件中执行4个测试,并且我需要使用相同的变量名
class XSCBookModelTest extends TestCase
{
public $categoryID;
public $categoryName = "Motivations";
public $parentID = 0;
protected function setUp()
{
$this->XSCBooksModelObj = new XSCBooksModel();
$categoryObjModel = new XSCCategoryModel();
$this->categoryID = $categoryObjModel->AddCategory($this->categoryName, $this->parentID);
$this->setup = 0;
$this->assertNotEquals($this->categoryID, 0);
}