public function update($apiContext = null, $restCall = null) { ArgumentValidator::validate($this->getId(), "Id"); $payLoad = $this->toJSON(); $json = self::executeCall("/v1/invoicing/invoices/{$this->getId()}", "PUT", $payLoad, null, $apiContext, $restCall); $this->fromJson($json); return $this; }
/** * @dataProvider mockProvider * @param Invoice $obj */ public function testUpdate($obj, $mockApiContext) { $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(self::getJson())); $result = $obj->update($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); }