Skip to content

Commit 165080a

Browse files
author
silinmykola
committed
fixes after a CR
1 parent bee641d commit 165080a

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/ValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ protected function setUp(): void
6666
$this->validator = $this->objectManagerHelper->getObject(
6767
Validator::class,
6868
[
69-
'validators' => $this->validators,
70-
'string' => new StringUtils()
69+
'string' => new StringUtils(),
70+
'validators' => $this->validators
7171
]
7272
);
7373
$this->validator->init($this->context);

app/code/Magento/Customer/Model/Metadata/Form/Text.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private function validateLength($value, AttributeMetadataInterface $attribute, a
124124
// validate length
125125
$label = __($attribute->getStoreLabel());
126126

127-
$length = $this->_string->strlen(trim((string) $value));
127+
$length = is_string($value) ? $this->_string->strlen(trim($value)) : 0;
128128

129129
$validateRules = $attribute->getValidationRules();
130130

app/code/Magento/Sitemap/Test/Unit/Model/SitemapTest.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -574,20 +574,16 @@ protected function getModelMock($mockBeforeSave = false)
574574
->setConstructorArgs($this->getModelConstructorArgs())
575575
->getMock();
576576

577-
$model->expects($this->any())
578-
->method('_getResource')
577+
$model->method('_getResource')
579578
->willReturn($this->resourceMock);
580579

581-
$model->expects($this->any())
582-
->method('_getCurrentDateTime')
580+
$model->method('_getCurrentDateTime')
583581
->willReturn('2012-12-21T00:00:00-08:00');
584582

585-
$model->expects($this->any())
586-
->method('_getBaseDir')
583+
$model->method('_getBaseDir')
587584
->willReturn('');
588585

589-
$model->expects($this->any())
590-
->method('_getDocumentRoot')
586+
$model->method('_getDocumentRoot')
591587
->willReturn('/project');
592588

593589
$model->setSitemapFilename('sitemap.xml');

0 commit comments

Comments
 (0)