public function setUp() { parent::setUp(); // create a product without attributes $this->product = Product::getNewInstance($this->category, 'test'); $this->product->setValueByLang("name", "en", "TEST_PRODUCT"); $this->product->save(); $this->productAutoIncrementNumber = $this->product->getID(); for ($k = 1; $k < 4; $k++) { $currency = Currency::getNewInstance($k . 'zz'); $currency->save(); } }
public function setUp() { parent::setUp(); // create a new category $this->productCategory = Category::getNewInstance(Category::getRootNode()); $this->productCategory->setValueByLang("name", "en", "Demo category branch"); $this->productCategory->save(); // create a product without attributes $this->product = Product::getNewInstance($this->productCategory, 'test'); $this->product->setValueByLang("name", "en", "Test product..."); $this->product->setValueByLang("name", "lt", "Bandomasis produktas"); $this->product->setFieldValue("isEnabled", true); $this->product->save(); $this->usd = ActiveRecordModel::getNewInstance('Currency'); $this->usd->setID('ZZZ'); $this->usd->save(ActiveRecord::PERFORM_INSERT); }