Skip to content

Commit ef8db47

Browse files
committed
MTO-138: [Test] Export Advanced Pricing
- Stabilization
1 parent d078233 commit ef8db47

File tree

3 files changed

+9
-24
lines changed

3 files changed

+9
-24
lines changed

dev/tests/functional/tests/app/Magento/AdvancedPricingImportExport/Test/TestCase/ExportAdvancedPricingTest.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function __inject(
106106
* @param string|null $configData
107107
* @param Website|null $website
108108
* @param array $advancedPricingAttributes
109-
* @param array $currencies
109+
* @param string|null $currencyCustomWebsite
110110
* @return array
111111
*/
112112
public function test(
@@ -115,7 +115,7 @@ public function test(
115115
$configData = null,
116116
Website $website = null,
117117
array $advancedPricingAttributes = [],
118-
array $currencies = []
118+
$currencyCustomWebsite = null
119119
) {
120120
$this->configData = $configData;
121121

@@ -128,7 +128,7 @@ public function test(
128128

129129
if ($website) {
130130
$website->persist();
131-
$this->setupCurrencyForCustomWebsite($website, $currencies[0]);
131+
$this->setupCurrencyForCustomWebsite($website, $currencyCustomWebsite);
132132
}
133133
$products = $this->prepareProducts($products, $website);
134134
$this->adminExportIndex->open();
@@ -160,24 +160,16 @@ public function test(
160160
* Setup currency of custom website.
161161
*
162162
* @param Website $website
163-
* @param array $currency
163+
* @param string $currencyDataset
164164
* @return void
165165
*/
166-
private function setupCurrencyForCustomWebsite($website, $currency)
166+
private function setupCurrencyForCustomWebsite($website, $currencyDataset)
167167
{
168168
$configFixture = $this->fixtureFactory->createByCode(
169169
'configData',
170170
[
171+
'dataset' => $currencyDataset,
171172
'data' => [
172-
'currency/options/allow' => [
173-
'value' => $currency['allowedCurrencies']
174-
],
175-
'currency/options/base' => [
176-
'value' => $currency['baseCurrency']
177-
],
178-
'currency/options/default' => [
179-
'value' => $currency['defaultCurrency']
180-
],
181173
'scope' => [
182174
'fixture' => $website,
183175
'scope_type' => 'website',

dev/tests/functional/tests/app/Magento/AdvancedPricingImportExport/Test/TestCase/ExportAdvancedPricingTest.xml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,7 @@
5757
<item name="dataset" xsi:type="string">simple_with_tier_price</item>
5858
</data>
5959
<data name="website/dataset" xsi:type="string">custom_website</data>
60-
<data name="currencies" xsi:type="array">
61-
<item name="0" xsi:type="array">
62-
<item name="allowedCurrencies" xsi:type="array">
63-
<item name="0" xsi:type="string">EUR</item>
64-
</item>
65-
<item name="defaultCurrency" xsi:type="string">EUR</item>
66-
<item name="baseCurrency" xsi:type="string">EUR</item>
67-
</item>
68-
</data>
60+
<data name="currencyCustomWebstite/dataset" xsi:type="string">config_currency_custom_website_eur</data>
6961
<data name="currencySymbol" xsi:type="array">
7062
<item name="mainWebsite" xsi:type="string">$</item>
7163
<item name="customWebsite" xsi:type="string">€</item>

dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/TierPrice.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ public function getData($key = null)
114114
*/
115115
private function prepareWebsite()
116116
{
117-
if (isset($this->fixtureData['data']['website']['dataset'])) {
117+
if (is_array($this->fixtureData['data']['website'])
118+
&& isset($this->fixtureData['data']['website']['dataset'])) {
118119
/** @var Website $website */
119120
$this->website = $this->fixtureFactory->createByCode(
120121
'website',

0 commit comments

Comments
 (0)