From 65e44090de20b5679944dadd61461e7ddaf4f236 Mon Sep 17 00:00:00 2001 From: gorokh Date: Mon, 21 Oct 2019 14:50:06 +0300 Subject: [PATCH] fix test --- .../Adminhtml/System/Config/Form/Fieldset/Payment.php | 9 ++------- src/Test/Unit/Model/Service/OrderTest.php | 6 ++++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Block/Adminhtml/System/Config/Form/Fieldset/Payment.php b/src/Block/Adminhtml/System/Config/Form/Fieldset/Payment.php index a384459..25435a7 100644 --- a/src/Block/Adminhtml/System/Config/Form/Fieldset/Payment.php +++ b/src/Block/Adminhtml/System/Config/Form/Fieldset/Payment.php @@ -81,13 +81,8 @@ class Payment extends \Magento\Config\Block\System\Config\Form\Fieldset $html .= $this->_getHeaderHtml($element); if ($this->client->isConfigured()) { - $manager = \Magento\Framework\App\ObjectManager::getInstance(); - $paymentMethodListInterface = $manager->get(\Magento\Payment\Api\PaymentMethodListInterface::class); - $storeManagerInterface = $manager->get('Magento\Store\Model\StoreManagerInterface'); - $storeId = $storeManagerInterface->getStore()->getId(); - $paymentMethodList = $paymentMethodListInterface->getActiveList($storeId); - - foreach ($paymentMethodList as $code => $payment) { + $paymentMethods = $this->paymentConfig->getActiveMethods(); + foreach ($paymentMethods as $code => $payment) { $html .= $this->_getFieldHtml($element, $payment); } } else { diff --git a/src/Test/Unit/Model/Service/OrderTest.php b/src/Test/Unit/Model/Service/OrderTest.php index 321232d..2d5f171 100644 --- a/src/Test/Unit/Model/Service/OrderTest.php +++ b/src/Test/Unit/Model/Service/OrderTest.php @@ -54,7 +54,8 @@ class OrderTest extends \PHPUnit\Framework\TestCase ->with($this->logicalOr( $this->equalTo('retailcrm/retailcrm_status/processing'), $this->equalTo('retailcrm/retailcrm_payment/checkmo'), - $this->equalTo('retailcrm/retailcrm_shipping/flatrate') + $this->equalTo('retailcrm/retailcrm_shipping/flatrate'), + $this->equalTo('retailcrm/retailcrm_site/default') ))->will($this->returnCallback([$this, 'getCallbackDataConfig'])); $mockProduct = $this->getMockBuilder(\Magento\Catalog\Model\Product::class) @@ -167,7 +168,8 @@ class OrderTest extends \PHPUnit\Framework\TestCase $data = [ 'retailcrm/retailcrm_status/processing' => 'new', 'retailcrm/retailcrm_payment/checkmo' => 'test', - 'retailcrm/retailcrm_shipping/flatrate' => 'test' + 'retailcrm/retailcrm_shipping/flatrate' => 'test', + 'retailcrm/retailcrm_site/default' => 'test' ]; return $data[$key];