From c9cf0d78fcc709e7f3b00160378248caae3d0615 Mon Sep 17 00:00:00 2001 From: Lorenzo Ruozzi Date: Thu, 15 Feb 2024 12:22:52 +0100 Subject: [PATCH] Fix tests --- tests/Behat/Context/Api/PagolightContext.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Behat/Context/Api/PagolightContext.php b/tests/Behat/Context/Api/PagolightContext.php index 58c6f55..5e58d59 100644 --- a/tests/Behat/Context/Api/PagolightContext.php +++ b/tests/Behat/Context/Api/PagolightContext.php @@ -58,10 +58,12 @@ public function pagolightNotifyTheStoreAboutTheFailedPayment(): void { $payment = $this->getCurrentPayment(); [$paymentCaptureSecurityToken, $paymentNotifySecurityToken] = $this->getCurrentPaymentSecurityTokens($payment); + $webhookToken = $this->webhookTokenRepository->findOneByPayment($payment); + Assert::isInstanceOf($webhookToken, WebhookTokenInterface::class); $this->notifyPaymentState($paymentNotifySecurityToken, [ 'status' => PaymentState::CANCELLED, - 'token' => 'pagolight', + 'token' => $webhookToken->getToken(), ]); }