Example #1
0
 public function testSuccess()
 {
     $payuplOrderId = 'ABC';
     $orderId = 1;
     $resultRedirect = $this->getRedirectMock('orba_payupl/payment/repeat_start');
     $this->resultRedirectFactory->expects($this->once())->method('create')->willReturn($resultRedirect);
     $request = $this->getMockBuilder(\Magento\Framework\App\RequestInterface::class)->getMockForAbstractClass();
     $request->expects($this->once())->method('getParam')->with('id')->willReturn($payuplOrderId);
     $this->context->expects($this->once())->method('getRequest')->willReturn($request);
     $this->paymentHelper->expects($this->once())->method('getOrderIdIfCanRepeat')->with($payuplOrderId)->willReturn($orderId);
     $this->session->expects($this->once())->method('setLastOrderId')->with($orderId);
     $this->assertEquals($resultRedirect, $this->controller->execute());
 }