protected function getPayments() { $this->orderDataMock->expects($this->any())->method('getPayments')->will($this->returnValue($this->orderData['payments'])); $payment = $this->getMock('Magento\\Sales\\Model\\Order\\Payment', [], [], '', false); $this->paymentConverterMock->expects($this->at(0))->method('getModel')->with($this->orderData['payments'][0])->will($this->returnValue($payment)); return [$payment]; }
/** * Get Order Payments * * @param OrderData $dataObject * @return array */ protected function getPayments(OrderData $dataObject) { $payments = []; foreach ($dataObject->getPayments() as $payment) { $payments[] = $this->paymentConverter->getModel($payment); } return $payments; }