@@ -355,7 +355,6 @@ protected function _getModelMockForTestImportDataWithCustomBehaviour()
355
355
'attributes ' => [],
356
356
'defaults ' => [],
357
357
];
358
-
359
358
// entity adapter mock
360
359
$ modelMock = $ this ->getMock (
361
360
'Magento\CustomerImportExport\Model\Import\Address ' ,
@@ -377,11 +376,10 @@ protected function _getModelMockForTestImportDataWithCustomBehaviour()
377
376
true ,
378
377
true
379
378
);
380
-
379
+ //Adding behaviours
381
380
$ availableBehaviors = new \ReflectionProperty ($ modelMock , '_availableBehaviors ' );
382
381
$ availableBehaviors ->setAccessible (true );
383
382
$ availableBehaviors ->setValue ($ modelMock , $ this ->_availableBehaviors );
384
-
385
383
// mock to imitate data source model
386
384
$ dataSourceMock = $ this ->getMock (
387
385
'Magento\ImportExport\Model\ResourceModel\Import\Data ' ,
@@ -402,39 +400,33 @@ protected function _getModelMockForTestImportDataWithCustomBehaviour()
402
400
);
403
401
$ dataSourceModel ->setAccessible (true );
404
402
$ dataSourceModel ->setValue ($ modelMock , $ dataSourceMock );
405
-
406
403
// mock expects for entity adapter
407
404
$ modelMock ->expects ($ this ->any ())->method ('validateRow ' )->will ($ this ->returnValue (true ));
408
405
$ modelMock ->expects ($ this ->any ())
409
406
->method ('getErrorAggregator ' )
410
407
->will ($ this ->returnValue ($ this ->errorAggregator ));
411
-
412
408
$ modelMock ->expects ($ this ->any ())->method ('_prepareDataForUpdate ' )->will ($ this ->returnValue ($ updateResult ));
413
-
414
409
$ modelMock ->expects (
415
410
$ this ->any ()
416
411
)->method (
417
412
'_saveAddressEntities '
418
413
)->will (
419
414
$ this ->returnCallback ([$ this , 'validateSaveAddressEntities ' ])
420
415
);
421
-
422
416
$ modelMock ->expects ($ this ->any ())->method ('_saveAddressAttributes ' )->will ($ this ->returnValue ($ modelMock ));
423
-
424
417
$ modelMock ->expects ($ this ->any ())->method ('_saveCustomerDefaults ' )->will ($ this ->returnValue ($ modelMock ));
425
-
426
418
$ modelMock ->expects (
427
419
$ this ->any ()
428
420
)->method (
429
421
'_deleteAddressEntities '
430
422
)->will (
431
423
$ this ->returnCallback ([$ this , 'validateDeleteAddressEntities ' ])
432
424
);
433
-
434
425
$ modelMock ->expects ($ this ->any ())->method ('_mergeEntityAttributes ' )->will ($ this ->returnValue ([]));
435
426
$ modelMock ->expects ($ this ->any ())
436
427
->method ('getCustomerStorage ' )
437
428
->willReturn ($ this ->_createCustomerStorageMock ());
429
+
438
430
return $ modelMock ;
439
431
}
440
432
0 commit comments