/** * test compare two items first without options and second with options */ public function testCompareItemWithoutOptionWithCompared() { $this->itemMock->expects($this->any())->method('getProductId')->will($this->returnValue(1)); $this->comparedMock->expects($this->any())->method('getProductId')->will($this->returnValue(1)); $this->comparedMock->expects($this->any())->method('getOptions')->will($this->returnValue([$this->getOptionMock('option-1', 1), $this->getOptionMock('option-2', 'option-value'), $this->getOptionMock('option-3', serialize(['value' => 'value-1', 'qty' => 2]))])); $this->itemMock->expects($this->any())->method('getOptions')->will($this->returnValue([])); $this->assertFalse($this->helper->compare($this->itemMock, $this->comparedMock)); }
/** * Compare items * * @param \Magento\Sales\Model\Quote\Item $item * @return bool */ public function compare($item) { return $this->_compareHelper->compare($this, $item); }