public function create($apiContext = null, $restCall = null) { $payLoad = $this->toJSON(); $json = self::executeCall("/v1/notifications/webhooks", "POST", $payLoad, null, $apiContext, $restCall); $this->fromJson($json); return $this; }
/** * @dataProvider mockProvider * @param Webhook $obj */ public function testCreate($obj, $mockApiContext) { $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock(); $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(self::getJson())); $result = $obj->create($mockApiContext, $mockPayPalRestCall); $this->assertNotNull($result); }