@@ -104,7 +104,7 @@ public function testExecute()
104
104
105
105
/** @var \Magento\Catalog\Api\Data\ProductInterface|\PHPUnit_Framework_MockObject_MockObject $productMock */
106
106
$ productMock = $ this ->getMockBuilder (\Magento \Catalog \Api \Data \ProductInterface::class)
107
- ->setMethods (['isVisibleInCatalog ' ])
107
+ ->setMethods (['isVisibleInCatalog ' , ' isVisibleInSiteVisibility ' ])
108
108
->getMockForAbstractClass ();
109
109
110
110
$ this ->productRepositoryMock ->expects ($ this ->once ())
@@ -116,6 +116,10 @@ public function testExecute()
116
116
->method ('isVisibleInCatalog ' )
117
117
->willReturn (true );
118
118
119
+ $ productMock ->expects ($ this ->once ())
120
+ ->method ('isVisibleInSiteVisibility ' )
121
+ ->willReturn (true );
122
+
119
123
$ this ->registryMock ->expects ($ this ->once ())
120
124
->method ('register ' )
121
125
->with ('product ' , $ productMock , false );
@@ -193,7 +197,7 @@ public function testExecuteWithoutBlock()
193
197
194
198
/** @var \Magento\Catalog\Api\Data\ProductInterface|\PHPUnit_Framework_MockObject_MockObject $productMock */
195
199
$ productMock = $ this ->getMockBuilder (\Magento \Catalog \Api \Data \ProductInterface::class)
196
- ->setMethods (['isVisibleInCatalog ' ])
200
+ ->setMethods (['isVisibleInCatalog ' , ' isVisibleInSiteVisibility ' ])
197
201
->getMockForAbstractClass ();
198
202
199
203
$ this ->productRepositoryMock ->expects ($ this ->once ())
@@ -205,6 +209,10 @@ public function testExecuteWithoutBlock()
205
209
->method ('isVisibleInCatalog ' )
206
210
->willReturn (true );
207
211
212
+ $ productMock ->expects ($ this ->once ())
213
+ ->method ('isVisibleInSiteVisibility ' )
214
+ ->willReturn (true );
215
+
208
216
$ this ->registryMock ->expects ($ this ->once ())
209
217
->method ('register ' )
210
218
->with ('product ' , $ productMock , false );
@@ -269,7 +277,7 @@ public function testExecuteWithNoticeAndNoData()
269
277
270
278
/** @var \Magento\Catalog\Api\Data\ProductInterface|\PHPUnit_Framework_MockObject_MockObject $productMock */
271
279
$ productMock = $ this ->getMockBuilder (\Magento \Catalog \Api \Data \ProductInterface::class)
272
- ->setMethods (['isVisibleInCatalog ' ])
280
+ ->setMethods (['isVisibleInCatalog ' , ' isVisibleInSiteVisibility ' ])
273
281
->getMockForAbstractClass ();
274
282
275
283
$ this ->productRepositoryMock ->expects ($ this ->once ())
@@ -281,6 +289,10 @@ public function testExecuteWithNoticeAndNoData()
281
289
->method ('isVisibleInCatalog ' )
282
290
->willReturn (true );
283
291
292
+ $ productMock ->expects ($ this ->once ())
293
+ ->method ('isVisibleInSiteVisibility ' )
294
+ ->willReturn (true );
295
+
284
296
$ this ->registryMock ->expects ($ this ->once ())
285
297
->method ('register ' )
286
298
->with ('product ' , $ productMock , false );
@@ -391,7 +403,7 @@ public function testExecuteWithNonVisibleProduct()
391
403
392
404
/** @var \Magento\Catalog\Api\Data\ProductInterface|\PHPUnit_Framework_MockObject_MockObject $productMock */
393
405
$ productMock = $ this ->getMockBuilder (\Magento \Catalog \Api \Data \ProductInterface::class)
394
- ->setMethods (['isVisibleInCatalog ' ])
406
+ ->setMethods (['isVisibleInCatalog ' , ' isVisibleInSiteVisibility ' ])
395
407
->getMockForAbstractClass ();
396
408
397
409
$ this ->productRepositoryMock ->expects ($ this ->once ())
@@ -403,6 +415,10 @@ public function testExecuteWithNonVisibleProduct()
403
415
->method ('isVisibleInCatalog ' )
404
416
->willReturn (false );
405
417
418
+ $ productMock ->expects ($ this ->once ())
419
+ ->method ('isVisibleInSiteVisibility ' )
420
+ ->willReturn (true );
421
+
406
422
/** @var \Magento\Framework\Controller\Result\Forward|\PHPUnit_Framework_MockObject_MockObject $forwardMock */
407
423
$ forwardMock = $ this ->getMockBuilder (\Magento \Framework \Controller \Result \Forward::class)
408
424
->disableOriginalConstructor ()
0 commit comments