From 5f48dbb33c5e1b2abdd11b64e3eedb71a318269d Mon Sep 17 00:00:00 2001 From: Renata Carmi Armel Date: Tue, 15 Oct 2024 16:12:32 -0300 Subject: [PATCH] removing unnecessary code --- src/Model/Subscription.php | 17 ----------------- tests/Model/CheckoutTest.php | 3 +-- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/Model/Subscription.php b/src/Model/Subscription.php index e0f793ce..86ea28f4 100644 --- a/src/Model/Subscription.php +++ b/src/Model/Subscription.php @@ -570,23 +570,6 @@ public static function getRecurrenceCycle() return null; } - /** - * @return boolean - */ - public static function getPaymentOrigin() - { - if (!self::hasSubscriptionPlugin()) { - return null; - } - if (wcs_cart_contains_renewal()) { - return "subsequent"; - } - if (\WC_Subscriptions_Cart::cart_contains_subscription()) { - return "first"; - } - return null; - } - /** * @return boolean */ diff --git a/tests/Model/CheckoutTest.php b/tests/Model/CheckoutTest.php index aeb545f0..e9579ce8 100644 --- a/tests/Model/CheckoutTest.php +++ b/tests/Model/CheckoutTest.php @@ -85,8 +85,7 @@ public function testProcessWithTdsAuthenticatedCreditCardPaymentMethodShouldSetA $subscriptionMock = Mockery::mock('alias:Woocommerce\Pagarme\Model\Subscription'); $subscriptionMock->shouldReceive('getRecurrenceCycle') ->andReturnNull(); - - $subscriptionMock = Mockery::mock('alias:Woocommerce\Pagarme\Model\Subscription'); + $subscriptionMock->shouldReceive('getPaymentOrigin') ->andReturnNull();