Skip to content

Commit f08c195

Browse files
committed
MAGETWO-94455: User agent exception not setting the correct templates for product pages
1 parent a2ac9be commit f08c195

File tree

1 file changed

+21
-9
lines changed
  • app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Listing/Collector

1 file changed

+21
-9
lines changed

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Listing/Collector/ImageTest.php

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,18 @@ class ImageTest extends \PHPUnit\Framework\TestCase
4646
/** @var DesignLoader|\PHPUnit_Framework_MockObject_MockObject */
4747
private $designLoader;
4848

49+
/**
50+
* @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
51+
*/
52+
protected $objectManager;
53+
4954
/**
5055
* @inheritdoc
5156
*/
5257
public function setUp()
5358
{
59+
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
60+
5461
$this->imageFactory = $this->getMockBuilder(ImageFactory::class)
5562
->disableOriginalConstructor()
5663
->getMock();
@@ -68,15 +75,20 @@ public function setUp()
6875
$this->storeManager = $this->createMock(StoreManagerInterface::class);
6976
$this->design = $this->createMock(DesignInterface::class);
7077
$this->designLoader = $this->createMock(DesignLoader::class);
71-
$this->model = new Image(
72-
$this->imageFactory,
73-
$this->state,
74-
$this->storeManager,
75-
$this->design,
76-
$this->imageInterfaceFactory,
77-
$this->imageCodes,
78-
$this->designLoader
79-
);
78+
79+
$this->model = $this->objectManager
80+
->getObject(
81+
Image::class,
82+
[
83+
'imageFactory' => $this->imageFactory,
84+
'state' => $this->state,
85+
'storeManager' => $this->storeManager,
86+
'design' => $this->design,
87+
'imageRenderInfoFactory' => $this->imageInterfaceFactory,
88+
'imageCodes' => $this->imageCodes,
89+
'designLoader' => $this->designLoader,
90+
]
91+
);
8092
}
8193

8294
public function testGet()

0 commit comments

Comments
 (0)