Skip to content

Commit d7405ff

Browse files
author
Magento CICD
authored
Merge c30a05a into MAGETWO-63116_JSON_ERROR
2 parents 505b1a7 + c30a05a commit d7405ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+929
-94
lines changed

app/code/Magento/Catalog/Model/Category.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ class Category extends \Magento\Catalog\Model\AbstractModel implements
116116
* URL rewrite model
117117
*
118118
* @var \Magento\UrlRewrite\Model\UrlRewrite
119+
* @deprecated since 2.2.0
119120
*/
120121
protected $_urlRewrite;
121122

app/code/Magento/CatalogUrlRewrite/Model/Map/DatabaseMapInterface.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66
namespace Magento\CatalogUrlRewrite\Model\Map;
77

8-
use Magento\Framework\DB\Select;
9-
108
/**
119
* Interface for a mysql data type of a map
1210
*

app/code/Magento/Indexer/Model/Processor/Handler.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

app/code/Magento/UrlRewrite/Model/MergeDataProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* This class is to be used as a container for new generated url rewrites by adding new ones using merge method
1212
* Removes duplicates for a set/array of Url Rewrites based on the unique key of the url_rewrites table
1313
*
14+
* @api
1415
*/
1516
class MergeDataProvider
1617
{

app/code/Magento/UrlRewrite/Model/StorageInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66
namespace Magento\UrlRewrite\Model;
77

8+
/**
9+
* @api
10+
*/
811
interface StorageInterface extends UrlFinderInterface, UrlPersistInterface
912
{
1013
}

app/code/Magento/UrlRewrite/Model/UrlFinderInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/**
99
* Url Finder Interface
10+
* @api
1011
*/
1112
interface UrlFinderInterface
1213
{

app/code/Magento/UrlRewrite/Model/UrlPersistInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/**
99
* Url Persist Interface
10+
* @api
1011
*/
1112
interface UrlPersistInterface
1213
{

app/code/Magento/UrlRewrite/Service/V1/Data/UrlRewrite.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
/**
1313
* Data abstract class for url storage
14+
* @api
1415
*/
1516
class UrlRewrite extends AbstractSimpleObject
1617
{

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ class ProductForm extends FormSections
7272
*/
7373
protected $newAttributeModal = '.product_form_product_form_add_attribute_modal_create_new_attribute_modal';
7474

75+
/**
76+
* Website checkbox xpath selector.
77+
*
78+
* @var string
79+
*/
80+
protected $websiteCheckbox = '//label[text()="%s"]/../input';
81+
7582
/**
7683
* Fill the product form.
7784
*
@@ -138,6 +145,17 @@ public function openSection($sectionName)
138145
return $this;
139146
}
140147

148+
/**
149+
* Unassign product from website by website name.
150+
*
151+
* @param string $name
152+
*/
153+
public function unassignFromWebsite($name)
154+
{
155+
$this->openSection('websites');
156+
$this->_rootElement->find(sprintf($this->websiteCheckbox, $name), Locator::SELECTOR_XPATH)->click();
157+
}
158+
141159
/**
142160
* Wait page to load.
143161
*

dev/tests/functional/tests/app/Magento/Catalog/Test/Page/Adminhtml/CatalogProductEdit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<block name="addAttributeModal" class="Magento\Catalog\Test\Block\Adminhtml\Product\Modal\AddAttribute" locator=".product_form_product_form_add_attribute_modal" strategy="css selector"/>
1313
<block name="newAttributeModal" class="Magento\Catalog\Test\Block\Adminhtml\Product\Modal\NewAttribute" locator=".product_form_product_form_add_attribute_modal_create_new_attribute_modal" strategy="css selector"/>
1414
<block name="productForm" class="Magento\Catalog\Test\Block\Adminhtml\Product\ProductForm" locator="[id='page:main-container']" strategy="css selector"/>
15+
<block name="storeSwitcherBlock" class="Magento\Store\Test\Block\Switcher" locator=".store-switcher" strategy="css selector" />
1516
</page>
1617
</config>

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/CustomOptions.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,30 @@
592592
</field>
593593
</dataset>
594594

595+
<dataset name="two_fixed_drop_down_options">
596+
<field name="0" xsi:type="array">
597+
<item name="title" xsi:type="string">custom menu</item>
598+
<item name="is_require" xsi:type="string">No</item>
599+
<item name="type" xsi:type="string">Select/Drop-down</item>
600+
<item name="options" xsi:type="array">
601+
<item name="0" xsi:type="array">
602+
<item name="title" xsi:type="string">first</item>
603+
<item name="price" xsi:type="string">1</item>
604+
<item name="price_type" xsi:type="string">Fixed</item>
605+
<item name="sku" xsi:type="string">sku_radio_buttons_drop_down_1</item>
606+
<item name="sort_order" xsi:type="string">0</item>
607+
</item>
608+
<item name="1" xsi:type="array">
609+
<item name="title" xsi:type="string">second</item>
610+
<item name="price" xsi:type="string">2</item>
611+
<item name="price_type" xsi:type="string">Fixed</item>
612+
<item name="sku" xsi:type="string">sku_radio_buttons_drop_down_2</item>
613+
<item name="sort_order" xsi:type="string">0</item>
614+
</item>
615+
</item>
616+
</field>
617+
</dataset>
618+
595619
<dataset name="drop_down_with_three_options">
596620
<field name="0" xsi:type="array">
597621
<item name="title" xsi:type="string">custom option drop down %isolation%</item>

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Product/TierPrice.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,16 @@
101101
</item>
102102
</field>
103103
</dataset>
104+
105+
<dataset name="custom_for_qty_1">
106+
<field name="0" xsi:type="array">
107+
<item name="price" xsi:type="string">5</item>
108+
<item name="website" xsi:type="string">All Websites [USD]</item>
109+
<item name="price_qty" xsi:type="string">1</item>
110+
<item name="customer_group" xsi:type="array">
111+
<item name="dataset" xsi:type="string">ALL_GROUPS</item>
112+
</item>
113+
</field>
114+
</dataset>
104115
</repository>
105116
</config>
Loading

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Section/Variations/Config.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,16 @@ public function setFieldsData(array $fields, SimpleElement $element = null)
8484
? $fields['configurable_attributes_data']['value']
8585
: [];
8686

87-
$attributesValue = isset($fields['configurable_attributes_data']['source'])
88-
? $fields['configurable_attributes_data']['source']->getAttributesData()
89-
: [];
87+
$attributeSource = isset($fields['configurable_attributes_data']['source'])
88+
? $fields['configurable_attributes_data']['source']
89+
: null;
90+
$attributesValue = $attributeSource !== null ? $attributeSource->getAttributesData() : [];
91+
9092
foreach ($attributesValue as $key => $value) {
9193
$attributesValue[$key] = array_merge($value, $attributes['attributes_data'][$key]);
9294
}
9395
$this->createConfigurations();
94-
$this->getAttributeBlock()->fillAttributes($attributesValue);
96+
$this->getAttributeBlock()->fillAttributes($attributesValue, $attributeSource);
9597
if (!empty($attributes['matrix'])) {
9698
$this->generateVariations();
9799
$this->getVariationsBlock()->fillVariations($attributes['matrix']);

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Section/Variations/Config/Attribute.php

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Section\Variations\Config;
88

99
use Magento\ConfigurableProduct\Test\Block\Adminhtml\Product\Edit\Section\Variations\Config\Attribute\AttributeSelector;
10+
use Magento\ConfigurableProduct\Test\Fixture\ConfigurableProduct\ConfigurableAttributesData;
1011
use Magento\Mtf\Block\Form;
1112
use Magento\Mtf\Client\Element\SimpleElement;
1213
use Magento\Mtf\Client\Locator;
@@ -159,13 +160,21 @@ class Attribute extends Form
159160
*/
160161
private $selectedAttributes = 'span[data-bind*="selectedAttributes"]';
161162

163+
/**
164+
* Wizard Images step CSS selector.
165+
*
166+
* @var string
167+
*/
168+
private $wizardImagesStep = '#variation-steps-wizard_step3';
169+
162170
/**
163171
* Fill attributes
164172
*
165173
* @param array $attributes
174+
* @param ConfigurableAttributesData $attributeSource
166175
* @return void
167176
*/
168-
public function fillAttributes(array $attributes)
177+
public function fillAttributes(array $attributes, ConfigurableAttributesData $attributeSource)
169178
{
170179
$attributesFilters = [];
171180
foreach ($attributes as $attribute) {
@@ -197,6 +206,7 @@ public function fillAttributes(array $attributes)
197206
}
198207

199208
$this->browser->find($this->nextButton)->click();
209+
$this->fillBulkImagesPriceAndQuantity($attributeSource, $attributes);
200210
$this->getTemplateBlock()->waitLoader();
201211
$this->browser->find($this->nextButton)->click();
202212
}
@@ -469,4 +479,47 @@ protected function getTemplateBlock()
469479
['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)]
470480
);
471481
}
482+
483+
/**
484+
* Fill Step 3: Bulk Images, Price and Quantity.
485+
*
486+
* @param ConfigurableAttributesData $attributeSource
487+
* @param array $attributes
488+
* @return void
489+
*/
490+
private function fillBulkImagesPriceAndQuantity(ConfigurableAttributesData $attributeSource, array $attributes)
491+
{
492+
if (empty($attributeSource->getBulkImagesPriceQuantity())) {
493+
return;
494+
}
495+
496+
$wizardStep = $this->browser->find($this->wizardImagesStep);
497+
$data = $this->prepareImageStepData($attributeSource->getBulkImagesPriceQuantity(), $attributes);
498+
$mapping = $this->dataMapping($data);
499+
$this->_fill($mapping, $wizardStep);
500+
}
501+
502+
/**
503+
* Prepare data for Step 3: Bulk Images, Price and Quantity.
504+
*
505+
* @param array $data
506+
* @param array $attributes
507+
* @return array
508+
*/
509+
private function prepareImageStepData(array $data, array $attributes)
510+
{
511+
if (isset($data['images'])) {
512+
$data['images']['image_attribute'] = $attributes['attribute_key_0']['attribute_code'];
513+
$data['images']['black_option_image'] = MTF_TESTS_PATH . array_shift($data['images']['images']);
514+
$data['images']['white_option_image'] = MTF_TESTS_PATH . array_shift($data['images']['images']);
515+
unset($data['images']['images']);
516+
}
517+
518+
if (isset($data['price'])) {
519+
$data['price']['price_option'] = $attributes['attribute_key_1']['attribute_code'];
520+
ksort($data['price']);
521+
}
522+
523+
return $data;
524+
}
472525
}

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Section/Variations/Config/Attribute.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,61 @@
1010
<label>
1111
<selector>[name=label]</selector>
1212
</label>
13+
<images composite="1">
14+
<image_unique>
15+
<selector>#apply-unique-images-radio</selector>
16+
<strategy>css selector</strategy>
17+
<input>radiobutton</input>
18+
</image_unique>
19+
<image_attribute>
20+
<selector>#apply-images-attributes</selector>
21+
<strategy>css selector</strategy>
22+
<input>select</input>
23+
</image_attribute>
24+
<black_option_image>
25+
<selector>//input[@name="image" and not(@id) and not(@class)]</selector>
26+
<strategy>xpath</strategy>
27+
<input>upload</input>
28+
</black_option_image>
29+
<white_option_image>
30+
<selector>//input[@name="image" and not(@id) and not(@class)]</selector>
31+
<strategy>xpath</strategy>
32+
<input>upload</input>
33+
</white_option_image>
34+
</images>
35+
<price composite="1">
36+
<price_attribute_unique>
37+
<selector>#apply-unique-prices-radio</selector>
38+
<strategy>css selector</strategy>
39+
<input>radiobutton</input>
40+
</price_attribute_unique>
41+
<price_option>
42+
<selector>#select-each-price</selector>
43+
<strategy>css selector</strategy>
44+
<input>select</input>
45+
</price_option>
46+
<xl_size_price>
47+
<selector>#apply-single-price-input-0</selector>
48+
<strategy>css selector</strategy>
49+
<input>input</input>
50+
</xl_size_price>
51+
<xxl_size_price>
52+
<selector>#apply-single-price-input-1</selector>
53+
<strategy>css selector</strategy>
54+
<input>input</input>
55+
</xxl_size_price>
56+
</price>
57+
<quantity composite="1">
58+
<quantity_single>
59+
<selector>#apply-single-inventory-radio</selector>
60+
<strategy>css selector</strategy>
61+
<input>radiobutton</input>
62+
</quantity_single>
63+
<quantity>
64+
<selector>#apply-single-inventory-input</selector>
65+
<strategy>css selector</strategy>
66+
<input>input</input>
67+
</quantity>
68+
</quantity>
1369
</fields>
1470
</mapping>

0 commit comments

Comments
 (0)