Skip to content

Commit 6ef26a7

Browse files
author
Yaroslav Onischenko
committed
MAGETWO-44427: Create Merchant Beta Pull Request
1 parent 1a49f22 commit 6ef26a7

File tree

2 files changed

+39
-38
lines changed

2 files changed

+39
-38
lines changed

app/code/Magento/CatalogUrlRewrite/Model/Product/Plugin/Import.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ public function afterImportData(Observer $observer)
172172
*
173173
* @return Import
174174
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
175+
* @SuppressWarnings(PHPMD.NpathComplexity)
175176
*/
176177
protected function _populateForUrlGeneration($rowData)
177178
{

app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Product/Plugin/ImportTest.php

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -438,15 +438,15 @@ public function testAfterImportData()
438438
[$this->products[0][ImportProduct::COL_SKU]],
439439
[$this->products[1][ImportProduct::COL_SKU]]
440440
)
441-
->will($this->onConsecutiveCalls($newSku[0], $newSku[1]));
441+
->will($this->onConsecutiveCalls($newSku[0], $newSku[1]));
442442
$this->importProduct
443443
->expects($this->exactly($productsCount))
444444
->method('getProductCategories')
445445
->withConsecutive(
446446
[$this->products[0][ImportProduct::COL_SKU]],
447447
[$this->products[1][ImportProduct::COL_SKU]]
448-
)->willReturn([]);
449-
$getProductWebsitesCallsCount = $productsCount*2;
448+
)->willReturn([]);
449+
$getProductWebsitesCallsCount = $productsCount * 2;
450450
$this->importProduct
451451
->expects($this->exactly($getProductWebsitesCallsCount))
452452
->method('getProductWebsites')
@@ -529,43 +529,43 @@ public function testAfterImportData()
529529
],
530530
[
531531
' AND entity_id = ?)',
532-
$newSku[0]['entity_id'],
533-
],
534-
[
535-
'(store_id = ?',
536-
$storeIds[0],
537-
],
538-
[
539-
' AND entity_id = ?)',
540-
$newSku[1]['entity_id'],
532+
$newSku[0]['entity_id'],
533+
],
534+
[
535+
'(store_id = ?',
536+
$storeIds[0],
537+
],
538+
[
539+
' AND entity_id = ?)',
540+
$newSku[1]['entity_id'],
541541
]
542542
);
543-
$this->connection
544-
->expects($this->once())
545-
->method('fetchAll')
546-
->willReturn([]);
547-
$this->select->expects($this->any())->method('from')->willReturnSelf();
548-
$this->select->expects($this->any())->method('where')->willReturnSelf();
549-
550-
$this->urlFinder->expects($this->any())->method('findAllByData')->willReturn([]);
551-
552-
$this->productUrlPathGenerator->expects($this->any())->method('getUrlPathWithSuffix')
553-
->willReturn('urlPathWithSuffix');
554-
$this->productUrlPathGenerator->expects($this->any())->method('getUrlPath')
555-
->willReturn('urlPath');
556-
$this->productUrlPathGenerator->expects($this->any())->method('getCanonicalUrlPath')
557-
->willReturn('canonicalUrlPath');
558-
559-
$this->urlRewrite->expects($this->any())->method('setStoreId')->willReturnSelf();
560-
$this->urlRewrite->expects($this->any())->method('setEntityId')->willReturnSelf();
561-
$this->urlRewrite->expects($this->any())->method('setEntityType')->willReturnSelf();
562-
$this->urlRewrite->expects($this->any())->method('setRequestPath')->willReturnSelf();
563-
$this->urlRewrite->expects($this->any())->method('setTargetPath')->willReturnSelf();
564-
$this->urlRewrite->expects($this->any())->method('getTargetPath')->willReturn('targetPath');
565-
$this->urlRewrite->expects($this->any())->method('getStoreId')
566-
->willReturnOnConsecutiveCalls(0, 'not global');
567-
568-
$this->urlRewriteFactory->expects($this->any())->method('create')->willReturn($this->urlRewrite);
543+
$this->connection
544+
->expects($this->once())
545+
->method('fetchAll')
546+
->willReturn([]);
547+
$this->select->expects($this->any())->method('from')->willReturnSelf();
548+
$this->select->expects($this->any())->method('where')->willReturnSelf();
549+
550+
$this->urlFinder->expects($this->any())->method('findAllByData')->willReturn([]);
551+
552+
$this->productUrlPathGenerator->expects($this->any())->method('getUrlPathWithSuffix')
553+
->willReturn('urlPathWithSuffix');
554+
$this->productUrlPathGenerator->expects($this->any())->method('getUrlPath')
555+
->willReturn('urlPath');
556+
$this->productUrlPathGenerator->expects($this->any())->method('getCanonicalUrlPath')
557+
->willReturn('canonicalUrlPath');
558+
559+
$this->urlRewrite->expects($this->any())->method('setStoreId')->willReturnSelf();
560+
$this->urlRewrite->expects($this->any())->method('setEntityId')->willReturnSelf();
561+
$this->urlRewrite->expects($this->any())->method('setEntityType')->willReturnSelf();
562+
$this->urlRewrite->expects($this->any())->method('setRequestPath')->willReturnSelf();
563+
$this->urlRewrite->expects($this->any())->method('setTargetPath')->willReturnSelf();
564+
$this->urlRewrite->expects($this->any())->method('getTargetPath')->willReturn('targetPath');
565+
$this->urlRewrite->expects($this->any())->method('getStoreId')
566+
->willReturnOnConsecutiveCalls(0, 'not global');
567+
568+
$this->urlRewriteFactory->expects($this->any())->method('create')->willReturn($this->urlRewrite);
569569

570570
$productUrls = [
571571
'targetPath-0' => $this->urlRewrite,

0 commit comments

Comments
 (0)