Skip to content

Commit 58fea1e

Browse files
Merge branch '2.4-develop' of github.com:magento-commerce/magento2ce into ACPT-757&ACPT-773&ACPT-747&ACPT-748&ACPT-675&ACPT-671&ACPT-746
2 parents 028bf1f + abe22bc commit 58fea1e

File tree

60 files changed

+947
-722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+947
-722
lines changed

app/code/Magento/Analytics/Test/Mftf/ActionGroup/AssertAdminAdvancedReportingPageUrlActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515

1616
<switchToNextTab stepKey="switchToNewTab"/>
1717
<waitForPageLoad stepKey="waitForAdvancedReportingPageLoad"/>
18-
<seeInCurrentUrl url="reports/advanced-reporting" stepKey="seeAssertAdvancedReportingPageUrl"/>
18+
<seeInCurrentUrl url="report" stepKey="seeAssertAdvancedReportingPageUrl"/>
1919
</actionGroup>
2020
</actionGroups>

app/code/Magento/Backend/Test/Unit/Model/Menu/Config/XsdTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ protected function setUp(): void
4242
public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedError)
4343
{
4444
$actualError = $this->_xsdValidator->validate($this->_xsdSchema, $xmlString);
45-
$this->assertEquals($expectedError, $actualError);
45+
$this->assertEquals(false, empty($actualError));
46+
foreach ($expectedError as $error) {
47+
$this->assertContains($error, $actualError);
48+
}
4649
}
4750

4851
public function testSchemaCorrectlyIdentifiesValidXml()

app/code/Magento/Backend/Test/Unit/Model/Menu/Config/_files/invalidMenuXmlArray.php

Lines changed: 65 additions & 181 deletions
Large diffs are not rendered by default.

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontNavigationSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<element name="topCategory" type="button" selector="//a[contains(@class,'level-top')]/span[contains(text(),'{{var1}}')]" parameterized="true"/>
1212
<element name="subCategory" type="button" selector="//ul[contains(@class,'submenu')]//span[contains(text(),'{{var1}}')]" parameterized="true"/>
1313
<element name="breadcrumbs" type="textarea" selector=".items"/>
14+
<element name="breadcrumbsHomeLink" type="button" selector=".home a"/>
1415
<element name="categoryBreadcrumbs" type="textarea" selector=".breadcrumbs li"/>
1516
<element name="categoryBreadcrumbsByNumber" type="textarea" selector=".breadcrumbs li:nth-of-type({{number}})" parameterized="true"/>
1617
</section>

app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/XsdTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ protected function setUp(): void
4242
protected function _loadDataForTest($schemaName, $xmlString, $expectedError)
4343
{
4444
$actualError = $this->_xsdValidator->validate($this->_xsdSchemaPath . $schemaName, $xmlString);
45-
$this->assertEquals($expectedError, $actualError);
45+
$this->assertEquals(false, empty($actualError));
46+
foreach ($expectedError as $error) {
47+
$this->assertContains($error, $actualError);
48+
}
4649
}
4750

4851
/**

app/code/Magento/Catalog/Test/Unit/Model/ProductOptions/Config/_files/invalidProductOptionsXmlArray.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
'</option></config>',
3636
[
3737
"Element 'option', attribute 'renderer': [facet 'pattern'] The value '123true' is not accepted by the " .
38-
"pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n",
39-
"Element 'option', attribute 'renderer': '123true' is not a valid value of the atomic" .
40-
" type 'modelName'.\nLine: 1\n"
38+
"pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n"
4139
],
4240
],
4341
'disabled_attribute_with_invalid_value' => [

app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/XsdTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ protected function setUp(): void
4242
public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedError)
4343
{
4444
$actualError = $this->_xsdValidator->validate($this->_xsdSchema, $xmlString);
45-
$this->assertEquals($expectedError, $actualError);
45+
$this->assertEquals(false, empty($actualError));
46+
foreach ($expectedError as $error) {
47+
$this->assertContains($error, $actualError);
48+
}
4649
}
4750

4851
public function testSchemaCorrectlyIdentifiesValidXml()

app/code/Magento/Catalog/Test/Unit/Model/ProductTypes/Config/_files/invalidProductTypesXmlArray.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
'<?xml version="1.0"?><config><type name="some_name" modelInstance="123" /></config>',
2626
[
2727
"Element 'type', attribute 'modelInstance': [facet 'pattern'] The value '123' is not accepted by the" .
28-
" pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n",
29-
"Element 'type', attribute 'modelInstance': '123' is not a valid value of the atomic type" .
30-
" 'modelName'.\nLine: 1\n"
28+
" pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n"
3129
],
3230
],
3331
'type_indexpriority_invalid_value' => [
@@ -59,18 +57,14 @@
5957
'<?xml version="1.0"?><config><type name="some_name"><priceModel instance="123123" /></type></config>',
6058
[
6159
"Element 'priceModel', attribute 'instance': [facet 'pattern'] The value '123123' is not accepted " .
62-
"by the pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n",
63-
"Element 'priceModel', attribute 'instance': '123123' is not a valid value of the atomic type" .
64-
" 'modelName'.\nLine: 1\n"
60+
"by the pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n"
6561
],
6662
],
6763
'type_indexermodel_instance_invalid_value' => [
6864
'<?xml version="1.0"?><config><type name="some_name"><indexerModel instance="123" /></type></config>',
6965
[
7066
"Element 'indexerModel', attribute 'instance': [facet 'pattern'] The value '123' is not accepted by " .
71-
"the pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n",
72-
"Element 'indexerModel', attribute 'instance': '123' is not a valid value of the atomic type" .
73-
" 'modelName'.\nLine: 1\n"
67+
"the pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n"
7468
],
7569
],
7670
'type_indexermodel_without_required_instance_attribute' => [
@@ -85,9 +79,7 @@
8579
'<?xml version="1.0"?><config><type name="some_name"><stockIndexerModel instance="1234"/></type></config>',
8680
[
8781
"Element 'stockIndexerModel', attribute 'instance': [facet 'pattern'] The value '1234' is not " .
88-
"accepted by the pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n",
89-
"Element 'stockIndexerModel', attribute 'instance': '1234' is not a valid value of the atomic " .
90-
"type 'modelName'.\nLine: 1\n"
82+
"accepted by the pattern '([\\\\]?[a-zA-Z_][a-zA-Z0-9_]*)+'.\nLine: 1\n"
9183
],
9284
],
9385
'allowedselectiontypes_without_required_type_handle' => [

app/code/Magento/Config/Model/Config/Backend/Currency/Cron.php

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
namespace Magento\Config\Model\Config\Backend\Currency;
1111

12+
use Magento\Framework\Exception\LocalizedException;
13+
1214
/**
1315
* Cron job configuration for currency
1416
*
@@ -17,8 +19,7 @@
1719
*/
1820
class Cron extends \Magento\Framework\App\Config\Value
1921
{
20-
const CRON_STRING_PATH = 'crontab/default/jobs/currency_rates_update/schedule/cron_expr';
21-
22+
public const CRON_STRING_PATH = 'crontab/default/jobs/currency_rates_update/schedule/cron_expr';
2223
/**
2324
* @var \Magento\Framework\App\Config\ValueFactory
2425
*/
@@ -52,13 +53,28 @@ public function __construct(
5253
* After save handler
5354
*
5455
* @return $this
55-
* @throws \Exception
56+
* @throws LocalizedException
5657
*/
5758
public function afterSave()
5859
{
5960
$time = $this->getData('groups/import/fields/time/value');
60-
$frequency = $this->getData('groups/import/fields/frequency/value');
61-
61+
if (empty($time)) {
62+
$time = explode(
63+
',',
64+
$this->_config->getValue(
65+
'currency/import/time',
66+
$this->getScope(),
67+
$this->getScopeId()
68+
) ?: '0,0,0'
69+
);
70+
$frequency = $this->_config->getValue(
71+
'currency/import/frequency',
72+
$this->getScope(),
73+
$this->getScopeId()
74+
);
75+
} else {
76+
$frequency = $this->getData('groups/import/fields/frequency/value');
77+
}
6278
$frequencyWeekly = \Magento\Cron\Model\Config\Source\Frequency::CRON_WEEKLY;
6379
$frequencyMonthly = \Magento\Cron\Model\Config\Source\Frequency::CRON_MONTHLY;
6480

@@ -78,7 +94,7 @@ public function afterSave()
7894
$configValue->load(self::CRON_STRING_PATH, 'path');
7995
$configValue->setValue($cronExprString)->setPath(self::CRON_STRING_PATH)->save();
8096
} catch (\Exception $e) {
81-
throw new \Exception(__('We can\'t save the Cron expression.'));
97+
throw new LocalizedException(__('We can\'t save the Cron expression.'));
8298
}
8399
return parent::afterSave();
84100
}

app/code/Magento/Config/Test/Unit/Model/Config/XsdTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ protected function setUp(): void
4242
public function testSchemaCorrectlyIdentifiesInvalidXml($xmlString, $expectedError)
4343
{
4444
$actualError = $this->_xsdValidator->validate($this->_xsdSchema, $xmlString);
45-
$this->assertEquals($expectedError, $actualError);
45+
$this->assertEquals(false, empty($actualError));
46+
foreach ($expectedError as $error) {
47+
$this->assertContains($error, $actualError);
48+
}
4649
}
4750

4851
public function testSchemaCorrectlyIdentifiesValidXml()

0 commit comments

Comments
 (0)