public function setUp()
 {
     parent::setUp();
     ActiveRecordModel::executeUpdate('DELETE FROM EavField');
     ActiveRecordModel::executeUpdate('DELETE FROM EavObject');
     ActiveRecordModel::executeUpdate('DELETE FROM Manufacturer');
 }
Example #2
0
 public function setUp()
 {
     parent::setUp();
     ActiveRecord::clearPool();
     ActiveRecord::executeUpdate('DELETE FROM Tax');
     ActiveRecord::executeUpdate('DELETE FROM TaxRate');
     ActiveRecord::executeUpdate('DELETE FROM DeliveryZone');
     ActiveRecord::executeUpdate('DELETE FROM Currency');
     ActiveRecord::executeUpdate('DELETE FROM ShippingService');
     ActiveRecord::executeUpdate('DELETE FROM DeliveryZone');
     ActiveRecord::executeUpdate('DELETE FROM TaxClass');
     $this->deliveryZone = DeliveryZone::getNewInstance();
     $this->deliveryZone->setValueByLang('name', 'en', 'test zone');
     $this->deliveryZone->isEnabled->set(true);
     $this->deliveryZone->save();
     DeliveryZoneCountry::getNewInstance($this->deliveryZone, 'US')->save();
     $this->tax = Tax::getNewInstance('test type');
     $this->tax->save();
     $this->currency = ActiveRecord::getInstanceByIdIfExists('Currency', 'USD');
     $this->currency->isEnabled->set(true);
     $this->currency->decimalCount->set(2);
     $this->currency->save();
     $this->product = Product::getNewInstance(Category::getRootNode());
     $this->product->setPrice('USD', 100);
     $this->product->isEnabled->set(true);
     $this->product->save();
     $this->user = User::getNewInstance('*****@*****.**');
     $this->user->save();
     $this->address = UserAddress::getNewInstance();
     $this->address->countryID->set('US');
     $this->address->save();
     $this->getApplication()->getConfig()->setRuntime('DELIVERY_TAX_CLASS', null);
 }
 public function setUp()
 {
     parent::setUp();
     BusinessRuleController::clearCache();
     ActiveRecord::executeUpdate('DELETE FROM DeliveryZone');
     ActiveRecord::executeUpdate('DELETE FROM Tax');
     ActiveRecord::executeUpdate('DELETE FROM TaxRate');
     ActiveRecord::executeUpdate('DELETE FROM DiscountCondition');
     ActiveRecord::executeUpdate('DELETE FROM DiscountAction');
     ActiveRecord::executeUpdate('DELETE FROM Currency');
     $this->root = DiscountCondition::getRootNode();
     $this->usd = ActiveRecordModel::getInstanceByIDIfExists('Currency', 'USD');
     $this->usd->save();
     $this->user = User::getNewInstance('discount.condition@test');
     $this->user->save();
     $this->order = CustomerOrder::getNewInstance($this->user);
     $this->order->currency->set($this->usd);
     $this->order->save(true);
     $this->product1 = Product::getNewInstance(Category::getRootNode());
     $this->product1->isEnabled->set(true);
     $this->product1->setPrice('USD', 10);
     $this->product1->save();
     $this->product2 = Product::getNewInstance(Category::getRootNode());
     $this->product2->isEnabled->set(true);
     $this->product2->setPrice('USD', 20);
     $this->product2->save();
     ActiveRecordModel::getApplication()->getConfig()->setRuntime('INVENTORY_TRACKING', 'DISABLE');
 }
Example #4
0
 public function setUp()
 {
     parent::setUp();
     $this->deliveryZone = DeliveryZone::getNewInstance();
     $this->deliveryZone->name->set('test zone');
     $this->deliveryZone->save();
 }
 public function setUp()
 {
     parent::setUp();
     $this->controller = new EavFieldController(self::getApplication());
     ActiveRecordModel::executeUpdate('DELETE FROM EavField');
     ActiveRecordModel::executeUpdate('DELETE FROM EavFieldGroup');
 }
Example #6
0
 public function setUp()
 {
     parent::setUp();
     ActiveRecordModel::executeUpdate('DELETE FROM ClonedStore');
     $this->usd = ActiveRecordModel::getNewInstance('Currency');
     $this->usd->setID('ZZZ');
     $this->usd->save(ActiveRecord::PERFORM_INSERT);
     @unlink(ClonedStoreUpdater::getTimestampFile());
     @unlink(ClonedStoreUpdater::getIDFile());
     // create stores
     for ($k = 0; $k <= 0; $k++) {
         $this->stores[$k] = ClonedStore::getNewInstance();
         $this->stores[$k]->domain->set($k);
         $this->stores[$k]->save();
         echo $this->stores[$k]->lastImport->get();
     }
     // create categories
     $root = Category::getRootNode();
     for ($k = 0; $k <= 5; $k++) {
         $this->categories[] = $this->createCategory($root, $k);
     }
     $this->categories['1.1'] = $this->createCategory($this->categories[1], '1.1');
     $this->categories['1.2'] = $this->createCategory($this->categories[1], '1.2');
     $this->categories['1.2.1'] = $this->createCategory($this->categories['1.2'], '1.2.1');
     $this->categories['1.2.2'] = $this->createCategory($this->categories['1.2'], '1.2.2');
     usleep(1500000);
 }
 public function tearDown()
 {
     parent::tearDown();
     $dir = ClassLoader::getRealPath('storage.customize.view.theme.sometheme');
     if (file_exists($dir)) {
         rmdir($dir);
     }
 }
Example #8
0
 public function setUp()
 {
     parent::setUp();
     $this->product = Product::getNewInstance(Category::getRootNode(), 'test');
     $this->product->save();
     $this->user = User::getNewInstance('*****@*****.**');
     $this->user->save();
 }
Example #9
0
 public function setUp()
 {
     parent::setUp();
     $this->controller = new OrderController(self::getApplication());
     $this->initOrder();
     $this->controller->setOrder($this->order);
     $this->controller->setUser($this->user);
 }
Example #10
0
 public function setUp()
 {
     parent::setUp();
     $this->deliveryZone = DeliveryZone::getNewInstance();
     $this->deliveryZone->setValueByLang('name', 'en', 'test zone');
     $this->deliveryZone->isEnabled->set(true);
     $this->deliveryZone->save();
 }
Example #11
0
 public function setUp()
 {
     parent::setUp();
     $this->root = Category::getRootNode();
     $this->container = Product::getNewInstance($this->root);
     $this->container->type->set(Product::TYPE_BUNDLE);
     $this->container->save();
 }
 public function setUp()
 {
     parent::setUp();
     $this->role = Role::getNewInstance('__testrole__');
     $this->role->save();
     $this->userGroup = UserGroup::getNewInstance('Any random group name');
     $this->userGroup->save();
 }
Example #13
0
 public function setUp()
 {
     parent::setUp();
     ActiveRecordModel::executeUpdate('DELETE FROM EavField');
     $this->controller = new UserController(self::getApplication());
     $this->initOrder();
     $this->controller->setOrder($this->order);
     $this->controller->setUser($this->user);
 }
 public function setUp()
 {
     parent::setUp();
     $this->zone = DeliveryZone::getNewInstance();
     $this->zone->name->set(':TEST_ZONE');
     $this->zone->isEnabled->set(1);
     $this->zone->isFreeShipping->set(1);
     $this->zone->save();
 }
Example #15
0
 public function setUp()
 {
     parent::setUp();
     $this->deliveryZone = DeliveryZone::getNewInstance();
     $this->deliveryZone->name->set('test zone');
     $this->deliveryZone->save();
     $this->shippingService = ShippingService::getNewInstance($this->deliveryZone, 'test category', ShippingService::SUBTOTAL_BASED);
     $this->shippingService->save();
 }
Example #16
0
 public function setUp()
 {
     parent::setUp();
     $this->product = Product::getNewInstance($this->rootCategory, 'test');
     $this->product->save();
     $this->group = ProductFileGroup::getNewInstance($this->product);
     $this->group->save();
     // create temporary file
     file_put_contents($this->tmpFilePath, $this->fileBody);
 }
 public function setUp()
 {
     parent::setUp();
     // Create some product
     $this->product = Product::getNewInstance($this->rootCategory, 'test');
     $this->product->save();
     return;
     // create new group
     $dump = ProductRelationshipGroup::getNewInstance($this->product);
     $dump->save();
 }
Example #18
0
 public function setUp()
 {
     parent::setUp();
     $this->specField = SpecField::getNewInstance($this->rootCategory, SpecField::DATATYPE_TEXT, SpecField::TYPE_TEXT_SELECTOR);
     $this->specField->save();
     $this->specFieldAutoIncrementNumber = $this->specField->getID();
     $specFieldValue = SpecFieldValue::getNewInstance($this->specField);
     $specFieldValue->save();
     $this->specFieldValueAutoIncrementNumber = $specFieldValue->getID();
     $this->product = Product::getNewInstance($this->rootCategory, 'test');
     $this->product->save();
     $this->productAutoIncrementNumber = $this->product->getID();
 }
Example #19
0
 public function setUp()
 {
     parent::setUp();
     ActiveRecordModel::executeUpdate('DELETE FROM ProductRatingType');
     $this->controller = new ProductController(self::getApplication());
     $this->product = Product::getNewInstance(Category::getRootNode());
     $this->product->isEnabled->set(true);
     $this->product->save();
     $this->request->set('id', $this->product->getID());
     self::getApplication()->getConfig()->set('ENABLE_REVIEWS', true);
     self::getApplication()->getConfig()->set('ENABLE_ANONYMOUS_RATINGS', true);
     self::getApplication()->getConfig()->set('REVIEWS_WITH_RATINGS', false);
 }
Example #20
0
 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();
     }
 }
Example #21
0
 public function setUp()
 {
     parent::setUp();
     ActiveRecordModel::executeUpdate('DELETE FROM Tax');
     ActiveRecordModel::executeUpdate('DELETE FROM TaxRate');
     ActiveRecordModel::executeUpdate('DELETE FROM Currency');
     ActiveRecordModel::executeUpdate('DELETE FROM DiscountCondition');
     ActiveRecordModel::executeUpdate('DELETE FROM DiscountAction');
     ActiveRecordModel::executeUpdate('DELETE FROM DeliveryZone');
     ActiveRecordModel::executeUpdate('DELETE FROM ShippingService');
     BusinessRuleController::clearCache();
     $this->initOrder();
     $this->config->setRuntime('DELIVERY_TAX', '');
 }
Example #22
0
 public function setUp()
 {
     parent::setUp();
     $this->product = Product::getNewInstance(Category::getRootNode(), 'test');
     $this->product->save();
     $this->option = ProductOption::getNewInstance($this->product);
     $this->option->type->set(ProductOption::TYPE_SELECT);
     $this->option->save();
     for ($k = 0; $k <= 1; $k++) {
         $choice = ProductOptionChoice::getNewInstance($this->option);
         $choice->priceDiff->set(10 + $k);
         $choice->save();
         $this->choices[] = $choice;
     }
 }
Example #23
0
 public function setUp()
 {
     parent::setUp();
     Category::recalculateProductsCount();
     $this->root = Category::getNewInstance(Category::getRootNode());
     $this->root->save();
     for ($k = 1; $k <= 2; $k++) {
         $cat = Category::getNewInstance($this->root);
         $cat->save();
         $this->categories[$k] = $cat;
     }
     $this->product = Product::getNewInstance($this->categories[1]);
     $this->product->save();
     $this->secondCategory = ProductCategory::getNewInstance($this->product, $this->categories[2]);
     $this->secondCategory->save();
 }
 public function setUp()
 {
     parent::setUp();
     // Create some product
     $this->product1 = Product::getNewInstance($this->rootCategory, 'test');
     $this->product1->save();
     $this->productAutoIncrementNumber = $this->product1->getID();
     // Create second product
     $this->product2 = Product::getNewInstance($this->rootCategory, 'test');
     $this->product2->save();
     // create new group
     $this->group = ProductRelationshipGroup::getNewInstance($this->product1, ProductRelationship::TYPE_CROSS);
     $this->group->position->set(5);
     $this->group->save();
     $this->groupAutoIncrementNumber = $this->group->getID();
 }
Example #25
0
 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);
 }
 public function setUp()
 {
     parent::setUp();
     $this->controller = new SpecFieldController(self::getApplication());
 }
Example #27
0
 public function __construct()
 {
     parent::__construct('Test active record model');
 }
Example #28
0
 public function setUp()
 {
     parent::setUp();
     $this->product = Product::getNewInstance($this->rootCategory, 'test');
     $this->product->save();
 }
Example #29
0
 public function __construct()
 {
     parent::__construct('user group tests');
 }
Example #30
0
 public function setUp()
 {
     parent::setUp();
     $this->root = Category::getInstanceByID(ActiveTreeNode::ROOT_ID, true);
 }