@@ -104,7 +104,7 @@ public function testExecute()
104104
105105 /** @var \Magento\Catalog\Api\Data\ProductInterface|\PHPUnit_Framework_MockObject_MockObject $productMock */
106106 $ productMock = $ this ->getMockBuilder (\Magento \Catalog \Api \Data \ProductInterface::class)
107- ->setMethods (['isVisibleInCatalog ' ])
107+ ->setMethods (['isVisibleInCatalog ' , ' isVisibleInSiteVisibility ' ])
108108 ->getMockForAbstractClass ();
109109
110110 $ this ->productRepositoryMock ->expects ($ this ->once ())
@@ -116,6 +116,10 @@ public function testExecute()
116116 ->method ('isVisibleInCatalog ' )
117117 ->willReturn (true );
118118
119+ $ productMock ->expects ($ this ->once ())
120+ ->method ('isVisibleInSiteVisibility ' )
121+ ->willReturn (true );
122+
119123 $ this ->registryMock ->expects ($ this ->once ())
120124 ->method ('register ' )
121125 ->with ('product ' , $ productMock , false );
@@ -193,7 +197,7 @@ public function testExecuteWithoutBlock()
193197
194198 /** @var \Magento\Catalog\Api\Data\ProductInterface|\PHPUnit_Framework_MockObject_MockObject $productMock */
195199 $ productMock = $ this ->getMockBuilder (\Magento \Catalog \Api \Data \ProductInterface::class)
196- ->setMethods (['isVisibleInCatalog ' ])
200+ ->setMethods (['isVisibleInCatalog ' , ' isVisibleInSiteVisibility ' ])
197201 ->getMockForAbstractClass ();
198202
199203 $ this ->productRepositoryMock ->expects ($ this ->once ())
@@ -205,6 +209,10 @@ public function testExecuteWithoutBlock()
205209 ->method ('isVisibleInCatalog ' )
206210 ->willReturn (true );
207211
212+ $ productMock ->expects ($ this ->once ())
213+ ->method ('isVisibleInSiteVisibility ' )
214+ ->willReturn (true );
215+
208216 $ this ->registryMock ->expects ($ this ->once ())
209217 ->method ('register ' )
210218 ->with ('product ' , $ productMock , false );
@@ -269,7 +277,7 @@ public function testExecuteWithNoticeAndNoData()
269277
270278 /** @var \Magento\Catalog\Api\Data\ProductInterface|\PHPUnit_Framework_MockObject_MockObject $productMock */
271279 $ productMock = $ this ->getMockBuilder (\Magento \Catalog \Api \Data \ProductInterface::class)
272- ->setMethods (['isVisibleInCatalog ' ])
280+ ->setMethods (['isVisibleInCatalog ' , ' isVisibleInSiteVisibility ' ])
273281 ->getMockForAbstractClass ();
274282
275283 $ this ->productRepositoryMock ->expects ($ this ->once ())
@@ -281,6 +289,10 @@ public function testExecuteWithNoticeAndNoData()
281289 ->method ('isVisibleInCatalog ' )
282290 ->willReturn (true );
283291
292+ $ productMock ->expects ($ this ->once ())
293+ ->method ('isVisibleInSiteVisibility ' )
294+ ->willReturn (true );
295+
284296 $ this ->registryMock ->expects ($ this ->once ())
285297 ->method ('register ' )
286298 ->with ('product ' , $ productMock , false );
@@ -391,7 +403,7 @@ public function testExecuteWithNonVisibleProduct()
391403
392404 /** @var \Magento\Catalog\Api\Data\ProductInterface|\PHPUnit_Framework_MockObject_MockObject $productMock */
393405 $ productMock = $ this ->getMockBuilder (\Magento \Catalog \Api \Data \ProductInterface::class)
394- ->setMethods (['isVisibleInCatalog ' ])
406+ ->setMethods (['isVisibleInCatalog ' , ' isVisibleInSiteVisibility ' ])
395407 ->getMockForAbstractClass ();
396408
397409 $ this ->productRepositoryMock ->expects ($ this ->once ())
@@ -403,6 +415,10 @@ public function testExecuteWithNonVisibleProduct()
403415 ->method ('isVisibleInCatalog ' )
404416 ->willReturn (false );
405417
418+ $ productMock ->expects ($ this ->once ())
419+ ->method ('isVisibleInSiteVisibility ' )
420+ ->willReturn (true );
421+
406422 /** @var \Magento\Framework\Controller\Result\Forward|\PHPUnit_Framework_MockObject_MockObject $forwardMock */
407423 $ forwardMock = $ this ->getMockBuilder (\Magento \Framework \Controller \Result \Forward::class)
408424 ->disableOriginalConstructor ()
0 commit comments