public static get ( string $eventId, |
||
$eventId | string | |
$apiContext | is the APIContext for this call. It can be used to pass dynamic configuration and credentials. | |
$restCall | is the Rest Call Service that is used to make rest calls | |
return |
public static function get($eventId, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($eventId, 'eventId');
$payLoad = "";
$json = self::executeCall("/v1/notifications/webhooks-events/{$eventId}", "GET", $payLoad, null, $apiContext, $restCall);
$ret = new WebhookEvent();
$ret->fromJson($json);
return $ret;
}
/** * @dataProvider mockProvider * @param WebhookEvent $obj */ public function testGet($obj, $mockApiContext) { $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(WebhookEventTest::getJson())); $result = $obj->get("eventId", $mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); }