Skip to content

Commit cd01b7d

Browse files
Merge branch '2.3-develop' into 2.3-qwerty
2 parents 621db01 + ad779f2 commit cd01b7d

File tree

312 files changed

+7834
-1667
lines changed

Some content is hidden

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

312 files changed

+7834
-1667
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4335,7 +4335,7 @@ Tests:
43354335
* Fixed order placing with virtual product using Express Checkout
43364336
* Fixed the error during order placement with Recurring profile payment
43374337
* Fixed wrong redirect after customer registration during multishipping checkout
4338-
* Fixed inability to crate shipping labels
4338+
* Fixed inability to create shipping labels
43394339
* Fixed inability to switch language, if the default language is English
43404340
* Fixed an issue with incorrect XML appearing in cache after some actions on the frontend
43414341
* Fixed product export

app/code/Magento/AuthorizenetAcceptjs/Gateway/Validator/TransactionResponseValidator.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ public function validate(array $validationSubject): ResultInterface
5454
if (isset($transactionResponse['messages']['message']['code'])) {
5555
$errorCodes[] = $transactionResponse['messages']['message']['code'];
5656
$errorMessages[] = $transactionResponse['messages']['message']['text'];
57-
} elseif ($transactionResponse['messages']['message']) {
57+
} elseif (isset($transactionResponse['messages']['message'])) {
5858
foreach ($transactionResponse['messages']['message'] as $message) {
5959
$errorCodes[] = $message['code'];
6060
$errorMessages[] = $message['description'];
6161
}
6262
} elseif (isset($transactionResponse['errors'])) {
6363
foreach ($transactionResponse['errors'] as $message) {
6464
$errorCodes[] = $message['errorCode'];
65-
$errorMessages[] = $message['errorCode'];
65+
$errorMessages[] = $message['errorText'];
6666
}
6767
}
6868

@@ -85,8 +85,10 @@ private function isResponseCodeAnError(array $transactionResponse): bool
8585
?? $transactionResponse['errors'][0]['errorCode']
8686
?? null;
8787

88-
return in_array($transactionResponse['responseCode'], [self::RESPONSE_CODE_APPROVED, self::RESPONSE_CODE_HELD])
89-
&& $code
88+
return !in_array($transactionResponse['responseCode'], [
89+
self::RESPONSE_CODE_APPROVED, self::RESPONSE_CODE_HELD
90+
])
91+
|| $code
9092
&& !in_array(
9193
$code,
9294
[

app/code/Magento/AuthorizenetAcceptjs/Test/Unit/Gateway/Validator/TransactionResponseValidatorTest.php

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515
use PHPUnit\Framework\MockObject\MockObject;
1616
use PHPUnit\Framework\TestCase;
1717

18+
/**
19+
* Tests for the transaction response validator
20+
*/
1821
class TransactionResponseValidatorTest extends TestCase
1922
{
2023
private const RESPONSE_CODE_APPROVED = 1;
2124
private const RESPONSE_CODE_HELD = 4;
25+
private const RESPONSE_CODE_DENIED = 2;
2226
private const RESPONSE_REASON_CODE_APPROVED = 1;
2327
private const RESPONSE_REASON_CODE_PENDING_REVIEW_AUTHORIZED = 252;
2428
private const RESPONSE_REASON_CODE_PENDING_REVIEW = 253;
29+
private const ERROR_CODE_AVS_MISMATCH = 27;
2530

2631
/**
2732
* @var ResultInterfaceFactory|MockObject
@@ -86,16 +91,6 @@ public function testValidateScenarios($transactionResponse, $isValid, $errorCode
8691
public function scenarioProvider()
8792
{
8893
return [
89-
// This validator only cares about successful edge cases so test for default behavior
90-
[
91-
[
92-
'responseCode' => 'foo',
93-
],
94-
true,
95-
[],
96-
[]
97-
],
98-
9994
// Test for acceptable reason codes
10095
[
10196
[
@@ -208,6 +203,29 @@ public function scenarioProvider()
208203
['foo'],
209204
['bar']
210205
],
206+
[
207+
[
208+
'responseCode' => self::RESPONSE_CODE_DENIED,
209+
'errors' => [
210+
[
211+
'errorCode' => self::ERROR_CODE_AVS_MISMATCH,
212+
'errorText' => 'bar'
213+
]
214+
]
215+
],
216+
false,
217+
[self::ERROR_CODE_AVS_MISMATCH],
218+
['bar']
219+
],
220+
// This validator only cares about successful edge cases so test for default behavior
221+
[
222+
[
223+
'responseCode' => 'foo',
224+
],
225+
false,
226+
[],
227+
[]
228+
],
211229
];
212230
}
213231
}

app/code/Magento/Backend/Block/Dashboard/Graph.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ public function __construct(
114114
\Magento\Backend\Helper\Dashboard\Data $dashboardData,
115115
array $data = []
116116
) {
117-
$this->_dashboardData = $dashboardData;
118117
parent::__construct($context, $collectionFactory, $data);
118+
$this->_dashboardData = $dashboardData;
119119
}
120120

121121
/**
@@ -131,7 +131,7 @@ protected function _getTabTemplate()
131131
/**
132132
* Set data rows
133133
*
134-
* @param array $rows
134+
* @param string $rows
135135
* @return void
136136
*/
137137
public function setDataRows($rows)
@@ -155,15 +155,14 @@ public function addSeries($seriesId, array $options)
155155
* Get series
156156
*
157157
* @param string $seriesId
158-
* @return array|false
158+
* @return array|bool
159159
*/
160160
public function getSeries($seriesId)
161161
{
162162
if (isset($this->_allSeries[$seriesId])) {
163163
return $this->_allSeries[$seriesId];
164-
} else {
165-
return false;
166164
}
165+
return false;
167166
}
168167

169168
/**
@@ -308,7 +307,7 @@ public function getChartUrl($directUrl = true)
308307

309308
if ($minvalue >= 0 && $maxvalue >= 0) {
310309
if ($maxvalue > 10) {
311-
$p = pow(10, $this->_getPow($maxvalue));
310+
$p = pow(10, $this->_getPow((int) $maxvalue));
312311
$maxy = ceil($maxvalue / $p) * $p;
313312
$yLabels = range($miny, $maxy, $p);
314313
} else {
@@ -349,7 +348,7 @@ public function getChartUrl($directUrl = true)
349348
$indexid = 0;
350349
foreach ($this->_axisLabels as $idx => $labels) {
351350
if ($idx == 'x') {
352-
$this->formatAxisLabelDate($idx, $timezoneLocal);
351+
$this->formatAxisLabelDate((string) $idx, (string) $timezoneLocal);
353352
$tmpstring = implode('|', $this->_axisLabels[$idx]);
354353
$valueBuffer[] = $indexid . ":|" . $tmpstring;
355354
} elseif ($idx == 'y') {
@@ -369,13 +368,12 @@ public function getChartUrl($directUrl = true)
369368
foreach ($params as $name => $value) {
370369
$p[] = $name . '=' . urlencode($value);
371370
}
372-
return self::API_URL . '?' . implode('&', $p);
373-
} else {
374-
$gaData = urlencode(base64_encode(json_encode($params)));
375-
$gaHash = $this->_dashboardData->getChartDataHash($gaData);
376-
$params = ['ga' => $gaData, 'h' => $gaHash];
377-
return $this->getUrl('adminhtml/*/tunnel', ['_query' => $params]);
371+
return (string) self::API_URL . '?' . implode('&', $p);
378372
}
373+
$gaData = urlencode(base64_encode(json_encode($params)));
374+
$gaHash = $this->_dashboardData->getChartDataHash($gaData);
375+
$params = ['ga' => $gaData, 'h' => $gaHash];
376+
return $this->getUrl('adminhtml/*/tunnel', ['_query' => $params]);
379377
}
380378

381379
/**
@@ -394,7 +392,7 @@ private function formatAxisLabelDate($idx, $timezoneLocal)
394392
switch ($this->getDataHelper()->getParam('period')) {
395393
case '24h':
396394
$this->_axisLabels[$idx][$_index] = $this->_localeDate->formatDateTime(
397-
$period->setTime($period->format('H'), 0, 0),
395+
$period->setTime((int) $period->format('H'), 0, 0),
398396
\IntlDateFormatter::NONE,
399397
\IntlDateFormatter::SHORT
400398
);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminDashboardPageIsVisibleActionGroup">
12+
<seeInCurrentUrl url="{{AdminDashboardPage.url}}" stepKey="seeDashboardUrl"/>
13+
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
14+
</actionGroup>
15+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageOnAdminLoginActionGroup.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<argument name="message" type="string" defaultValue="The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later." />
1414
<argument name="messageType" type="string" defaultValue="error" />
1515
</arguments>
16+
17+
<waitForElementVisible selector="{{AdminLoginMessagesSection.messageByType(messageType)}}" stepKey="waitForAdminLoginFormMessage" />
1618
<see userInput="{{message}}" selector="{{AdminLoginMessagesSection.messageByType(messageType)}}" stepKey="verifyMessage" />
1719
</actionGroup>
1820
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminForgotPasswordPage" url="admin/auth/forgotpassword/" area="admin" module="Magento_Backend">
12+
<section name="AdminForgotPasswordFormSection"/>
13+
</page>
14+
</pages>

app/code/Magento/Backend/Test/Mftf/Page/AdminLoginPage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="AdminLoginPage" url="admin" area="admin" module="Magento_Backend">
12+
<section name="AdminLoginMessagesSection"/>
1213
<section name="AdminLoginFormSection"/>
1314
</page>
1415
</pages>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminDashboardSection">
12+
<element name="dashboardDiagramContent" type="button" selector="#diagram_tab_content"/>
13+
<element name="dashboardDiagramOrderContentTab" type="block" selector="#diagram_tab_orders_content"/>
14+
<element name="dashboardDiagramAmounts" type="button" selector="#diagram_tab_amounts"/>
15+
<element name="dashboardDiagramAmountsContentTab" type="block" selector="#diagram_tab_amounts_content"/>
16+
<element name="dashboardDiagramTotals" type="text" selector="#diagram_tab_amounts_content"/>
17+
<element name="dashboardTotals" type="text" selector="//*[@class='dashboard-totals-label' and contains(text(), '{{columnName}}')]/../*[@class='dashboard-totals-value']" parameterized="true"/>
18+
</section>
19+
</sections>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminForgotPasswordFormSection">
12+
<element name="email" type="input" selector="#login-form input[name='email']"/>
13+
<element name="retrievePasswordButton" type="button" selector="#login-form button[type='submit']" timeout="30"/>
14+
</section>
15+
</sections>

app/code/Magento/Backend/Test/Mftf/Section/AdminLoginFormSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="username" type="input" selector="#username"/>
1313
<element name="password" type="input" selector="#login"/>
1414
<element name="signIn" type="button" selector=".actions .action-primary" timeout="30"/>
15+
<element name="forgotPasswordLink" type="button" selector=".action-forgotpassword" timeout="10"/>
1516
</section>
1617
</sections>

0 commit comments

Comments
 (0)