/** * @dataProvider mockProvider * @param Invoice $obj */ public function testRecordPayment($obj, $mockApiContext) { $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(true)); $paymentDetail = PaymentDetailTest::getObject(); $result = $obj->recordPayment($paymentDetail, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); }