@@ -42,6 +42,11 @@ class ListProductTest extends \PHPUnit_Framework_TestCase
42
42
*/
43
43
protected $ typeInstanceMock ;
44
44
45
+ /**
46
+ * @var \Magento\Framework\Url\Helper\Data | \PHPUnit_Framework_MockObject_MockObject
47
+ */
48
+ protected $ urlHelperMock ;
49
+
45
50
protected function setUp ()
46
51
{
47
52
$ objectManager = new \Magento \TestFramework \Helper \ObjectManager ($ this );
@@ -84,13 +89,17 @@ protected function setUp()
84
89
'' ,
85
90
false
86
91
);
92
+
93
+ $ this ->urlHelperMock = $ this ->getMockBuilder ('Magento\Framework\Url\Helper\Data ' )
94
+ ->disableOriginalConstructor ()->getMock ();
87
95
$ this ->block = $ objectManager ->getObject (
88
96
'Magento\Catalog\Block\Product\ListProduct ' ,
89
97
[
90
98
'registry ' => $ this ->registryMock ,
91
99
'layerResolver ' => $ layerResolver ,
92
100
'cartHelper ' => $ this ->cartHelperMock ,
93
- 'postDataHelper ' => $ this ->postDataHelperMock
101
+ 'postDataHelper ' => $ this ->postDataHelperMock ,
102
+ 'urlHelper ' => $ this ->urlHelperMock ,
94
103
]
95
104
);
96
105
}
@@ -152,7 +161,7 @@ public function testGetAddToCartPostParams()
152
161
$ this ->productMock ->expects ($ this ->once ())
153
162
->method ('getTypeInstance ' )
154
163
->will ($ this ->returnValue ($ this ->typeInstanceMock ));
155
- $ this ->postDataHelperMock ->expects ($ this ->once ())
164
+ $ this ->urlHelperMock ->expects ($ this ->once ())
156
165
->method ('getEncodedUrl ' )
157
166
->with ($ this ->equalTo ($ url ))
158
167
->will ($ this ->returnValue ($ uenc ));
0 commit comments