@@ -204,9 +204,12 @@ protected function setUp()
204
204
'' ,
205
205
false
206
206
);
207
- $ this ->_setColFactory = $ this ->getMock (
208
- '\Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory ' ,
209
- ['create ' ],
207
+ $ this ->attrSetColFactory = $ this ->getMock (
208
+ 'Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory ' ,
209
+ [
210
+ 'create ' ,
211
+ 'setEntityTypeFilter ' ,
212
+ ],
210
213
[],
211
214
'' ,
212
215
false
@@ -327,7 +330,7 @@ protected function setUp()
327
330
$ this ->collection ,
328
331
$ this ->exportConfig ,
329
332
$ this ->productFactory ,
330
- $ this ->_setColFactory ,
333
+ $ this ->attrSetColFactory ,
331
334
$ this ->categoryColFactory ,
332
335
$ this ->itemFactory ,
333
336
$ this ->optionColFactory ,
@@ -379,23 +382,25 @@ public function testExportCurPageEqualToLastBreakInternalCalls()
379
382
$ this ->abstractCollection ->expects ($ this ->once ())->method ('getCurPage ' )->willReturn ($ curPage );
380
383
$ this ->abstractCollection ->expects ($ this ->once ())->method ('getLastPageNumber ' )->willReturn ($ lastPage );
381
384
$ headers = ['headers ' ];
382
- $ this ->advancedPricing ->expects ($ this ->once ())->method ('_getHeaderColumns ' )->willReturn ($ headers );
383
- $ this ->writer ->expects ($ this ->once ())->method ('setHeaderCols ' )->with ($ headers );
385
+ $ this ->advancedPricing ->expects ($ this ->any ())->method ('_getHeaderColumns ' )->willReturn ($ headers );
386
+ $ this ->writer ->expects ($ this ->any ())->method ('setHeaderCols ' )->with ($ headers );
387
+ $ webSite = 'All Websites [USD] ' ;
388
+ $ userGroup = 'General ' ;
389
+ $ this ->advancedPricing ->expects ($ this ->any ())->method ('_getWebsiteCode ' )->willReturn ($ webSite );
390
+ $ this ->advancedPricing ->expects ($ this ->any ())->method ('_getCustomerGroupById ' )->willReturn ($ userGroup );
384
391
$ data = [
385
- 'sku ' => 'simpletest ' ,
386
- 'group_price_website ' => '0 ' ,
387
- 'group_price_customer_group ' => '1 ' ,
388
- 'group_price ' => '100 ' ,
389
- 'tier_price_website ' => '0 ' ,
390
- 'tier_price_customer_group ' => '2 ' ,
391
- 'tier_price_qty ' => '2 ' ,
392
- 'tier_price ' => '23 ' ,
392
+ [
393
+ 'sku ' => 'simpletest ' ,
394
+ 'group_price_website ' => $ webSite ,
395
+ 'group_price_customer_group ' => $ userGroup ,
396
+ 'group_price ' => '100 ' ,
397
+ 'tier_price_website ' => $ webSite ,
398
+ 'tier_price_customer_group ' => $ userGroup ,
399
+ 'tier_price_qty ' => '2 ' ,
400
+ 'tier_price ' => '23 ' ,
401
+ ]
393
402
];
394
403
$ this ->advancedPricing ->expects ($ this ->once ())->method ('getExportData ' )->willReturn ($ data );
395
- $ webSite = 'All Websites [USD] ' ;
396
- $ userGroup = 'General ' ;
397
- $ this ->advancedPricing ->expects ($ this ->once ())->method ('_getWebsiteCode ' )->willReturn ($ webSite );
398
- $ this ->advancedPricing ->expects ($ this ->once ())->method ('_getCustomerGroupById ' )->willReturn ($ userGroup );
399
404
$ exportData = [
400
405
'sku ' => 'simpletest ' ,
401
406
'group_price_website ' => $ webSite ,
@@ -406,6 +411,10 @@ public function testExportCurPageEqualToLastBreakInternalCalls()
406
411
'tier_price_qty ' => '2 ' ,
407
412
'tier_price ' => '23 ' ,
408
413
];
414
+ $ this ->advancedPricing
415
+ ->expects ($ this ->any ())
416
+ ->method ('correctExportData ' )
417
+ ->willReturn ($ exportData );
409
418
$ this ->writer ->expects ($ this ->once ())->method ('writeRow ' )->with ($ exportData );
410
419
$ this ->writer ->expects ($ this ->once ())->method ('getContents ' );
411
420
$ this ->advancedPricing ->export ();
0 commit comments