@@ -81,6 +81,22 @@ protected function setUp()
81
81
->method ('getBlock ' )
82
82
->will ($ this ->returnValue ($ this ->priceBox ));
83
83
84
+ $ storeManager = $ this ->getMockBuilder ('\Magento\Store\Model\StoreManagerInterface ' )
85
+ ->setMethods (['getStore ' , 'getCode ' ])
86
+ ->getMockForAbstractClass ();
87
+ $ storeManager ->expects ($ this ->any ())->method ('getStore ' )->willReturnSelf ();
88
+
89
+ $ appState = $ this ->getMockBuilder ('\Magento\Framework\App\State ' )
90
+ ->disableOriginalConstructor ()
91
+ ->getMock ();
92
+
93
+ $ resolver = $ this ->getMockBuilder ('\Magento\Framework\View\Element\Template\File\Resolver ' )
94
+ ->disableOriginalConstructor ()
95
+ ->getMock ();
96
+
97
+ $ urlBuilder = $ this ->getMockBuilder ('\Magento\Framework\UrlInterface ' )
98
+ ->getMockForAbstractClass ();
99
+
84
100
$ scopeConfigMock = $ this ->getMockForAbstractClass ('Magento\Framework\App\Config\ScopeConfigInterface ' );
85
101
$ context = $ this ->getMock ('Magento\Framework\View\Element\Template\Context ' , [], [], '' , false );
86
102
$ context ->expects ($ this ->any ())
@@ -98,6 +114,17 @@ protected function setUp()
98
114
$ context ->expects ($ this ->any ())
99
115
->method ('getScopeConfig ' )
100
116
->will ($ this ->returnValue ($ scopeConfigMock ));
117
+ $ context ->expects ($ this ->any ())
118
+ ->method ('getStoreManager ' )
119
+ ->will ($ this ->returnValue ($ storeManager ));
120
+ $ context ->expects ($ this ->any ())
121
+ ->method ('getAppState ' )
122
+ ->will ($ this ->returnValue ($ appState ));
123
+ $ context ->expects ($ this ->any ())
124
+ ->method ('getResolver ' )
125
+ ->will ($ this ->returnValue ($ resolver ));
126
+ $ context ->expects ($ this ->any ())
127
+ ->method ('getUrlBuilder ' )->will ($ this ->returnValue ($ urlBuilder ));
101
128
102
129
$ this ->rendererPool = $ this ->getMockBuilder ('Magento\Framework\Pricing\Render\RendererPool ' )
103
130
->disableOriginalConstructor ()
@@ -332,4 +359,9 @@ public function testHidePrice()
332
359
333
360
$ this ->assertEmpty ($ this ->object ->toHtml ());
334
361
}
362
+
363
+ public function testGetCacheKeyInfo ()
364
+ {
365
+ $ this ->assertArrayHasKey ('display_minimal_price ' , $ this ->object ->getCacheKeyInfo ());
366
+ }
335
367
}
0 commit comments