From aeedfaa9e131eea17ef2e89fe7a6b67440b26a5b Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 8 Feb 2018 20:54:12 +0100 Subject: [PATCH] Test callback on finalized invoice --- tests/Feature/Http/Controllers/PaymentTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Feature/Http/Controllers/PaymentTest.php b/tests/Feature/Http/Controllers/PaymentTest.php index da88ddd7..ff5b1eff 100644 --- a/tests/Feature/Http/Controllers/PaymentTest.php +++ b/tests/Feature/Http/Controllers/PaymentTest.php @@ -355,6 +355,21 @@ public function testCallback(): void ); } + public function testCallbackFinalized(): void + { + $this->get('/betaling/3/bc87e/callback/?txnid=123456&paymenttype=1&hash=aaa42296669b958c3cee6c0475c8093e') + ->assertResponseStatus(200); + + $this->assertDatabaseMissing( + 'emails', + [ + 'subject' => 'Order #1 - payment completed', + 'from' => 'mail@gmail.com', + 'to' => 'test@gmail.com', + ] + ); + } + public function testCallbackWrong(): void { $this->get('/betaling/1/a4238/callback/?txnid=123456&paymenttype=1&hash=wrong')