7
7
8
8
use Magento \Framework \App \Bootstrap ;
9
9
use Magento \Framework \App \Filesystem \DirectoryList ;
10
+ use Magento \ImportExport \Model \Export \Adapter \AbstractAdapter ;
10
11
use Magento \Store \Model \Store ;
11
12
12
13
/**
@@ -62,6 +63,11 @@ abstract class AbstractProductExportImportTestCase extends \PHPUnit\Framework\Te
62
63
'tax_class_id ' ,
63
64
];
64
65
66
+ /**
67
+ * @var AbstractAdapter
68
+ */
69
+ private $ writer ;
70
+
65
71
/**
66
72
* @inheritdoc
67
73
*/
@@ -367,7 +373,7 @@ protected function executeImportReplaceTest(
367
373
* Export products in the system.
368
374
*
369
375
* @param \Magento\CatalogImportExport\Model\Export\Product|null $exportProduct
370
- * @return string Return exported file name
376
+ * @return string Return exported file
371
377
*/
372
378
private function exportProducts (\Magento \CatalogImportExport \Model \Export \Product $ exportProduct = null )
373
379
{
@@ -376,12 +382,11 @@ private function exportProducts(\Magento\CatalogImportExport\Model\Export\Produc
376
382
$ exportProduct = $ exportProduct ?: $ this ->objectManager ->create (
377
383
\Magento \CatalogImportExport \Model \Export \Product::class
378
384
);
379
- $ exportProduct ->setWriter (
380
- \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
381
- \Magento \ImportExport \Model \Export \Adapter \Csv::class,
382
- ['fileSystem ' => $ this ->fileSystem , 'destination ' => $ csvfile ]
383
- )
385
+ $ this ->writer = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
386
+ \Magento \ImportExport \Model \Export \Adapter \Csv::class,
387
+ ['fileSystem ' => $ this ->fileSystem , 'destination ' => $ csvfile ]
384
388
);
389
+ $ exportProduct ->setWriter ($ this ->writer );
385
390
$ this ->assertNotEmpty ($ exportProduct ->export ());
386
391
387
392
return $ csvfile ;
0 commit comments