@@ -165,11 +165,19 @@ protected function setUp()
165
165
* @param array $links
166
166
* @param array $linkTypes
167
167
* @param array $expectedLinks
168
+ * @param array|null $tierPrice
168
169
* @dataProvider initializeDataProvider
169
170
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
170
171
*/
171
- public function testInitialize ($ isSingleStore , $ websiteIds , $ expWebsiteIds , $ links , $ linkTypes , $ expectedLinks )
172
- {
172
+ public function testInitialize (
173
+ $ isSingleStore ,
174
+ $ websiteIds ,
175
+ $ expWebsiteIds ,
176
+ $ links ,
177
+ $ linkTypes ,
178
+ $ expectedLinks ,
179
+ $ tierPrice = null
180
+ ) {
173
181
$ this ->linkTypeProviderMock ->expects ($ this ->once ())
174
182
->method ('getItems ' )
175
183
->willReturn ($ this ->assembleLinkTypes ($ linkTypes ));
@@ -184,6 +192,9 @@ public function testInitialize($isSingleStore, $websiteIds, $expWebsiteIds, $lin
184
192
'options ' => $ optionsData ,
185
193
'website_ids ' => $ websiteIds
186
194
];
195
+ if (!empty ($ tierPrice )) {
196
+ $ productData = array_merge ($ productData , ['tier_price ' => $ tierPrice ]);
197
+ }
187
198
$ attributeNonDate = $ this ->getMockBuilder (\Magento \Catalog \Model \ResourceModel \Eav \Attribute::class)
188
199
->disableOriginalConstructor ()
189
200
->getMock ();
@@ -270,10 +281,11 @@ public function testInitialize($isSingleStore, $websiteIds, $expWebsiteIds, $lin
270
281
$ this ->assertTrue ('sku ' == $ option2 ->getData ('product_sku ' ));
271
282
272
283
$ productLinks = $ this ->productMock ->getProductLinks ();
273
-
274
284
$ this ->assertCount (count ($ expectedLinks ), $ productLinks );
275
285
$ resultLinks = [];
276
286
287
+ $ this ->assertTrue (is_array ($ this ->productMock ->getData ('tier_price ' )));
288
+
277
289
foreach ($ productLinks as $ link ) {
278
290
$ this ->assertInstanceOf (ProductLink::class, $ link );
279
291
$ this ->assertEquals ('sku ' , $ link ->getSku ());
@@ -297,6 +309,7 @@ public function initializeDataProvider()
297
309
'links ' => [],
298
310
'linkTypes ' => ['related ' , 'upsell ' , 'crosssell ' ],
299
311
'expected_links ' => [],
312
+ 'tierPrice ' => [1 , 2 , 3 ],
300
313
],
301
314
[
302
315
'single_store ' => false ,
0 commit comments