8 use Magento\ImportExport\Test\Fixture\ImportData;
9 use Magento\Mtf\Fixture\FixtureFactory;
10 use Magento\Mtf\TestStep\TestStepInterface;
22 private $fixtureFactory;
36 private $changeCurrency;
44 FixtureFactory $fixtureFactory,
46 $changeCurrency =
false 48 $this->fixtureFactory = $fixtureFactory;
49 $this->
import = $import;
50 $this->changeCurrency = $changeCurrency;
60 if ($this->changeCurrency ===
true) {
61 $currency = $this->
import->getDataFieldConfig(
'import_file')[
'source']
62 ->getValue()[
'template'][
'websiteCurrency'];
63 $entities = $this->
import->getDataFieldConfig(
'import_file')[
'source']->getEntities();
64 foreach ($entities as
$entity) {
65 $websites =
$entity->getDataFieldConfig(
'website_ids')[
'source']->getWebsites();
66 $configFixture = $this->fixtureFactory->createByCode(
70 'currency/options/allow' => [
71 'value' => [$currency]
73 'currency/options/base' => [
76 'currency/options/default' => [
81 'scope_type' =>
'website',
82 'website_id' =>
$websites[0]->getWebsiteId(),
83 'set_level' =>
'website',
88 $configFixture->persist();
91 return [
'import' => $this->import];
__construct(FixtureFactory $fixtureFactory, ImportData $import, $changeCurrency=false)