Skip to content

Commit a07357f

Browse files
author
Dmytro Aponasenko
committed
MTA-2343: Move all test data to repositories
1 parent a359c47 commit a07357f

File tree

9 files changed

+32
-16
lines changed

9 files changed

+32
-16
lines changed

dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
<constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage" />
100100
</variation>
101101
<variation name="CreateBundleProductEntityTestVariation5">
102-
<data name="issue" xsi:type="string">Bug: MAGETWO-35342</data>
103102
<data name="description" xsi:type="string">Create fixed bundle with all types options</data>
104103
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
105104
<data name="product/data/name" xsi:type="string">BundleProduct %isolation%</data>

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Attribute/Edit/AttributeForm.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,28 @@ public function getData(FixtureInterface $fixture = null, SimpleElement $element
7676
}
7777
}
7878

79-
return $data;
79+
return $this->removeEmptyValues($data);
80+
}
81+
82+
/**
83+
* Remove recursive all empty values in array.
84+
*
85+
* @param mixed $input
86+
* @return mixed
87+
*/
88+
protected function removeEmptyValues($input)
89+
{
90+
if (!is_array($input)) {
91+
return $input;
92+
}
93+
$filteredArray = [];
94+
foreach ($input as $key => $value) {
95+
if ($value) {
96+
$filteredArray[$key] = $this->removeEmptyValues($value);
97+
}
98+
}
99+
100+
return $filteredArray;
80101
}
81102

82103
/**

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<testCase name="Magento\Catalog\Test\TestCase\Product\UpdateSimpleProductEntityTest">
1010
<variation name="UpdateSimpleProductEntityTestVariation1">
1111
<data name="description" xsi:type="string">Update visibility to Catalog, Search</data>
12-
<data name="initialProduct/dataset" xsi:type="string">simple_with_tier_price</data>
12+
<data name="initialProduct/dataset" xsi:type="string">product_with_category</data>
1313
<data name="product/data/name" xsi:type="string">Test simple product %isolation%</data>
1414
<data name="product/data/sku" xsi:type="string">test_simple_product_%isolation%</data>
1515
<data name="product/data/price/value" xsi:type="string">245.00</data>
@@ -143,7 +143,6 @@
143143
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>
144144
<data name="product/data/sku" xsi:type="string">sku_simple_product_%isolation%</data>
145145
<data name="product/data/price/value" xsi:type="string">1.99</data>
146-
<data name="product/data/price/dataset" xsi:type="string">-</data>
147146
<data name="product/data/attribute_set_id/dataset" xsi:type="string">default</data>
148147
<constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" />
149148
<constraint name="Magento\Catalog\Test\Constraint\AssertProductInCategory" />

dev/tests/functional/tests/app/Magento/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
use Magento\Mtf\Constraint\AbstractConstraint;
1111

1212
/**
13-
* Class AssertCatalogPriceRuleNoticeMessage
13+
* Assert notice message after saving catalog price rule.
1414
*/
1515
class AssertCatalogPriceRuleNoticeMessage extends AbstractConstraint
1616
{
1717
const NOTICE_MESSAGE_RULES = 'We found updated rules that are not applied.';
18-
const NOTICE_MESSAGE_APPLY = ' Please, click Apply Rules in order to see immediate effect in the catalog.';
18+
const NOTICE_MESSAGE_APPLY = ' Please click "Apply Rules" to update your catalog.';
1919

2020
/**
2121
* Assert that message "We found updated rules that are not applied..."

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Cart/AbstractCartItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AbstractCartItem extends Block
4040
*
4141
* @var string
4242
*/
43-
protected $qty = './/input[@type="number" and @title="Quantity"]';
43+
protected $qty = './/input[@data-role="cart-item-qty"]';
4444

4545
/**
4646
* Cart item sub-total xpath selector

dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Fixture/GroupedProduct.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<field name="type_id" />
7272
<field name="attribute_set_id" group="product-details" source="Magento\Catalog\Test\Fixture\Product\AttributeSetId" />
7373
<field name="website_ids" group="websites" />
74-
<field name="price" source="Magento\GroupedProduct\Test\Repository\GroupedProduct\Price" />
74+
<field name="price" source="Magento\Catalog\Test\Fixture\Product\Price" repository="Magento\GroupedProduct\Test\Repository\GroupedProduct\Price" />
7575
<field name="checkout_data" group="null" repository="Magento\GroupedProduct\Test\Repository\GroupedProduct\CheckoutData" />
7676
<field name="tax_class" />
7777
</fixture>

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ public function updateProductsData(array $products)
234234
['element' => $this->_rootElement->find($this->itemsBlock)]
235235
);
236236
foreach ($products as $product) {
237-
$items->getItemProductByName($product->getName())
238-
->fill($product->getDataFieldConfig('checkout_data')['source']);
237+
$items->getItemProductByName($product->getName())->fillCheckoutData($product->getCheckoutData());
239238
}
240239
$this->updateItems();
241240
}

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Items/ItemProduct.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
use Magento\Mtf\Block\Form;
1010
use Magento\Mtf\Client\Locator;
11-
use Magento\Mtf\Fixture\FixtureInterface;
1211
use Magento\Mtf\Client\Element\SimpleElement;
1312

1413
/**
@@ -78,15 +77,14 @@ public function getCheckoutData(array $fields, $currency = '$')
7877
}
7978

8079
/**
81-
* Fill the root form.
80+
* Fill the root form with checkout data.
8281
*
83-
* @param FixtureInterface $fixture
82+
* @param array $data
8483
* @param SimpleElement|null $element
8584
* @return $this
8685
*/
87-
public function fill(FixtureInterface $fixture, SimpleElement $element = null)
86+
public function fillCheckoutData(array $data, SimpleElement $element = null)
8887
{
89-
$data = $fixture->getData();
9088
if (isset($data['cartItem'])) {
9189
unset($data['cartItem']);
9290
}

dev/tests/functional/tests/app/Magento/Sales/Test/Repository/OrderInjectable/Price.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd">
9-
<repository class="Magento\Sales\Test\Repository\OrderInjectable">
9+
<repository class="Magento\Sales\Test\Repository\OrderInjectable\Price">
1010
<dataset name="default_with_discount">
1111
<field name="subtotal" xsi:type="string">560</field>
1212
<field name="discount" xsi:type="string">280</field>

0 commit comments

Comments
 (0)