From d909ceec2cef87f8d1bb0fc8e62b14e1409b1c99 Mon Sep 17 00:00:00 2001
From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>
Date: Fri, 29 Nov 2024 20:46:18 +0000
Subject: [PATCH] Remove obsolete test case and add new test cases for payment
methods.
Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com>
---
composer.json | 4 +-
phpunit.xml.dist | 3 +
src/Classes/AuthorizeNetClient.php | 22 +-
src/Classes/BasePaymentGateway.php | 10 +-
src/Concerns/WithApplicableFee.php | 4 +-
src/Database/Factories/PaymentFactory.php | 5 +-
src/Database/Factories/PaymentLogFactory.php | 23 +
.../Factories/PaymentProfileFactory.php | 23 +
src/Extension.php | 6 +-
src/FormWidgets/PaymentAttempts.php | 14 +-
src/Http/Controllers/Payments.php | 19 +-
src/Models/PaymentLog.php | 5 +-
src/Models/PaymentProfile.php | 3 +
src/Payments/AuthorizeNetAim.php | 31 +-
src/Payments/Mollie.php | 34 +-
src/Payments/PaypalExpress.php | 55 +--
src/Payments/Square.php | 8 +-
src/Payments/Stripe.php | 45 +-
tests/Classes/AuthorizeNetClientTest.php | 87 ++++
tests/Classes/BasePaymentGatewayTest.php | 110 +++++
tests/Classes/PayPalClientTest.php | 128 +++++
tests/Classes/PaymentGatewaysTest.php | 83 ++++
tests/Concerns/WithApplicableFeeTest.php | 118 +++++
tests/Concerns/WithAuthorizedPaymentTest.php | 71 +++
tests/Concerns/WithPaymentProfileTest.php | 48 ++
tests/Concerns/WithPaymentRefundTest.php | 37 ++
tests/ExampleTest.php | 5 -
tests/ExtensionTest.php | 131 +++++
tests/FormWidgets/PaymentAttemptsTest.php | 102 ++++
tests/Http/Controllers/PaymentsTest.php | 183 +++++++
.../CaptureAuthorizedPaymentTest.php | 65 +++
...datePaymentIntentSessionOnCheckoutTest.php | 44 ++
tests/Models/PaymentLogTest.php | 89 ++++
tests/Models/PaymentProfileTest.php | 80 +++
tests/Models/PaymentTest.php | 184 +++++++
tests/Payments/AuthorizeNetAimTest.php | 310 ++++++++++++
tests/Payments/CodTest.php | 45 ++
tests/Payments/Fixtures/TestPayment.php | 25 +
.../Fixtures/TestPaymentWithAuthorized.php | 32 ++
.../Fixtures/TestPaymentWithNoRefund.php | 22 +
.../Fixtures/TestPaymentWithRefund.php | 28 ++
tests/Payments/MollieTest.php | 242 +++++++++
tests/Payments/PaypalExpressTest.php | 227 +++++++++
tests/Payments/SquareTest.php | 343 +++++++++++++
tests/Payments/StripeTest.php | 462 ++++++++++++++++++
tests/Pest.php | 9 +
.../Subscribers/FormFieldsSubscriberTest.php | 45 ++
tests/TestCase.php | 14 -
tests/_fixtures/fields.php | 20 +
49 files changed, 3544 insertions(+), 159 deletions(-)
create mode 100644 src/Database/Factories/PaymentLogFactory.php
create mode 100644 src/Database/Factories/PaymentProfileFactory.php
create mode 100644 tests/Classes/AuthorizeNetClientTest.php
create mode 100644 tests/Classes/BasePaymentGatewayTest.php
create mode 100644 tests/Classes/PayPalClientTest.php
create mode 100644 tests/Classes/PaymentGatewaysTest.php
create mode 100644 tests/Concerns/WithApplicableFeeTest.php
create mode 100644 tests/Concerns/WithAuthorizedPaymentTest.php
create mode 100644 tests/Concerns/WithPaymentProfileTest.php
create mode 100644 tests/Concerns/WithPaymentRefundTest.php
delete mode 100644 tests/ExampleTest.php
create mode 100644 tests/ExtensionTest.php
create mode 100644 tests/FormWidgets/PaymentAttemptsTest.php
create mode 100644 tests/Http/Controllers/PaymentsTest.php
create mode 100644 tests/Listeners/CaptureAuthorizedPaymentTest.php
create mode 100644 tests/Listeners/UpdatePaymentIntentSessionOnCheckoutTest.php
create mode 100644 tests/Models/PaymentLogTest.php
create mode 100644 tests/Models/PaymentProfileTest.php
create mode 100644 tests/Models/PaymentTest.php
create mode 100644 tests/Payments/AuthorizeNetAimTest.php
create mode 100644 tests/Payments/CodTest.php
create mode 100644 tests/Payments/Fixtures/TestPayment.php
create mode 100644 tests/Payments/Fixtures/TestPaymentWithAuthorized.php
create mode 100644 tests/Payments/Fixtures/TestPaymentWithNoRefund.php
create mode 100644 tests/Payments/Fixtures/TestPaymentWithRefund.php
create mode 100644 tests/Payments/MollieTest.php
create mode 100644 tests/Payments/PaypalExpressTest.php
create mode 100644 tests/Payments/SquareTest.php
create mode 100644 tests/Payments/StripeTest.php
create mode 100644 tests/Subscribers/FormFieldsSubscriberTest.php
delete mode 100644 tests/TestCase.php
create mode 100644 tests/_fixtures/fields.php
diff --git a/composer.json b/composer.json
index 123d42d..d291378 100644
--- a/composer.json
+++ b/composer.json
@@ -20,7 +20,7 @@
"mollie"
],
"require": {
- "tastyigniter/core": "^v4.0@beta",
+ "tastyigniter/core": "^v4.0@beta || ^v4.0@dev",
"php-http/guzzle7-adapter": "~1.0",
"authorizenet/authorizenet": "2.0.2",
"stripe/stripe-php": "~7.93.0",
@@ -69,5 +69,5 @@
},
"sort-packages": true
},
- "minimum-stability": "beta"
+ "minimum-stability": "dev"
}
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 9eb3e47..34cf9a4 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -12,6 +12,9 @@
+
+
+