public function testGetSelectionQtyIfCustomOptionIsNotSet() { $selectionId = 15; $product = $this->getMock('Magento\\Catalog\\Model\\Product', [], [], '', false); $product->expects($this->once())->method('getCustomOption')->with('selection_qty_' . $selectionId)->will($this->returnValue(null)); $this->assertEquals(0, $this->helper->getSelectionQty($product, $selectionId)); }
/** * Get selection quantity * * @param int $selectionId * @return float */ protected function _getSelectionQty($selectionId) { return $this->_configurationHelper->getSelectionQty($this->getProduct(), $selectionId); }