File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
app/code/Magento/Swatches
Test/Unit/Block/Product/Renderer Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -390,6 +390,6 @@ protected function getHtmlOutput()
390
390
*/
391
391
public function getMediaCallback ()
392
392
{
393
- return $ this ->getBaseUrl () . self ::MEDIA_CALLBACK_ACTION ;
393
+ return $ this ->getUrl ( self ::MEDIA_CALLBACK_ACTION , [ ' _secure ' => $ this -> getRequest ()-> isSecure ()]) ;
394
394
}
395
395
}
Original file line number Diff line number Diff line change @@ -311,7 +311,13 @@ public function testGetJsonSwatchConfigWithoutVisualImageType()
311
311
312
312
public function testGetMediaCallback ()
313
313
{
314
- $ this ->urlBuilder ->expects ($ this ->once ())->method ('getBaseUrl ' )->willReturn ('http://magento.com/ ' );
315
- $ this ->assertContains (Configurable::MEDIA_CALLBACK_ACTION , $ this ->configurable ->getMediaCallback ());
314
+ $ url = 'http://localhost/ ' . Configurable::MEDIA_CALLBACK_ACTION ;
315
+
316
+ $ this ->urlBuilder ->expects ($ this ->once ())
317
+ ->method ('getUrl ' )
318
+ ->with (Configurable::MEDIA_CALLBACK_ACTION )
319
+ ->willReturn ($ url );
320
+
321
+ $ this ->assertEquals ($ url , $ this ->configurable ->getMediaCallback ());
316
322
}
317
323
}
You can’t perform that action at this time.
0 commit comments