Add test for verifyWebhookSignature

This commit is contained in:
Jay Patel
2017-03-23 15:09:55 -05:00
parent bf3f436523
commit fb92d8d666

View File

@@ -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