Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
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();
 }