Skip to content

Commit 1d66ad7

Browse files
committed
MAGETWO-89039: Allow Validation of customer address attributes to include spaces
1 parent b33de4e commit 1d66ad7

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

app/code/Magento/Checkout/Test/Unit/Block/Checkout/AttributeMergerTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ class AttributeMergerTest extends \PHPUnit\Framework\TestCase
4040
*/
4141
private $attributeMerger;
4242

43+
/**
44+
* @inheritdoc
45+
*/
4346
protected function setUp()
4447
{
4548

@@ -87,7 +90,7 @@ public function testMerge($validationRule, $expectedValidation)
8790
'field' =>
8891
[
8992
'validation' => ['length' => true],
90-
]
93+
],
9194
]
9295
);
9396

@@ -104,7 +107,7 @@ public function testMerge($validationRule, $expectedValidation)
104107
*
105108
* @return array
106109
*/
107-
public function validationRulesDataProvider()
110+
public function validationRulesDataProvider(): array
108111
{
109112
return [
110113
['alpha', 'validate-alpha'],

app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/AbstractDataTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ public function validateInputRuleDataProvider()
256256
'mylabel',
257257
'alphanumeric',
258258
[
259-
\Zend_Validate_Alnum::NOT_ALNUM => '"mylabel" contains non-alphabetic or non-numeric characters.'
260-
]
259+
\Zend_Validate_Alnum::NOT_ALNUM => '"mylabel" contains non-alphabetic or non-numeric characters.',
260+
],
261261
],
262262
['abcqaz', 'mylabel', 'alphanumeric', true],
263263
['abc qaz', 'mylabel', 'alphanum-with-spaces', true],

app/code/Magento/Customer/Test/Unit/Ui/Component/Listing/Column/ValidationRulesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function setUp()
3333
* @return void
3434
* @dataProvider validationRulesDataProvider
3535
*/
36-
public function testGetValidationRules($validationRule, $validationClass)
36+
public function testGetValidationRules(string $validationRule, string $validationClass)
3737
{
3838
$expectsRules = [
3939
'required-entry' => true,
@@ -73,7 +73,7 @@ public function testGetValidationRulesWithOnlyRequiredRule()
7373
*
7474
* @return array
7575
*/
76-
public function validationRulesDataProvider()
76+
public function validationRulesDataProvider(): array
7777
{
7878
return [
7979
['alpha', 'validate-alpha'],

app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/TextTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ protected function tearDown()
4242

4343
/**
4444
* Test of string validation.
45+
*
4546
* @return void
4647
*/
4748
public function testValidateValueString()
@@ -53,6 +54,7 @@ public function testValidateValueString()
5354

5455
/**
5556
* Test of integer validation.
57+
*
5658
* @return void
5759
*/
5860
public function testValidateValueInteger()
@@ -65,6 +67,7 @@ public function testValidateValueInteger()
6567

6668
/**
6769
* Test without length validation.
70+
*
6871
* @return void
6972
*/
7073
public function testWithoutLengthValidation()
@@ -94,7 +97,7 @@ public function testWithoutLengthValidation()
9497
* @return void
9598
* @dataProvider alphanumDataProvider
9699
*/
97-
public function testAlphanumericValidation($value, $expectedResult)
100+
public function testAlphanumericValidation(string $value, $expectedResult)
98101
{
99102
$defaultAttributeData = [
100103
'store_label' => 'Test',
@@ -116,7 +119,7 @@ public function testAlphanumericValidation($value, $expectedResult)
116119
*
117120
* @return array
118121
*/
119-
public function alphanumDataProvider()
122+
public function alphanumDataProvider(): array
120123
{
121124
return [
122125
['QazWsx', true],
@@ -144,7 +147,7 @@ public function alphanumDataProvider()
144147
* @return void
145148
* @dataProvider alphanumWithSpacesDataProvider
146149
*/
147-
public function testAlphanumericValidationWithSpaces($value, $expectedResult)
150+
public function testAlphanumericValidationWithSpaces(string $value, $expectedResult)
148151
{
149152
$defaultAttributeData = [
150153
'store_label' => 'Test',
@@ -166,7 +169,7 @@ public function testAlphanumericValidationWithSpaces($value, $expectedResult)
166169
*
167170
* @return array
168171
*/
169-
public function alphanumWithSpacesDataProvider()
172+
public function alphanumWithSpacesDataProvider(): array
170173
{
171174
return [
172175
['QazWsx', true],

app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Frontend/DefaultFrontendTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public function testGetClassEmpty()
119119
* @return void
120120
* @dataProvider validationRulesDataProvider
121121
*/
122-
public function testGetClass($validationRule, $expectedClass)
122+
public function testGetClass(string $validationRule, string $expectedClass)
123123
{
124124
/** @var AbstractAttribute|MockObject $attributeMock */
125125
$attributeMock = $this->createAttributeMock();
@@ -203,7 +203,7 @@ public function testGetSelectOptions()
203203
*
204204
* @return array
205205
*/
206-
public function validationRulesDataProvider()
206+
public function validationRulesDataProvider(): array
207207
{
208208
return [
209209
['alphanumeric', 'validate-alphanum'],

0 commit comments

Comments
 (0)