/** * @param int $qtyValue * @param string $qtyValueType * @param int $qty * @param bool $isQtyDecimal * @param double $expectedQty * * @dataProvider calculateProductQtyProvider */ public function testCalculateQty($qtyValue, $qtyValueType, $qty, $isQtyDecimal, $expectedQty) { $this->_object = new Public_Xcom_Listing_Model_Listing(); $this->_object->setData('qty_value', $qtyValue); $this->_object->setData('qty_value_type', $qtyValueType); $this->_productOne->getStockItem()->setQty($qty); $this->_productOne->getStockItem()->setIsQtyDecimal($isQtyDecimal); $actualQuantity = $this->_object->calculateQty($this->_productOne); $this->assertEquals($expectedQty, $actualQuantity); }
public function testValidateFieldsMagentoTypePrice() { $listing = new Xcom_Listing_Model_Listing($this->_prepareValidationData()); $listing->setPriceType('magentoprice'); $listing->setPriceValue(null); $this->_object->setListing($listing); $this->_object->validateFields(); }