use Symfony\Component\Notifier\Bridge\Vonage\Webhook\VonageRequestParser;
use Symfony\Component\Webhook\Client\RequestParserInterface;
use Symfony\Component\Webhook\Exception\RejectWebhookException;
use Symfony\Component\Webhook\Test\AbstractRequestParserTestCase;
class VonageRequestParserTest extends AbstractRequestParserTestCase
{ public function testMissingAuthorizationTokenThrows() { $request =
$this->
createRequest('{}'
);
$request->headers->
remove('Authorization'
);
$parser =
$this->
createRequestParser();
$this->
expectException(RejectWebhookException::
class);
$this->
expectExceptionMessage('Missing "Authorization" header'
);
$parser->
parse($request,
$this->
getSecret());
} public function testInvalidAuthorizationTokenThrows() { $request =
$this->
createRequest('{}'
);
$request->headers->
set('Authorization', 'Invalid Header'
);