public update ( |
||
$patchRequest | ||
$apiContext | is the APIContext for this call. It can be used to pass dynamic configuration and credentials. | |
$restCall | PayPalRestCall | is the Rest Call Service that is used to make rest calls |
리턴 |
public function update($patchRequest, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($this->getId(), "Id");
ArgumentValidator::validate($patchRequest, 'patchRequest');
$payLoad = $patchRequest->toJSON();
$json = self::executeCall("/v1/notifications/webhooks/{$this->getId()}", "PATCH", $payLoad, null, $apiContext, $restCall);
$this->fromJson($json);
return $this;
}
/** * @dataProvider mockProvider * @param Webhook $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())); $patchRequest = PatchRequestTest::getObject(); $result = $obj->update($patchRequest, $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); }