Skip to content

Commit c4e5faa

Browse files
authored
ENGCOM-5630: PayPal - fix configuration path in config model for "Disable Funding Options" #24121
2 parents beebc78 + 061c843 commit c4e5faa

File tree

3 files changed

+28
-17
lines changed

3 files changed

+28
-17
lines changed

app/code/Magento/Paypal/Model/AbstractConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public function isMethodActive($method)
293293
case Config::METHOD_WPS_BML:
294294
case Config::METHOD_WPP_BML:
295295
$disabledFunding = $this->_scopeConfig->getValue(
296-
'payment/paypal_express/disable_funding_options',
296+
'paypal/style/disable_funding_options',
297297
ScopeInterface::SCOPE_STORE,
298298
$this->_storeId
299299
);

app/code/Magento/Paypal/Test/Unit/Model/AbstractConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public function testIsMethodActiveBml($disableFundingOptions, $expectedFlag, $ex
306306
{
307307
$this->scopeConfigMock->method('getValue')
308308
->with(
309-
self::equalTo('payment/paypal_express/disable_funding_options'),
309+
self::equalTo('paypal/style/disable_funding_options'),
310310
self::equalTo('store')
311311
)
312312
->willReturn($disableFundingOptions);

app/code/Magento/Paypal/Test/Unit/Model/ConfigTest.php

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
use Magento\Store\Model\ScopeInterface;
1010
use Magento\Framework\App\Config\ScopeConfigInterface;
1111

12+
/**
13+
* Class ConfigTest
14+
*/
1215
class ConfigTest extends \PHPUnit\Framework\TestCase
1316
{
1417
/**
@@ -122,7 +125,7 @@ public function testIsMethodAvailableForIsMethodActive($methodName, $expected)
122125
$valueMap = [
123126
['paypal/general/merchant_country', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, 'US'],
124127
['paypal/general/merchant_country', ScopeInterface::SCOPE_STORE, null, 'US'],
125-
['payment/paypal_express/disable_funding_options', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, []],
128+
['paypal/style/disable_funding_options', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, []],
126129
];
127130
$this->scopeConfig
128131
->method('getValue')
@@ -362,11 +365,15 @@ public function testGetBmlDisplay($section, $expectedValue, $expectedFlag, $expe
362365
->will($this->returnValue($expectedFlag));
363366
$this->scopeConfig->expects($this->any())
364367
->method('getValue')
365-
->will($this->returnValueMap([
366-
['payment/' . Config::METHOD_WPP_BML . '/' . $section . '_display', 'store', 1, $expectedValue],
367-
['payment/' . Config::METHOD_WPP_BML . '/active', 'store', 1, $expectedValue],
368-
['payment/' . Config::METHOD_WPP_PE_BML . '/active', 'store', 1, $expectedValue],
369-
]));
368+
->will(
369+
$this->returnValueMap(
370+
[
371+
['payment/' . Config::METHOD_WPP_BML . '/' . $section . '_display', 'store', 1, $expectedValue],
372+
['payment/' . Config::METHOD_WPP_BML . '/active', 'store', 1, $expectedValue],
373+
['payment/' . Config::METHOD_WPP_PE_BML . '/active', 'store', 1, $expectedValue],
374+
]
375+
)
376+
);
370377
$this->assertEquals($expected, $this->model->getBmlDisplay($section));
371378
}
372379

@@ -407,11 +414,13 @@ public function testGetExpressCheckoutShortcutImageUrl(
407414

408415
$this->scopeConfig->expects($this->any())
409416
->method('getValue')
410-
->willReturnMap([
411-
['paypal/wpp/button_flavor', ScopeInterface::SCOPE_STORE, 123, $areButtonDynamic],
412-
['paypal/wpp/sandbox_flag', ScopeInterface::SCOPE_STORE, 123, $sandboxFlag],
413-
['paypal/wpp/button_type', ScopeInterface::SCOPE_STORE, 123, $buttonType],
414-
]);
417+
->willReturnMap(
418+
[
419+
['paypal/wpp/button_flavor', ScopeInterface::SCOPE_STORE, 123, $areButtonDynamic],
420+
['paypal/wpp/sandbox_flag', ScopeInterface::SCOPE_STORE, 123, $sandboxFlag],
421+
['paypal/wpp/button_type', ScopeInterface::SCOPE_STORE, 123, $buttonType],
422+
]
423+
);
415424

416425
$this->assertEquals(
417426
$result,
@@ -475,10 +484,12 @@ public function testGetPaymentMarkImageUrl(
475484

476485
$this->scopeConfig->expects($this->any())
477486
->method('getValue')
478-
->willReturnMap([
479-
['paypal/wpp/button_flavor', ScopeInterface::SCOPE_STORE, 123, $areButtonDynamic],
480-
['paypal/wpp/sandbox_flag', ScopeInterface::SCOPE_STORE, 123, $sandboxFlag],
481-
]);
487+
->willReturnMap(
488+
[
489+
['paypal/wpp/button_flavor', ScopeInterface::SCOPE_STORE, 123, $areButtonDynamic],
490+
['paypal/wpp/sandbox_flag', ScopeInterface::SCOPE_STORE, 123, $sandboxFlag],
491+
]
492+
);
482493

483494
$this->assertEquals(
484495
$result,

0 commit comments

Comments
 (0)