public function testGetShippingAddressTotalsWithNotBillingAddress() { $totalMock = $this->getMock('\\Magento\\Sales\\Model\\Order\\Total', ['getCode', 'setTitle', '__wakeup'], [], '', false); $this->addressMock->expects($this->once())->method('getTotals')->willReturn([$totalMock]); $totalMock->expects($this->once())->method('getCode')->willReturn('grand_total'); $this->addressMock->expects($this->once())->method('getAddressType')->willReturn('not billing'); $totalMock->expects($this->once())->method('setTitle')->with('Total for this address'); $this->assertEquals([$totalMock], $this->model->getShippingAddressTotals($this->addressMock)); }
public function testGetRowItemHtml() { /** @var $item \Magento\Quote\Model\Quote\Item */ $item = $this->_objectManager->create('Magento\\Quote\\Model\\Quote\\Item'); /** @var $product \Magento\Catalog\Model\Product */ $product = $this->_objectManager->create('Magento\\Catalog\\Model\\Product'); $product->load(1); $item->setProduct($product); /** @var $quote \Magento\Quote\Model\Quote */ $quote = $this->_objectManager->create('Magento\\Quote\\Model\\Quote'); $item->setQuote($quote); // assure that default renderer was obtained $this->assertSelectCount('.product.name a', 1, $this->_block->getRowItemHtml($item)); }