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)); }