Skip to content

Testing

phil/standard-webhooks-bundle
AreaWhat is covered
PhilStandardWebhooksBundleEvery service, argument, alias and tag; the defaults; no Doctrine connection without DoctrineBundle; refused configurations
SigningKeysThe current key and the others, none configured, no key in a stack trace
VerifiedWebhookResolverThe verified argument, other arguments left alone, 400 and 401 with the reason
WebhookSender, DeliveryFailedHeaders, signatures by every key, a retry's id, the 2xx bounds, no answer, no client
DbalProcessedWebhooks, ProcessedWebhookTable, the schema listenerClaims once in UTC, purges, each platform's insert, the table on its own connection, the binary collation on MySQL and MariaDB
GenerateKeyCommandBoth schemes, another refused

A functional suite boots a kernel with FrameworkBundle, DoctrineBundle on SQLite and the bundle, an endpoint whose controller takes a VerifiedWebhook, and an HTTP client that hands each request to the same kernel: WebhookEndpointTest sends with WebhookSender and receives — both schemes, a key found on reload, a retry processed once, each refusal —; ConfigurationTest boots and refuses. Installed on its own, where FrameworkBundle is a development requirement, the suite is skipped.

vendor/bin/phpunit packages/standard-webhooks-bundle/tests

An integration test, MySqlProcessedWebhooksTest, claims two ids that differ by their case on a real MySQL server, when PHIL_TEST_MYSQL_URL names one; it is skipped otherwise.

The protocol itself is tested in phil/standard-webhooks, against the RFC 8032 and Standard Webhooks vectors.