Skip to content

Commit bee4c95

Browse files
merge magento/2.3-develop into magento-pangolin/MQE-1509
2 parents 80411a2 + 20466b1 commit bee4c95

File tree

16 files changed

+228
-2812
lines changed

16 files changed

+228
-2812
lines changed

app/code/Magento/Config/Console/Command/ConfigSet/DefaultProcessor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ public function process($path, $value, $scope, $scopeCode)
9090
}
9191

9292
try {
93-
$config = $this->configFactory->create([
93+
$config = $this->configFactory->create(['data' => [
9494
'scope' => $scope,
9595
'scope_code' => $scopeCode,
96-
]);
96+
]]);
9797
$config->setDataByPath($path, $value);
9898
$config->save();
9999
} catch (\Exception $exception) {

app/code/Magento/Config/Test/Unit/Console/Command/ConfigSet/DefaultProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testProcess($path, $value, $scope, $scopeCode)
103103
$config = $this->createMock(Config::class);
104104
$this->configFactory->expects($this->once())
105105
->method('create')
106-
->with(['scope' => $scope, 'scope_code' => $scopeCode])
106+
->with(['data' => ['scope' => $scope, 'scope_code' => $scopeCode]])
107107
->willReturn($config);
108108
$config->expects($this->once())
109109
->method('setDataByPath')

app/code/Magento/ImportExport/Model/Import.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ class Import extends \Magento\ImportExport\Model\AbstractModel
126126
*/
127127
protected $_importExportData = null;
128128

129+
/**
130+
* @var \Magento\Framework\App\Config\ScopeConfigInterface
131+
*/
132+
private $_coreConfig;
133+
129134
/**
130135
* @var \Magento\ImportExport\Model\Import\ConfigInterface
131136
*/

app/code/Magento/Paypal/etc/adminhtml/system/paypal_payflowpro_with_express_checkout.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
9-
<group id="paypal_payflowpro_with_express_checkout" translate="label comment" extends="payment_all_paypal/paypal_payflowpro">
9+
<group id="paypal_payflowpro_with_express_checkout" translate="label" extends="payment_all_paypal/paypal_payflowpro">
1010
<label>Payflow Pro</label>
1111
<attribute type="paypal_ec_separate">0</attribute>
1212
<group id="paypal_payflow_required" translate="label" showInDefault="1" showInWebsite="1" sortOrder="10">
@@ -30,7 +30,7 @@
3030
<field id="enable_paypal_payflow"/>
3131
</requires>
3232
</field>
33-
<field id="enable_express_checkout_bml_payflow" translate="label" type="select" sortOrder="21" showInWebsite="1" showInDefault="1">
33+
<field id="enable_express_checkout_bml_payflow" translate="label comment" type="select" sortOrder="21" showInWebsite="1" showInDefault="1">
3434
<label>Enable PayPal Credit</label>
3535
<comment><![CDATA[PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
3636
You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with PayPal Credit&#174;.

app/code/Magento/Paypal/i18n/en_US.csv

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,11 @@ User,User
697697
The PayPal Advertising Program has been shown to generate additional purchases as well as increase consumer's average purchase sizes by 15%
698698
or more. <a href=""https://financing.paypal.com/ppfinportal/content/forrester"" target=""_blank"">See Details</a>.
699699
"
700+
"PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
701+
You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with PayPal Credit&#174;.
702+
<a href=""https://www.paypal.com/webapps/mpp/promotional-financing"" target=""_blank"">Learn More</a>","PayPal Express Checkout Payflow Edition lets you give customers access to financing through PayPal Credit&#174; - at no additional cost to you.
703+
You get paid up front, even though customers have more time to pay. A pre-integrated payment button lets customers pay quickly with PayPal Credit&#174;.
704+
<a href=""https://www.paypal.com/webapps/mpp/promotional-financing"" target=""_blank"">Learn More</a>"
700705
"Customize Smart Buttons","Customize Smart Buttons"
701706
"Checkout Page","Checkout Page"
702707
"Label","Label"
@@ -731,4 +736,4 @@ User,User
731736
"PayPal will automatically display each enabled funding option to eligible buyers. For example, PayPal Credit is only shown to buyers in countries where PayPal Credit is offered and the currency offered by the merchant is USD.","PayPal will automatically display each enabled funding option to eligible buyers. For example, PayPal Credit is only shown to buyers in countries where PayPal Credit is offered and the currency offered by the merchant is USD."
732737
"PayPal Credit","PayPal Credit"
733738
"PayPal Guest Checkout Credit Card Icons","PayPal Guest Checkout Credit Card Icons"
734-
"Elektronisches Lastschriftverfahren - German ELV","Elektronisches Lastschriftverfahren - German ELV"
739+
"Elektronisches Lastschriftverfahren - German ELV","Elektronisches Lastschriftverfahren - German ELV"

dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/ConverterStub.php renamed to dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/ConverterStub.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
namespace Magento\Paypal\Model\Config\Structure\Reader;
6+
declare(strict_types=1);
7+
8+
namespace Magento\Config\Model\Config\Structure\Reader;
9+
10+
use Magento\Config\Model\Config\Structure\Converter;
711

812
/**
9-
* Class ConverterStub
13+
* Class ConverterStub used for ReaderTest.
1014
*/
11-
class ConverterStub extends \Magento\Config\Model\Config\Structure\Converter
15+
class ConverterStub extends Converter
1216
{
1317
/**
18+
* Convert dom document wrapper.
19+
*
1420
* @param \DOMDocument $document
1521
* @return array|null
1622
*/
@@ -20,7 +26,7 @@ public function getArrayData(\DOMDocument $document)
2026
}
2127

2228
/**
23-
* Convert dom document
29+
* Convert dom document.
2430
*
2531
* @param \DOMNode $source
2632
* @return array

dev/tests/integration/testsuite/Magento/Paypal/Model/Config/Structure/Reader/ReaderStub.php renamed to dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/ReaderStub.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,20 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
namespace Magento\Paypal\Model\Config\Structure\Reader;
6+
declare(strict_types=1);
7+
8+
namespace Magento\Config\Model\Config\Structure\Reader;
9+
10+
use Magento\Config\Model\Config\Structure\Reader;
711

812
/**
9-
* Class ReaderStub
13+
* Class ReaderStub used for testing protected Reader::_readFiles() method.
1014
*/
11-
class ReaderStub extends \Magento\Config\Model\Config\Structure\Reader
15+
class ReaderStub extends Reader
1216
{
1317
/**
18+
* Wrapper for protected Reader::_readFiles() method.
19+
*
1420
* @param array $fileList
1521
* @return array
1622
* @throws \Magento\Framework\Exception\LocalizedException
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Config\Model\Config\Structure\Reader;
9+
10+
use Magento\Config\Model\Config\SchemaLocator;
11+
use Magento\Framework\App\Utility\Files;
12+
use Magento\Framework\Config\Dom;
13+
use Magento\Framework\Config\FileResolverInterface;
14+
use Magento\Framework\Config\ValidationStateInterface;
15+
use Magento\Framework\ObjectManagerInterface;
16+
use Magento\Framework\View\TemplateEngine\Xhtml\CompilerInterface;
17+
use Magento\TestFramework\Helper\Bootstrap;
18+
19+
/**
20+
* Class ReaderTest check Magento\Config\Model\Config\Structure\Reader::_readFiles() method.
21+
*/
22+
class ReaderTest extends \PHPUnit\Framework\TestCase
23+
{
24+
/**
25+
* Test config location.
26+
*
27+
* @string
28+
*/
29+
const CONFIG = '/dev/tests/integration/testsuite/Magento/Config/Model/Config/Structure/Reader/_files/';
30+
31+
/**
32+
* @var ObjectManagerInterface
33+
*/
34+
private $objectManager;
35+
36+
/**
37+
* @var Files
38+
*/
39+
private $fileUtility;
40+
41+
/**
42+
* @var ValidationStateInterface
43+
*/
44+
private $validationStateMock;
45+
46+
/**
47+
* @var \Magento\Framework\Config\SchemaLocatorInterface
48+
*/
49+
private $schemaLocatorMock;
50+
51+
/**
52+
* @var FileResolverInterface
53+
*/
54+
private $fileResolverMock;
55+
56+
/**
57+
* @var ReaderStub
58+
*/
59+
private $reader;
60+
61+
/**
62+
* @var ConverterStub
63+
*/
64+
private $converter;
65+
66+
/**
67+
* @var CompilerInterface|\PHPUnit_Framework_MockObject_MockObject
68+
*/
69+
private $compiler;
70+
71+
/**
72+
* @inheritdoc
73+
*/
74+
protected function setUp()
75+
{
76+
$this->objectManager = Bootstrap::getObjectManager();
77+
$this->fileUtility = Files::init();
78+
79+
$this->validationStateMock = $this->getMockBuilder(ValidationStateInterface::class)
80+
->setMethods(['isValidationRequired'])
81+
->getMockForAbstractClass();
82+
$this->schemaLocatorMock = $this->getMockBuilder(SchemaLocator::class)
83+
->disableOriginalConstructor()
84+
->setMethods(['getPerFileSchema'])
85+
->getMock();
86+
$this->fileResolverMock = $this->getMockBuilder(FileResolverInterface::class)
87+
->getMockForAbstractClass();
88+
89+
$this->validationStateMock->expects($this->atLeastOnce())
90+
->method('isValidationRequired')
91+
->willReturn(false);
92+
$this->schemaLocatorMock->expects($this->atLeastOnce())
93+
->method('getPerFileSchema')
94+
->willReturn(false);
95+
96+
$this->converter = $this->objectManager->create(ConverterStub::class);
97+
98+
//Isolate test from actual configuration, and leave only sample data.
99+
$this->compiler = $this->getMockBuilder(CompilerInterface::class)
100+
->disableOriginalConstructor()
101+
->setMethods(['compile'])
102+
->getMockForAbstractClass();
103+
104+
$this->reader = $this->objectManager->create(
105+
ReaderStub::class,
106+
[
107+
'fileResolver' => $this->fileResolverMock,
108+
'converter' => $this->converter,
109+
'schemaLocator' => $this->schemaLocatorMock,
110+
'validationState' => $this->validationStateMock,
111+
'fileName' => 'no_existing_file.xml',
112+
'compiler' => $this->compiler,
113+
'domDocumentClass' => Dom::class
114+
]
115+
);
116+
}
117+
118+
/**
119+
* The test checks the file structure after processing the nodes responsible for inserting content.
120+
*
121+
* @return void
122+
*/
123+
public function testXmlConvertedConfigurationAndCompereStructure()
124+
{
125+
$actual = $this->reader->readFiles(['actual' => $this->getContent()]);
126+
127+
$document = new \DOMDocument();
128+
$document->loadXML($this->getContent());
129+
130+
$expected = $this->converter->getArrayData($document);
131+
132+
$this->assertEquals($expected, $actual);
133+
}
134+
135+
/**
136+
* Get config sample data for test.
137+
*
138+
* @return string
139+
*/
140+
protected function getContent()
141+
{
142+
$files = $this->fileUtility->getFiles([BP . static::CONFIG], 'config.xml');
143+
144+
return file_get_contents(reset($files));
145+
}
146+
}

0 commit comments

Comments
 (0)