Пример #1
0
 /**
  * add a shipping
  *
  * @param array $shipping
  * @return bool
  */
 public function addShipping($shipping)
 {
     $model = new Shipping($shipping);
     if ($model->validate()) {
         $this->shipping[] = $shipping;
         return true;
     }
     $this->errors = $model->errors;
     return false;
 }
Пример #2
0
 /**
  * test whether shipping is created with given values
  */
 public function testCreate()
 {
     $model = new Shipping(['name' => 'Shipping to someone else', 'value' => 1000, 'payee_code' => 'abcdefABCDEF0123456789abcdefABCD']);
     $this->assertTrue($model->validate());
 }