コード例 #1
0
 public function testCreateGood()
 {
     //simulate form input
     $post = ['oGoods' => ['GoodsShortDescription' => 'Test Goods Short Description', 'GoodsDescription' => 'Full text Goods Description', 'GoodsQuantity' => '100', 'MeasureUnitQualifierCode' => '796', 'MeasureUnitQualifierCost' => '10', 'Price' => '10', 'Cost' => '9.8', 'GoodsTNVEDCode' => '8467211000', 'GoodsAddTNVEDCode' => '0000', 'CurrencyCode' => 'USD', 'PlacesQuantity' => '56', 'Length' => '1000', 'Width' => '15000', 'Height' => '23000', 'PackingCode' => 'CT', 'Manufacturer' => 'SHENZHEN YOYI TOOLS INDUSTRY CO., LTD', 'TradeMark' => 'noname', 'GoodsMark' => '37', 'GoodsModel' => 'X7', 'GoodsMarking' => '00-37-445', 'DateIssue' => date('Y-m-d'), 'SerialNumber' => '00011111122', 'goodsArticul' => '213-000037', 'Favorite' => '1']];
     $good = new oGoods();
     $this->assertTrue($good->load($post), 'Load good POST data');
     $this->assertTrue($good->validate(), 'Validate good');
     $this->assertTrue($good->save(), 'Create good');
     return $good;
 }
コード例 #2
0
 public function getGoods()
 {
     return $this->embeddedMany(oGoods::className(), 'goods');
 }