From fb92d8d666cd1d943e78adcc7705cde45f1b341c Mon Sep 17 00:00:00 2001 From: Jay Patel Date: Thu, 23 Mar 2017 15:09:55 -0500 Subject: [PATCH] Add test for verifyWebhookSignature --- tests/PayPal/Test/Api/VerifyWebhookSignatureTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/PayPal/Test/Api/VerifyWebhookSignatureTest.php b/tests/PayPal/Test/Api/VerifyWebhookSignatureTest.php index 48ae40a..a422faa 100644 --- a/tests/PayPal/Test/Api/VerifyWebhookSignatureTest.php +++ b/tests/PayPal/Test/Api/VerifyWebhookSignatureTest.php @@ -77,6 +77,15 @@ class VerifyWebhookSignatureTest extends \PHPUnit_Framework_TestCase $obj = new VerifyWebhookSignature(); $obj->setCertUrl(null); } + + public function testToJsonToIncludeRequestBodyAsWebhookEvent() { + $obj = new VerifyWebhookSignature(); + $requestBody = '{"id":"123", "links": [], "something": {}}'; + $obj->setRequestBody($requestBody); + + $this->assertEquals($obj->toJSON(), '{"webhook_event": ' . $requestBody .'}'); + } + /** * @dataProvider mockProvider * @param VerifyWebhookSignature $obj