Skip to content

Commit 92a27c5

Browse files
committed
MAGETWO-70856: [GITHUB] Issue with Product Import - "Category has not been created. URL key for specified store already exists" #8304
1 parent 4f7db0c commit 92a27c5

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/CategoryProcessUrlRewriteSavingObserverTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function setUp()
7474
'hasData',
7575
'getParentId',
7676
'dataHasChangedFor',
77-
'getIsChangedProductList',
77+
'getChangedProductIds',
7878
]);
7979
$this->observer->expects($this->any())
8080
->method('getEvent')
@@ -131,6 +131,7 @@ public function testExecuteHasStoreId()
131131
->willReturn(2);
132132
$this->category->expects($this->once())
133133
->method('hasData')
134+
->with('store_id')
134135
->willReturn(true);
135136
$this->storeGroupFactory->expects($this->never())
136137
->method('create');
@@ -143,8 +144,8 @@ public function testExecuteHasStoreId()
143144
]
144145
);
145146
$this->category->expects($this->once())
146-
->method('getIsChangedProductList')
147-
->willReturn(false);
147+
->method('getChangedProductIds')
148+
->willReturn([]);
148149

149150
$this->categoryProcessUrlRewriteSavingObserver->execute($this->observer);
150151
}
@@ -169,8 +170,8 @@ public function testExecuteHasNotChanges()
169170
]
170171
);
171172
$this->category->expects($this->once())
172-
->method('getIsChangedProductList')
173-
->willReturn(false);
173+
->method('getChangedProductIds')
174+
->willReturn([]);
174175
$this->databaseMapPoolMock->expects($this->never())
175176
->method('resetMap');
176177

@@ -197,8 +198,8 @@ public function testExecuteHasChanges()
197198
]
198199
);
199200
$this->category->expects($this->any())
200-
->method('getIsChangedProductList')
201-
->willReturn(false);
201+
->method('getChangedProductIds')
202+
->willReturn([]);
202203

203204
$result1 = ['test'];
204205
$this->categoryUrlRewriteGeneratorMock->expects($this->once())

0 commit comments

Comments
 (0)