๐ŸงชTesting your implementation

Laravel SNS Events comes with a GeneratesSnsMessages trait that helps you create valid SES payloads in order to test your SNS implementation.


use Rennokki\LaravelSnsEvents\Concerns\GeneratesSnsMessages;

class MySesControllerTest extends TestCase
{
    use GeneratesSnsMessages;

    public function test_my_ses_controller()
    {
        $payload = $this->getNotificationPayload([
            'eventType' => $type,
        ]);

        $response = $this->sendSnsMessage('/webhook', $payload);

        $response->assertOk();
    }
}

Note: Please make sure to specify the certificate query parameter to the route when calling HTTP requests.

Last updated