multiShippingMock = $this->createMock(\Magento\Multishipping\Model\Checkout\Type\Multishipping::class); $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->model = $objectManager->getObject( \Magento\Multishipping\Block\Checkout\Payment\Info::class, [ 'multishipping' => $this->multiShippingMock, ] ); } public function testGetPaymentInfo() { $quoteMock = $this->createMock(\Magento\Quote\Model\Quote::class); $paymentInfoMock = $this->createMock(\Magento\Payment\Model\Info::class); $this->multiShippingMock->expects($this->once())->method('getQuote')->willReturn($quoteMock); $quoteMock->expects($this->once())->method('getPayment')->willReturn($paymentInfoMock); $this->model->getPaymentInfo(); } }