Skip to content

Commit 397fbc5

Browse files
committed
MP2E-86: After product import, Category product manual sorting has been changed
1 parent e673a67 commit 397fbc5

File tree

2 files changed

+40
-38
lines changed

2 files changed

+40
-38
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,7 @@ class Product extends AbstractEntity
821821
* @throws \Magento\Framework\Exception\FileSystemException
822822
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
823823
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
824+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
824825
*/
825826
public function __construct(
826827
\Magento\Framework\Json\Helper\Data $jsonHelper,
@@ -3293,7 +3294,7 @@ private function findImageByHash(array $images, string $hash): string
32933294
*/
32943295
private function getProductMediaPath(): string
32953296
{
3296-
return $this->joinFilePaths($this->getMediaBasePath(), 'catalog','product');
3297+
return $this->joinFilePaths($this->getMediaBasePath(), 'catalog', 'product');
32973298
}
32983299

32993300
/**
@@ -3314,7 +3315,7 @@ private function getMediaBasePath(): string
33143315
/**
33153316
* Joins two paths and remove redundant directory separator
33163317
*
3317-
* @param string ...$paths
3318+
* @param array $paths
33183319
* @return string
33193320
*/
33203321
private function joinFilePaths(...$paths): string

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
* @SuppressWarnings(PHPMD.TooManyFields)
6363
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
6464
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
65+
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
6566
*/
6667
class ProductTest extends AbstractImportTestCase
6768
{
@@ -672,8 +673,8 @@ protected function _initImagesArrayKeys()
672673
}
673674

674675
/**
675-
* @return void
676-
*/
676+
* @return void
677+
*/
677678
public function testSaveProductAttributes(): void
678679
{
679680
$testTable = 'test_table';
@@ -755,8 +756,8 @@ public function testIsAttributeValidAssertAttrInvalid($attrParams, $rowData): vo
755756
}
756757

757758
/**
758-
* @return void
759-
*/
759+
* @return void
760+
*/
760761
public function testGetMultipleValueSeparatorDefault(): void
761762
{
762763
$this->setPropertyValue($this->importProduct, '_parameters', null);
@@ -767,8 +768,8 @@ public function testGetMultipleValueSeparatorDefault(): void
767768
}
768769

769770
/**
770-
* @return void
771-
*/
771+
* @return void
772+
*/
772773
public function testGetMultipleValueSeparatorFromParameters(): void
773774
{
774775
$expectedSeparator = 'value';
@@ -787,8 +788,8 @@ public function testGetMultipleValueSeparatorFromParameters(): void
787788
}
788789

789790
/**
790-
* @return void
791-
*/
791+
* @return void
792+
*/
792793
public function testGetEmptyAttributeValueConstantDefault(): void
793794
{
794795
$this->setPropertyValue($this->importProduct, '_parameters', null);
@@ -799,8 +800,8 @@ public function testGetEmptyAttributeValueConstantDefault(): void
799800
}
800801

801802
/**
802-
* @return void
803-
*/
803+
* @return void
804+
*/
804805
public function testGetEmptyAttributeValueConstantFromParameters(): void
805806
{
806807
$expectedSeparator = '__EMPTY__VALUE__TEST__';
@@ -819,8 +820,8 @@ public function testGetEmptyAttributeValueConstantFromParameters(): void
819820
}
820821

821822
/**
822-
* @return void
823-
*/
823+
* @return void
824+
*/
824825
public function testDeleteProductsForReplacement(): void
825826
{
826827
$importProduct = $this->getMockBuilder(Product::class)
@@ -841,8 +842,8 @@ public function testDeleteProductsForReplacement(): void
841842
}
842843

843844
/**
844-
* @return void
845-
*/
845+
* @return void
846+
*/
846847
public function testGetMediaGalleryAttributeIdIfNotSetYet(): void
847848
{
848849
// reset possible existing id
@@ -914,8 +915,8 @@ public function testValidateRow($rowScope, $oldSku, $expectedResult, $behaviour
914915
}
915916

916917
/**
917-
* @return void
918-
*/
918+
* @return void
919+
*/
919920
public function testValidateRowDeleteBehaviourAddRowErrorCall(): void
920921
{
921922
$importProduct = $this->getMockBuilder(Product::class)
@@ -940,8 +941,8 @@ public function testValidateRowDeleteBehaviourAddRowErrorCall(): void
940941
}
941942

942943
/**
943-
* @return void
944-
*/
944+
* @return void
945+
*/
945946
public function testValidateRowValidatorCheck(): void
946947
{
947948
$messages = ['validator message'];
@@ -1111,8 +1112,8 @@ public function testValidateRowCheckSpecifiedSku($sku, $expectedError): void
11111112
}
11121113

11131114
/**
1114-
* @return void
1115-
*/
1115+
* @return void
1116+
*/
11161117
public function testValidateRowProcessEntityIncrement(): void
11171118
{
11181119
$count = 0;
@@ -1129,8 +1130,8 @@ public function testValidateRowProcessEntityIncrement(): void
11291130
}
11301131

11311132
/**
1132-
* @return void
1133-
*/
1133+
* @return void
1134+
*/
11341135
public function testValidateRowValidateExistingProductTypeAddNewSku(): void
11351136
{
11361137
$importProduct = $this->createModelMockWithErrorAggregator(
@@ -1178,8 +1179,8 @@ public function testValidateRowValidateExistingProductTypeAddNewSku(): void
11781179
}
11791180

11801181
/**
1181-
* @return void
1182-
*/
1182+
* @return void
1183+
*/
11831184
public function testValidateRowValidateExistingProductTypeAddErrorRowCall(): void
11841185
{
11851186
$sku = 'sku';
@@ -1260,8 +1261,8 @@ public function testValidateRowValidateNewProductTypeAddRowErrorCall(
12601261
}
12611262

12621263
/**
1263-
* @return void
1264-
*/
1264+
* @return void
1265+
*/
12651266
public function testValidateRowValidateNewProductTypeGetNewSkuCall(): void
12661267
{
12671268
$sku = 'sku';
@@ -1307,8 +1308,8 @@ public function testValidateRowValidateNewProductTypeGetNewSkuCall(): void
13071308
}
13081309

13091310
/**
1310-
* @return void
1311-
*/
1311+
* @return void
1312+
*/
13121313
public function testValidateDefaultScopeNotValidAttributesResetSku(): void
13131314
{
13141315
$this->validator->expects($this->once())->method('isAttributeValid')->willReturn(false);
@@ -1320,8 +1321,8 @@ public function testValidateDefaultScopeNotValidAttributesResetSku(): void
13201321
}
13211322

13221323
/**
1323-
* @return void
1324-
*/
1324+
* @return void
1325+
*/
13251326
public function testValidateRowSetAttributeSetCodeIntoRowData(): void
13261327
{
13271328
$sku = 'sku';
@@ -1371,8 +1372,8 @@ public function testValidateRowSetAttributeSetCodeIntoRowData(): void
13711372
}
13721373

13731374
/**
1374-
* @return void
1375-
*/
1375+
* @return void
1376+
*/
13761377
public function testValidateValidateOptionEntity(): void
13771378
{
13781379
$sku = 'sku';
@@ -1418,8 +1419,8 @@ public function testGetImagesFromRow($rowData, $expectedResult): void
14181419
}
14191420

14201421
/**
1421-
* @return void
1422-
*/
1422+
* @return void
1423+
*/
14231424
public function testParseAttributesWithoutWrappedValuesWillReturnsLowercasedAttributeCodes(): void
14241425
{
14251426
$attributesData = 'PARAM1=value1,param2=value2';
@@ -1439,8 +1440,8 @@ public function testParseAttributesWithoutWrappedValuesWillReturnsLowercasedAttr
14391440
}
14401441

14411442
/**
1442-
* @return void
1443-
*/
1443+
* @return void
1444+
*/
14441445
public function testParseAttributesWithWrappedValuesWillReturnsLowercasedAttributeCodes(): void
14451446
{
14461447
$attribute1 = $this->getMockBuilder(AbstractAttribute::class)->disableOriginalConstructor()

0 commit comments

Comments
 (0)