public static getAllWithParams ( array $params = [], |
||
$params | array | |
$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 |
return |
public static function getAllWithParams($params = array(), $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($params, 'params');
$payLoad = "";
$allowedParams = array('anchor_type' => 1);
$json = self::executeCall("/v1/notifications/webhooks?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
$ret = new WebhookList();
$ret->fromJson($json);
return $ret;
}
/** * @dataProvider mockProvider * @param Webhook $obj */ public function testGetAll($obj, $mockApiContext) { $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(WebhookListTest::getJson())); $params = array(); $result = $obj->getAllWithParams($params, $mockApiContext, $mockPPRestCall); $this->assertNotNull($result); }