Skip to content

Commit 37cf56d

Browse files
author
Andreas Mautz
authored
Merge branch '2.4-develop' into fix-for-25674
2 parents cf1b084 + c7a2450 commit 37cf56d

File tree

425 files changed

+14976
-4579
lines changed

Some content is hidden

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

425 files changed

+14976
-4579
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<field id="search_suggestion_enabled">1</field>
6161
</depends>
6262
</field>
63-
<field id="search_suggestion_count_results_enabled" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1">
63+
<field id="search_suggestion_count_results_enabled" translate="label comment" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="1">
6464
<label>Show Results Count for Each Suggestion</label>
6565
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
6666
<comment>When you enable this option your site may slow down.</comment>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<label>Advanced Reporting</label>
1616
<comment><![CDATA[This service provides a dynamic suite of reports with rich insights about your business.
1717
Your reports can be accessed securely on a personalized dashboard outside of the admin panel by clicking on the
18-
"Go to Advanced Reporting" link. </br> For more information, see our <a href="https://magento.com/legal/terms/cloud-terms">
18+
"Go to Advanced Reporting" link. </br> For more information, see our <a target="_blank" href="https://magento.com/legal/terms/cloud-terms">
1919
terms and conditions</a>.]]></comment>
2020
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
2121
<label>Advanced Reporting Service</label>
@@ -29,7 +29,7 @@
2929
<frontend_model>Magento\Analytics\Block\Adminhtml\System\Config\CollectionTimeLabel</frontend_model>
3030
<backend_model>Magento\Analytics\Model\Config\Backend\CollectionTime</backend_model>
3131
</field>
32-
<field id="vertical" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
32+
<field id="vertical" translate="hint label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
3333
<hint>Industry Data</hint>
3434
<label>Industry</label>
3535
<comment>In order to personalize your Advanced Reporting experience, please select your industry.</comment>

app/code/Magento/AsynchronousOperations/view/adminhtml/ui_component/bulk_listing.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<actionsColumn name="actions" class="\Magento\AsynchronousOperations\Ui\Component\Listing\Column\Actions">
9393
<settings>
9494
<indexField>id</indexField>
95-
<label>Action</label>
95+
<label translate="true">Action</label>
9696
</settings>
9797
</actionsColumn>
9898
</columns>

app/code/Magento/Backend/Block/System/Account/Edit/Form.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct(
6868
}
6969

7070
/**
71-
* {@inheritdoc}
71+
* @inheritdoc
7272
*/
7373
protected function _prepareForm()
7474
{
@@ -114,7 +114,7 @@ protected function _prepareForm()
114114
'name' => 'password',
115115
'label' => __('New Password'),
116116
'title' => __('New Password'),
117-
'class' => 'validate-admin-password admin__control-text'
117+
'class' => 'validate-admin-password'
118118
]
119119
);
120120

@@ -124,7 +124,7 @@ protected function _prepareForm()
124124
[
125125
'name' => 'password_confirmation',
126126
'label' => __('Password Confirmation'),
127-
'class' => 'validate-cpassword admin__control-text'
127+
'class' => 'validate-cpassword'
128128
]
129129
);
130130

@@ -152,7 +152,7 @@ protected function _prepareForm()
152152
'label' => __('Your Password'),
153153
'id' => self::IDENTITY_VERIFICATION_PASSWORD_FIELD,
154154
'title' => __('Your Password'),
155-
'class' => 'validate-current-password required-entry admin__control-text',
155+
'class' => 'validate-current-password required-entry',
156156
'required' => true
157157
]
158158
);

app/code/Magento/Backend/Model/Menu/Item/Validator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
namespace Magento\Backend\Model\Menu\Item;
77

88
/**
9+
* Class Validator
10+
*
11+
* @package Magento\Backend\Model\Menu\Item
912
* @api
1013
* @since 100.0.2
1114
*/
@@ -49,7 +52,7 @@ public function __construct()
4952

5053
$attributeValidator = new \Zend_Validate();
5154
$attributeValidator->addValidator(new \Zend_Validate_StringLength(['min' => 3]));
52-
$attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_]+$/'));
55+
$attributeValidator->addValidator(new \Zend_Validate_Regex('/^[A-Za-z0-9\/_\-]+$/'));
5356

5457
$textValidator = new \Zend_Validate_StringLength(['min' => 3, 'max' => 50]);
5558

@@ -101,6 +104,7 @@ private function checkMenuItemIsRemoved($data)
101104

102105
/**
103106
* Check that menu item contains all required data
107+
*
104108
* @param array $data
105109
*
106110
* @throws \BadMethodCallException
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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\Backend\Test\Unit\Helper;
9+
10+
use Magento\Backend\Helper\Js;
11+
use PHPUnit\Framework\TestCase;
12+
13+
/**
14+
* Class JsTest
15+
*
16+
* Testing decoding serialized grid data
17+
*/
18+
class JsTest extends TestCase
19+
{
20+
/**
21+
* @var Js
22+
*/
23+
private $helper;
24+
25+
/**
26+
* Set Up
27+
*/
28+
protected function setUp()
29+
{
30+
$this->helper = new Js();
31+
}
32+
33+
/**
34+
* Test decoding the serialized input
35+
*
36+
* @dataProvider getEncodedDataProvider
37+
*
38+
* @param string $encoded
39+
* @param array $expected
40+
*/
41+
public function testDecodeGridSerializedInput(string $encoded, array $expected)
42+
{
43+
$this->assertEquals($expected, $this->helper->decodeGridSerializedInput($encoded));
44+
}
45+
46+
/**
47+
* Get serialized grid input
48+
*
49+
* @return array
50+
*/
51+
public function getEncodedDataProvider(): array
52+
{
53+
return [
54+
'Decoding empty serialized string' => [
55+
'',
56+
[]
57+
],
58+
'Decoding a simplified serialized string' => [
59+
'1&2&3&4',
60+
[1, 2, 3, 4]
61+
],
62+
'Decoding encoded serialized string' => [
63+
'2=dGVzdC1zdHJpbmc=',
64+
[
65+
2 => [
66+
'test-string' => ''
67+
]
68+
]
69+
],
70+
'Decoding multiple encoded serialized strings' => [
71+
'2=dGVzdC1zdHJpbmc=&3=bmV3LXN0cmluZw==',
72+
[
73+
2 => [
74+
'test-string' => ''
75+
],
76+
3 => [
77+
'new-string' => ''
78+
]
79+
]
80+
]
81+
];
82+
}
83+
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
' resource="Test_Value::value"/></menu></config>',
1111
[
1212
"Element 'add', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " .
13-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
13+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
1414
"Element 'add', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
1515
],
1616
],
@@ -20,7 +20,7 @@
2020
'resource="Test_Value::value"/></menu></config>',
2121
[
2222
"Element 'add', attribute 'action': [facet 'pattern'] The value 'ad' is not accepted by the " .
23-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
23+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
2424
"Element 'add', attribute 'action': 'ad' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
2525
],
2626
],
@@ -31,7 +31,7 @@
3131
'</menu></config>',
3232
[
3333
"Element 'add', attribute 'action': [facet 'pattern'] The value 'adm$#@inhtml/notification' is not " .
34-
"accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
34+
"accepted by the pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
3535
"Element 'add', attribute 'action': 'adm$#@inhtml/notification' is not a valid value of the atomic " .
3636
"type 'typeAction'.\nLine: 1\n"
3737
],
@@ -452,7 +452,7 @@
452452
'<?xml version="1.0"?><config><menu><update action="" ' . 'id="Test_Value::some_value"/></menu></config>',
453453
[
454454
"Element 'update', attribute 'action': [facet 'pattern'] The value '' is not accepted by the " .
455-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
455+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
456456
"Element 'update', attribute 'action': '' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
457457
],
458458
],
@@ -462,7 +462,7 @@
462462
'resource="Test_Value::value"/></menu></config>',
463463
[
464464
"Element 'update', attribute 'action': [facet 'pattern'] The value 'v' is not accepted by the " .
465-
"pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
465+
"pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
466466
"Element 'update', attribute 'action': 'v' is not a valid value of the atomic type 'typeAction'.\nLine: 1\n"
467467
],
468468
],
@@ -471,7 +471,7 @@
471471
'id="Test_Value::some_value"/></menu></config>',
472472
[
473473
"Element 'update', attribute 'action': [facet 'pattern'] The value '/@##gt;' is not " .
474-
"accepted by the pattern '[a-zA-Z0-9/_]{3,}'.\nLine: 1\n",
474+
"accepted by the pattern '[a-zA-Z0-9/_\-]{3,}'.\nLine: 1\n",
475475
"Element 'update', attribute 'action': '/@##gt;' is not a valid value of the atomic" .
476476
" type 'typeAction'.\nLine: 1\n"
477477
],

app/code/Magento/Backend/etc/menu.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
</xs:documentation>
101101
</xs:annotation>
102102
<xs:restriction base="xs:string">
103-
<xs:pattern value="[a-zA-Z0-9/_]{3,}" />
103+
<xs:pattern value="[a-zA-Z0-9/_\-]{3,}" />
104104
</xs:restriction>
105105
</xs:simpleType>
106106

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
declare(strict_types=1);
8+
9+
namespace Magento\Captcha\Test\Unit\Model\Config;
10+
11+
use PHPUnit\Framework\TestCase;
12+
use Magento\Captcha\Helper\Data as HelperData;
13+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
14+
use Magento\Captcha\Model\Config\Font;
15+
16+
class FontTest extends TestCase
17+
{
18+
/**
19+
* @var ObjectManagerHelper
20+
*/
21+
private $objectManagerHelper;
22+
23+
/**
24+
* @var Font
25+
*/
26+
private $model;
27+
28+
/**
29+
* @var HelperData|\PHPUnit_Framework_MockObject_MockObject
30+
*/
31+
private $helperDataMock;
32+
33+
/**
34+
* Setup Environment For Testing
35+
*/
36+
protected function setUp()
37+
{
38+
$this->helperDataMock = $this->createMock(HelperData::class);
39+
40+
$this->objectManagerHelper = new ObjectManagerHelper($this);
41+
42+
$this->model = $this->objectManagerHelper->getObject(
43+
Font::class,
44+
[
45+
'captchaData' => $this->helperDataMock
46+
]
47+
);
48+
}
49+
50+
/**
51+
* Test toOptionArray() with data provider below
52+
*
53+
* @param array $fonts
54+
* @param array $expectedResult
55+
* @dataProvider toOptionArrayDataProvider
56+
*/
57+
public function testToOptionArray($fonts, $expectedResult)
58+
{
59+
$this->helperDataMock->expects($this->any())->method('getFonts')
60+
->willReturn($fonts);
61+
62+
$this->assertEquals($expectedResult, $this->model->toOptionArray());
63+
}
64+
65+
/**
66+
* Data Provider for testing toOptionArray()
67+
*
68+
* @return array
69+
*/
70+
public function toOptionArrayDataProvider()
71+
{
72+
return [
73+
'Empty get font' => [
74+
[],
75+
[]
76+
],
77+
'Get font result' => [
78+
[
79+
'arial' => [
80+
'label' => 'Arial',
81+
'path' => '/www/magento/fonts/arial.ttf'
82+
],
83+
'verdana' => [
84+
'label' => 'Verdana',
85+
'path' => '/www/magento/fonts/verdana.ttf'
86+
]
87+
],
88+
[
89+
[
90+
'label' => 'Arial',
91+
'value' => 'arial'
92+
],
93+
[
94+
'label' => 'Verdana',
95+
'value' => 'verdana'
96+
]
97+
]
98+
]
99+
];
100+
}
101+
}

0 commit comments

Comments
 (0)