Skip to content

Commit 80ebca4

Browse files
Merge pull request #7775 from magento-amigos/2.4-develop-prs
[Amigos] Community Contributions - 2.4-develop
2 parents 25822df + c35a2f9 commit 80ebca4

File tree

32 files changed

+765
-136
lines changed

32 files changed

+765
-136
lines changed

app/code/Magento/Backend/Model/Auth/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function refreshAcl($user = null)
130130
}
131131
if ($user->getReloadAclFlag()) {
132132
$user->unsetData('password');
133-
$user->setReloadAclFlag('0')->save();
133+
$user->setReloadAclFlag(0)->save();
134134
}
135135
return $this;
136136
}

app/code/Magento/Backend/etc/adminhtml/system.xml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,18 @@
317317
<label>Disable Email Communications</label>
318318
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
319319
</field>
320-
<field id="host" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
320+
<field id="transport" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
321+
<label>Transport</label>
322+
<source_model>Magento\Email\Model\Config\Source\SmtpTransportType</source_model>
323+
</field>
324+
<field id="host" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
321325
<label>Host</label>
322-
<comment>For Windows server only.</comment>
326+
<comment>For SMTP and Windows server only.</comment>
323327
</field>
324-
<field id="port" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
328+
<field id="port" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
325329
<label>Port (25)</label>
326330
<validate>validate-digits validate-digits-range digits-range-0-65535</validate>
327-
<comment>Please enter at least 0 and at most 65535 (For Windows server only).</comment>
331+
<comment>Please enter at least 0 and at most 65535 (For SMTP and Windows server only).</comment>
328332
</field>
329333
<field id="set_return_path" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
330334
<label>Set Return-Path</label>
@@ -338,6 +342,34 @@
338342
<field id="set_return_path">2</field>
339343
</depends>
340344
</field>
345+
<field id="username" translate="label comment" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
346+
<label>Username</label>
347+
<comment>Username</comment>
348+
<depends>
349+
<field id="transport">smtp</field>
350+
</depends>
351+
</field>
352+
<field id="password" translate="label comment" type="password" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
353+
<label>Password</label>
354+
<comment>Username</comment>
355+
<depends>
356+
<field id="transport">smtp</field>
357+
</depends>
358+
</field>
359+
<field id="auth" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
360+
<label>Auth</label>
361+
<source_model>Magento\Email\Model\Config\Source\SmtpAuthType</source_model>
362+
<depends>
363+
<field id="transport">smtp</field>
364+
</depends>
365+
</field>
366+
<field id="ssl" translate="label" type="select" sortOrder="120" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
367+
<label>SSL</label>
368+
<source_model>Magento\Email\Model\Config\Source\SmtpSslType</source_model>
369+
<depends>
370+
<field id="transport">smtp</field>
371+
</depends>
372+
</field>
341373
</group>
342374
<group id="upload_configuration" translate="label" type="text" sortOrder="1000" showInDefault="1" showInWebsite="1" showInStore="1">
343375
<label>Images Upload Configuration</label>

app/code/Magento/Catalog/Model/CategoryManagement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function move($categoryId, $parentId, $afterId = null)
128128
$afterId = ($afterId === null || $afterId > $lastId) ? $lastId : $afterId;
129129
}
130130
$parentPath = $parentCategory->getPath() ?? '';
131-
$path = $model->getPath();
131+
$path = $model->getPath() . '/';
132132
if ($path && strpos($parentPath, $path) === 0) {
133133
throw new \Magento\Framework\Exception\LocalizedException(
134134
__('Operation do not allow to move a parent category to any of children category')

app/code/Magento/Catalog/Test/Unit/Model/CategoryManagementTest.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ public function testGetTreeForAllScope()
201201

202202
public function testMove()
203203
{
204-
$categoryId = 2;
205-
$parentId = 1;
204+
$categoryId = 4;
205+
$parentId = 40;
206206
$afterId = null;
207207
$categoryMock = $this->getMockBuilder(Category::class)
208208
->setMockClassName('categoryMock')
@@ -214,18 +214,25 @@ public function testMove()
214214
->getMock();
215215

216216
$this->categoryRepositoryMock
217-
->expects($this->exactly(2))
217+
->expects($this->exactly(6))
218218
->method('get')
219219
->willReturnMap([
220220
[$categoryId, null, $categoryMock],
221221
[$parentId, null, $parentCategoryMock],
222222
]);
223-
$parentCategoryMock->expects($this->once())->method('hasChildren')->willReturn(true);
223+
$parentCategoryMock->expects($this->exactly(3))->method('hasChildren')
224+
->willReturn(true, false, false);
224225
$parentCategoryMock->expects($this->once())->method('getChildren')->willReturn('5,6,7');
225-
$categoryMock->expects($this->once())->method('getPath');
226-
$parentCategoryMock->expects($this->once())->method('getPath');
227-
$categoryMock->expects($this->once())->method('move')->with($parentId, '7');
226+
$categoryMock->expects($this->exactly(3))->method('getPath')
227+
->willReturnOnConsecutiveCalls('2/4', '2/3/4', '2/3/4');
228+
$parentCategoryMock->expects($this->exactly(3))->method('getPath')
229+
->willReturnOnConsecutiveCalls('2/40', '2/3/40', '2/3/44/40');
230+
$categoryMock->expects($this->exactly(3))->method('move')
231+
->withConsecutive([$parentId, '7'], [$parentId, null], [$parentId, null]);
232+
228233
$this->assertTrue($this->model->move($categoryId, $parentId, $afterId));
234+
$this->assertTrue($this->model->move($categoryId, $parentId));
235+
$this->assertTrue($this->model->move($categoryId, $parentId));
229236
}
230237

231238
public function testMoveWithException()
@@ -251,8 +258,8 @@ public function testMoveWithException()
251258
[$categoryId, null, $categoryMock],
252259
[$parentId, null, $parentCategoryMock],
253260
]);
254-
$categoryMock->expects($this->once())->method('getPath')->willReturn('test');
255-
$parentCategoryMock->expects($this->once())->method('getPath')->willReturn('test');
261+
$categoryMock->expects($this->once())->method('getPath')->willReturn('test/2');
262+
$parentCategoryMock->expects($this->once())->method('getPath')->willReturn('test/2/1');
256263
$this->model->move($categoryId, $parentId, $afterId);
257264
}
258265

app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayWhenChooseThreeAllowedCurrenciesTest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@
6666
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openNewOrderById">
6767
<argument name="orderId" value="$grabNewOrderNumber"/>
6868
</actionGroup>
69-
<see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="EUR / USD rate" stepKey="seeUSDandEURRate"/>
70-
<see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="RUB / USD rate:" stepKey="seeRUBandEURRate"/>
69+
<actionGroup ref="AdminAssertCurrencyInOrderActionGroup" stepKey="seeUSDandEURRate">
70+
<argument name="rate" value="EUR / USD rate"/>
71+
</actionGroup>
72+
<actionGroup ref="AdminAssertCurrencyInOrderActionGroup" stepKey="seeRUBandEURRate">
73+
<argument name="rate" value="RUB / USD rate:"/>
74+
</actionGroup>
7175
<grabMultiple selector="{{AdminOrderDetailsInformationSection.rate}}" stepKey="grabRates" />
7276
<assertEquals stepKey="assertRates">
7377
<actualResult type="variable">grabRates</actualResult>

app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminOrderRateDisplayedInOneLineTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@
7878
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderById">
7979
<argument name="orderId" value="$grabOrderNumber"/>
8080
</actionGroup>
81-
<see selector="{{AdminOrderDetailsInformationSection.orderInformationTable}}" userInput="EUR / USD rate" stepKey="seeEURandUSDRate"/>
81+
<actionGroup ref="AdminAssertCurrencyInOrderActionGroup" stepKey="seeEURandUSDRate">
82+
<argument name="rate" value="EUR / USD rate"/>
83+
</actionGroup>
8284
<grabMultiple selector="{{AdminOrderDetailsInformationSection.rate}}" stepKey="grabRate" />
8385
<assertEquals stepKey="assertSelectedCategories">
8486
<actualResult type="variable">grabRate</actualResult>

app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerCreateNewOrderSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="productPrice" type="text" selector=".even td[class=col-price] span[class=price]"/>
1515
<element name="productQty" type="input" selector="td[class=col-qty] .input-text.item-qty.admin__control-text"/>
1616
<element name="gridCell" type="text" selector="//div[contains(@id, 'order-items_grid')]//tbody[{{row}}]//td[count(//table[contains(@class, 'order-tables')]//th[contains(., '{{column}}')]/preceding-sibling::th) +1 ]" parameterized="true" timeout="30"/>
17+
<element name="itemsOrderedGridProductColumn" type="text" selector="//div[contains(@id, 'order-items_grid')]//span[contains(@id, 'title')]"/>
1718
</section>
1819
</sections>

app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerOrdersSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<section name="AdminEditCustomerOrdersSection">
1212
<element name="orderGrid" type="text" selector="#customer_orders_grid_table"/>
1313
<element name="orderIdInGrid" type="text" selector="//td[contains(., '{{orderId}}')]" parameterized="true"/>
14+
<element name="orderIdInGridUsingClassName" type="text" selector="//td[@class=' col-increment_id ' and contains(., '{{orderId}}')]" parameterized="true"/>
1415
</section>
1516
</sections>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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\Email\Model\Config\Source;
9+
10+
/**
11+
* Option provider for the SMTP Auth type
12+
*/
13+
class SmtpAuthType implements \Magento\Framework\Data\OptionSourceInterface
14+
{
15+
/**
16+
* The possible Auth types
17+
*
18+
* @codeCoverageIgnore
19+
* @return array
20+
*/
21+
public function toOptionArray(): array
22+
{
23+
return [
24+
['value' => 'none', 'label' => __('NONE')],
25+
['value' => 'plain', 'label' => __('PLAIN')],
26+
['value' => 'login', 'label' => __('LOGIN')],
27+
// ['value' => 'crammd5', 'label' => __('CRAM-MD5) '], // Requires laminas/laminas-crypt
28+
];
29+
}
30+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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\Email\Model\Config\Source;
9+
10+
/**
11+
* Option provider for SMTP SSL Type
12+
*/
13+
class SmtpSslType implements \Magento\Framework\Data\OptionSourceInterface
14+
{
15+
/**
16+
* The possible SSL types
17+
*
18+
* @codeCoverageIgnore
19+
* @return array
20+
*/
21+
public function toOptionArray(): array
22+
{
23+
return [
24+
['value' => 'none', 'label' => __('None')],
25+
['value' => 'ssl', 'label' => __('SSL')],
26+
['value' => 'tls', 'label' => __('TLS')],
27+
];
28+
}
29+
}

0 commit comments

Comments
 (0)