Skip to content

Commit 2d0fb70

Browse files
committed
Repair failing unit test
1 parent 0da86ab commit 2d0fb70

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,14 @@ public function testGenerateProductUrlRewrites()
138138
->willReturn(1);
139139
$category->expects($this->any())
140140
->method('getData')
141-
->with('save_rewrites_history')
142-
->willReturn(true);
141+
->withConsecutive(
142+
[$this->equalTo('save_rewrites_history')],
143+
[$this->equalTo('initial_setup_flag')]
144+
)
145+
->willReturnOnConsecutiveCalls(
146+
true,
147+
null
148+
);
143149

144150
/* @var \Magento\Catalog\Model\Category|\PHPUnit_Framework_MockObject_MockObject $childCategory1 */
145151
$childCategory1 = $this->getMockBuilder(\Magento\Catalog\Model\Category::class)
@@ -175,6 +181,7 @@ public function testGenerateProductUrlRewrites()
175181
->method('addIdFilter')
176182
->willReturnSelf();
177183
$productCollection->expects($this->any())->method('setStoreId')->willReturnSelf();
184+
$productCollection->expects($this->any())->method('addStoreFilter')->willReturnSelf();
178185
$productCollection->expects($this->any())->method('addAttributeToSelect')->willReturnSelf();
179186
$iterator = new \ArrayIterator([]);
180187
$productCollection->expects($this->any())->method('getIterator')->will($this->returnValue($iterator));

0 commit comments

Comments
 (0)