From 96687ac49b311ababf2d3eb7054b07cf9627883d Mon Sep 17 00:00:00 2001
From: Ihor Sviziev
Date: Wed, 10 Oct 2018 10:39:59 +0300
Subject: [PATCH 001/254] Checkout - Fix JS error Cannot read property
'quoteData' of undefined
---
app/code/Magento/Checkout/view/frontend/web/js/model/quote.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/quote.js b/app/code/Magento/Checkout/view/frontend/web/js/model/quote.js
index 2510d1aced3d3..3486a92736617 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/model/quote.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/model/quote.js
@@ -7,7 +7,8 @@
*/
define([
'ko',
- 'underscore'
+ 'underscore',
+ 'domReady!'
], function (ko, _) {
'use strict';
From 990f8eaeb7719398a3d2ed96739c2ba8afd3815f Mon Sep 17 00:00:00 2001
From: Alexandr Voronoy
Date: Sun, 11 Nov 2018 15:57:28 +0200
Subject: [PATCH 002/254] Fix area for image placeholder in graphql response.
---
.../Resolver/Product/ProductImage/Url.php | 24 +++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php
index 3c19ce599a9b3..9d53336dec70f 100644
--- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php
+++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php
@@ -13,6 +13,7 @@
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
+use Magento\Framework\View\Asset\Repository as AssetRepository;
/**
* Returns product's image url
@@ -23,14 +24,22 @@ class Url implements ResolverInterface
* @var ImageFactory
*/
private $productImageFactory;
+ /**
+ * @var AssetRepository
+ */
+ private $assetRepository;
/**
+ * Url constructor.
* @param ImageFactory $productImageFactory
+ * @param AssetRepository $assetRepository
*/
public function __construct(
- ImageFactory $productImageFactory
+ ImageFactory $productImageFactory,
+ AssetRepository $assetRepository
) {
$this->productImageFactory = $productImageFactory;
+ $this->assetRepository = $assetRepository;
}
/**
@@ -55,8 +64,7 @@ public function resolve(
$product = $value['model'];
$imagePath = $product->getData($value['image_type']);
- $imageUrl = $this->getImageUrl($value['image_type'], $imagePath);
- return $imageUrl;
+ return $this->getImageUrl($value['image_type'], $imagePath);
}
/**
@@ -71,7 +79,15 @@ private function getImageUrl(string $imageType, ?string $imagePath): string
$image = $this->productImageFactory->create();
$image->setDestinationSubdir($imageType)
->setBaseFile($imagePath);
- $imageUrl = $image->getUrl();
+
+ $imageUrl = $image->isBaseFilePlaceholder()
+ ? $this->assetRepository->createAsset(
+ "Magento_Catalog::images/product/placeholder/{$imageType}.jpg",
+ ['area' => \Magento\Framework\App\Area::AREA_FRONTEND]
+ )
+ ->getUrl()
+ : $image->getUrl();
+
return $imageUrl;
}
}
From 8867a57e773be7c63dc52e81d1add09ef7fda1fa Mon Sep 17 00:00:00 2001
From: Alexandr Voronoy
Date: Sun, 18 Nov 2018 23:24:08 +0200
Subject: [PATCH 003/254] added logic if placeholder is overridden, unblock
test.
---
.../Resolver/Product/ProductImage/Url.php | 30 +++--
.../DataProvider/Image/Placeholder.php | 109 ++++++++++++++++++
.../GraphQl/Catalog/ProductImageTest.php | 1 -
3 files changed, 123 insertions(+), 17 deletions(-)
create mode 100644 app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php
index 9d53336dec70f..8b6275f2f3e0e 100644
--- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php
+++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php
@@ -9,11 +9,11 @@
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\ImageFactory;
+use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Image\Placeholder as PlaceholderProvider;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
-use Magento\Framework\View\Asset\Repository as AssetRepository;
/**
* Returns product's image url
@@ -25,21 +25,22 @@ class Url implements ResolverInterface
*/
private $productImageFactory;
/**
- * @var AssetRepository
+ * @var PlaceholderProvider
*/
- private $assetRepository;
+ private $_placeholderProvider;
/**
* Url constructor.
* @param ImageFactory $productImageFactory
- * @param AssetRepository $assetRepository
+ * @param PlaceholderProvider $placeholderProvider
*/
public function __construct(
ImageFactory $productImageFactory,
- AssetRepository $assetRepository
+ PlaceholderProvider $placeholderProvider
+
) {
$this->productImageFactory = $productImageFactory;
- $this->assetRepository = $assetRepository;
+ $this->_placeholderProvider = $placeholderProvider;
}
/**
@@ -68,11 +69,12 @@ public function resolve(
}
/**
- * Get image url
+ * Get image URL
*
* @param string $imageType
- * @param string|null $imagePath Null if image is not set
+ * @param string|null $imagePath
* @return string
+ * @throws \Exception
*/
private function getImageUrl(string $imageType, ?string $imagePath): string
{
@@ -80,14 +82,10 @@ private function getImageUrl(string $imageType, ?string $imagePath): string
$image->setDestinationSubdir($imageType)
->setBaseFile($imagePath);
- $imageUrl = $image->isBaseFilePlaceholder()
- ? $this->assetRepository->createAsset(
- "Magento_Catalog::images/product/placeholder/{$imageType}.jpg",
- ['area' => \Magento\Framework\App\Area::AREA_FRONTEND]
- )
- ->getUrl()
- : $image->getUrl();
+ if ($image->isBaseFilePlaceholder()) {
+ return $this->_placeholderProvider->getPlaceholder($imageType);
+ }
- return $imageUrl;
+ return $image->getUrl();
}
}
diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
new file mode 100644
index 0000000000000..d9691a079a328
--- /dev/null
+++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
@@ -0,0 +1,109 @@
+_placeholderFactory = $placeholderFactory;
+ $this->_assetRepository = $assetRepository;
+ $this->_scopeConfig = $scopeConfig;
+ $this->_storeManager = $storeManager;
+ $this->_themeProvider = $themeProvider;
+ }
+
+ /**
+ * Get placeholder
+ *
+ * @param $imageType
+ * @return string
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ public function getPlaceholder($imageType): string
+ {
+ $imageAsset = $this->_placeholderFactory->create(['type' => $imageType]);
+
+ // check if placeholder defined in config
+ if ($imageAsset->getFilePath()) {
+ return $imageAsset->getUrl();
+ }
+
+ return $this->_assetRepository->createAsset(
+ "Magento_Catalog::images/product/placeholder/{$imageType}.jpg",
+ $this->getThemeData()
+ )->getUrl();
+ }
+
+ /**
+ * Get theme model
+ *
+ * @return mixed
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ public function getThemeData()
+ {
+ $themeId = $this->_scopeConfig->getValue(
+ \Magento\Framework\View\DesignInterface::XML_PATH_THEME_ID,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $this->_storeManager->getStore()->getId()
+ );
+
+ /** @var $theme \Magento\Framework\View\Design\ThemeInterface */
+ $theme = $this->_themeProvider->getThemeById($themeId);
+
+ $data = $theme->getData();
+ $data['themeModel'] = $theme;
+
+ return $data;
+ }
+}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php
index b55c6c1d91460..bb9c67f6d753d 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php
@@ -51,7 +51,6 @@ public function testProductWithBaseImage()
*/
public function testProductWithoutBaseImage()
{
- $this->markTestIncomplete('https://github.com/magento/graphql-ce/issues/239');
$productSku = 'simple';
$query = <<
Date: Sat, 24 Nov 2018 16:28:08 +0200
Subject: [PATCH 004/254] store_view_code-column-has-empty-values-in-csv-17784.
Moved ->clear();
---
app/code/Magento/CatalogImportExport/Model/Export/Product.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/CatalogImportExport/Model/Export/Product.php b/app/code/Magento/CatalogImportExport/Model/Export/Product.php
index 345d323e6e129..236b7caef1570 100644
--- a/app/code/Magento/CatalogImportExport/Model/Export/Product.php
+++ b/app/code/Magento/CatalogImportExport/Model/Export/Product.php
@@ -948,8 +948,8 @@ protected function loadCollection(): array
foreach ($collection as $itemId => $item) {
$data[$itemId][$storeId] = $item;
}
+ $collection->clear();
}
- $collection->clear();
return $data;
}
From 0186fe65984df11ee4973363fb4644bf05f3fc57 Mon Sep 17 00:00:00 2001
From: DmytroPaidych
Date: Mon, 24 Dec 2018 16:25:00 +0200
Subject: [PATCH 005/254] MAGETWO-97237: Delete Product Staging Update when the
Product is used
---
.../Test/Mftf/Page/AdminUrlRewriteEditPage.xml | 14 ++++++++++++++
.../Mftf/Section/AdminUrlRewriteEditSection.xml | 14 ++++++++++++++
2 files changed, 28 insertions(+)
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml
new file mode 100644
index 0000000000000..b43e0e05ad55d
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml
new file mode 100644
index 0000000000000..7095214e72c43
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
From 25dcef64717325b00d8eb93cde1dde7b06093c40 Mon Sep 17 00:00:00 2001
From: Patrick McLain
Date: Wed, 26 Dec 2018 14:53:14 -0500
Subject: [PATCH 006/254] Correct max page size for elasticsearch5 engine
This value can be changed but can never exceed the value set for `index.max_result_window` in
elasticsearch. This looks like it was caught and fixed for the `elasticsearch` engine, but
not for `elasticsearch5`
---
app/code/Magento/Elasticsearch/etc/di.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Elasticsearch/etc/di.xml b/app/code/Magento/Elasticsearch/etc/di.xml
index 6a42e4b3c9fe2..8adf589a91c6c 100644
--- a/app/code/Magento/Elasticsearch/etc/di.xml
+++ b/app/code/Magento/Elasticsearch/etc/di.xml
@@ -417,7 +417,7 @@
- 10000
- - 2147483647
+ - 10000
From 54e53eaffe2d3c3d076fe03d13cdf58baf5648f6 Mon Sep 17 00:00:00 2001
From: DmytroPaidych
Date: Thu, 27 Dec 2018 12:32:56 +0200
Subject: [PATCH 007/254] MAGETWO-97237: Delete Product Staging Update when the
Product is used
---
.../AdminCreateWidgetActionGroup.xml | 19 +++++++++++++++++++
.../Widget/Test/Mftf/Data/WidgetsData.xml | 5 +++++
.../Mftf/Section/AdminNewWidgetSection.xml | 4 +++-
...dminNewWidgetSelectProductPopupSection.xml | 15 +++++++++++++++
4 files changed, 42 insertions(+), 1 deletion(-)
create mode 100644 app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSelectProductPopupSection.xml
diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml
index 7955f4ec29e55..616dfef57a263 100644
--- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml
+++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml
@@ -58,4 +58,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml b/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
index 26864c60b6494..639e4edb6b08f 100644
--- a/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
+++ b/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
@@ -19,4 +19,9 @@
All Pages
Main Content Area
+
+
+ Catalog Product Link
+ Product Link Block Template
+
diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml
index 38b4df335ea83..3bde60891ae1d 100644
--- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml
+++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
@@ -17,6 +17,7 @@
+
@@ -25,5 +26,6 @@
+
diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSelectProductPopupSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSelectProductPopupSection.xml
new file mode 100644
index 0000000000000..0da67849f85c6
--- /dev/null
+++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSelectProductPopupSection.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
From 6d5ee6380cd9038fc1ef3403031e550f44440524 Mon Sep 17 00:00:00 2001
From: NazarKlovanych
Date: Thu, 27 Dec 2018 11:31:38 +0200
Subject: [PATCH 008/254] Fix for issue 19983
---
.../Magento/Ui/view/base/web/js/form/element/file-uploader.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js b/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js
index 357571350a268..c6bf36f5cc867 100644
--- a/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js
@@ -16,7 +16,8 @@ define([
'Magento_Ui/js/form/element/abstract',
'mage/backend/notification',
'mage/translate',
- 'jquery/file-uploader'
+ 'jquery/file-uploader',
+ 'mage/adminhtml/tools'
], function ($, _, utils, uiAlert, validator, Element, notification, $t) {
'use strict';
From 188a3e66e7d9604942d7c36cfaec7dc5bae32710 Mon Sep 17 00:00:00 2001
From: NazarKlovanych
Date: Thu, 27 Dec 2018 12:53:39 +0200
Subject: [PATCH 009/254] Fix save customer attribute image
---
app/code/Magento/Eav/Model/Attribute/Data/File.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Eav/Model/Attribute/Data/File.php b/app/code/Magento/Eav/Model/Attribute/Data/File.php
index 1b2cac32598e1..b8ca34986111b 100644
--- a/app/code/Magento/Eav/Model/Attribute/Data/File.php
+++ b/app/code/Magento/Eav/Model/Attribute/Data/File.php
@@ -146,7 +146,7 @@ protected function _validateByRules($value)
return $this->_fileValidator->getMessages();
}
- if (!empty($value['tmp_name']) && !is_uploaded_file($value['tmp_name'])) {
+ if (empty($value['tmp_name']) && !is_uploaded_file($value['tmp_name'])) {
return [__('"%1" is not a valid file.', $label)];
}
From a042993b2d608df6e050a5e9b62509ef08be985b Mon Sep 17 00:00:00 2001
From: Anton Evers
Date: Wed, 2 Jan 2019 14:02:29 +0100
Subject: [PATCH 010/254] Make it possible to generate sales PDF's using the
API
---
.../base/templates/info/pdf/default.phtml | 23 +++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 app/code/Magento/Payment/view/base/templates/info/pdf/default.phtml
diff --git a/app/code/Magento/Payment/view/base/templates/info/pdf/default.phtml b/app/code/Magento/Payment/view/base/templates/info/pdf/default.phtml
new file mode 100644
index 0000000000000..7acac62f65d38
--- /dev/null
+++ b/app/code/Magento/Payment/view/base/templates/info/pdf/default.phtml
@@ -0,0 +1,23 @@
+
+= $block->escapeHtml($block->getMethod()->getTitle()) ?>{{pdf_row_separator}}
+
+getSpecificInformation()):?>
+ $value):?>
+ = $block->escapeHtml($label) ?>:
+ = $block->escapeHtml(implode(' ', $block->getValueAsArray($value))) ?>
+ {{pdf_row_separator}}
+
+
+
+= $block->escapeHtml(implode('{{pdf_row_separator}}', $block->getChildPdfAsArray())) ?>
From c3fdba54dfc023bd92c5823682dc370235a59262 Mon Sep 17 00:00:00 2001
From: Anton Evers
Date: Thu, 3 Jan 2019 13:54:57 +0100
Subject: [PATCH 011/254] Make it possible to generate sales PDF's using the
API
---
.../base/templates/info/pdf/checkmo.phtml | 26 +++++++++++++++++++
.../templates/info/pdf/purchaseorder.phtml | 11 ++++++++
2 files changed, 37 insertions(+)
create mode 100644 app/code/Magento/OfflinePayments/view/base/templates/info/pdf/checkmo.phtml
create mode 100644 app/code/Magento/OfflinePayments/view/base/templates/info/pdf/purchaseorder.phtml
diff --git a/app/code/Magento/OfflinePayments/view/base/templates/info/pdf/checkmo.phtml b/app/code/Magento/OfflinePayments/view/base/templates/info/pdf/checkmo.phtml
new file mode 100644
index 0000000000000..4d63577319d5b
--- /dev/null
+++ b/app/code/Magento/OfflinePayments/view/base/templates/info/pdf/checkmo.phtml
@@ -0,0 +1,26 @@
+
+= $block->escapeHtml($block->getMethod()->getTitle()) ?>
+ {{pdf_row_separator}}
+getInfo()->getAdditionalInformation()): ?>
+ {{pdf_row_separator}}
+ getPayableTo()): ?>
+ = $block->escapeHtml(__('Make Check payable to: %1', $block->getPayableTo())) ?>
+ {{pdf_row_separator}}
+
+ getMailingAddress()): ?>
+ = $block->escapeHtml(__('Send Check to:')) ?>
+ {{pdf_row_separator}}
+ = /* @noEscape */ nl2br($block->escapeHtml($block->getMailingAddress())) ?>
+ {{pdf_row_separator}}
+
+
diff --git a/app/code/Magento/OfflinePayments/view/base/templates/info/pdf/purchaseorder.phtml b/app/code/Magento/OfflinePayments/view/base/templates/info/pdf/purchaseorder.phtml
new file mode 100644
index 0000000000000..4a6ea1c00b21c
--- /dev/null
+++ b/app/code/Magento/OfflinePayments/view/base/templates/info/pdf/purchaseorder.phtml
@@ -0,0 +1,11 @@
+
+= $block->escapeHtml(__('Purchase Order Number: %1', $block->getInfo()->getPoNumber())) ?>
+ {{pdf_row_separator}}
From 55cf2dcb970f3f069e3d59ad7986413f80bb6cdb Mon Sep 17 00:00:00 2001
From: Rajneesh Gupta
Date: Wed, 2 Jan 2019 18:25:40 +0530
Subject: [PATCH 012/254] String validation for filename added and updated unit
test case magento#13937.
---
.../Sitemap/Block/Adminhtml/Edit/Form.php | 3 +-
.../Controller/Adminhtml/Sitemap/Save.php | 90 +++++++--
.../Controller/Adminhtml/Sitemap/SaveTest.php | 173 ++++++++++++++----
3 files changed, 211 insertions(+), 55 deletions(-)
diff --git a/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php b/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php
index 5e90cf6e12f6e..2093e4d7d5736 100644
--- a/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php
+++ b/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php
@@ -73,7 +73,8 @@ protected function _prepareForm()
'name' => 'sitemap_filename',
'required' => true,
'note' => __('example: sitemap.xml'),
- 'value' => $model->getSitemapFilename()
+ 'value' => $model->getSitemapFilename(),
+ 'class' => 'validate-length maximum-length-32'
]
);
diff --git a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php
index 1e0d1cb248f00..23e1d2e786900 100644
--- a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php
+++ b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php
@@ -11,6 +11,61 @@
class Save extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
{
+ /**
+ * Maximum length of sitemap filename
+ */
+ const MAX_FILENAME_LENGTH = 32;
+
+ /**
+ * @var $_stringValidator
+ */
+ public $_stringValidator;
+
+ /**
+ * @var $_pathValidator
+ */
+ public $_pathValidator;
+
+ /**
+ * @var $_sitemapHelper
+ */
+ public $_sitemapHelper;
+
+ /**
+ * @var $_filesystem
+ */
+ public $_filesystem;
+
+ /**
+ * @var $_sitemapFactory
+ */
+ public $_sitemapFactory;
+
+ /**
+ * Save constructor.
+ * @param Action\Context $context
+ * @param \Magento\Framework\Validator\StringLength $stringValidator
+ * @param \Magento\MediaStorage\Model\File\Validator\AvailablePath $pathValidator
+ * @param \Magento\Sitemap\Helper\Data $sitemapHelper
+ * @param \Magento\Framework\Filesystem $filesystem
+ * @param \Magento\Sitemap\Model\SitemapFactory $sitemapFactory
+ */
+ public function __construct(
+ \Magento\Backend\App\Action\Context $context,
+ \Magento\Framework\Validator\StringLength $stringValidator,
+ \Magento\MediaStorage\Model\File\Validator\AvailablePath $pathValidator,
+ \Magento\Sitemap\Helper\Data $sitemapHelper,
+ \Magento\Framework\Filesystem $filesystem,
+ \Magento\Sitemap\Model\SitemapFactory $sitemapFactory
+ ) {
+ parent::__construct($context);
+ $this->_stringValidator = $stringValidator;
+ $this->_pathValidator = $pathValidator;
+ $this->_sitemapHelper = $sitemapHelper;
+ $this->_filesystem = $filesystem;
+ $this->_sitemapFactory = $sitemapFactory;
+ }
+
/**
* Validate path for generation
*
@@ -23,17 +78,25 @@ protected function validatePath(array $data)
if (!empty($data['sitemap_filename']) && !empty($data['sitemap_path'])) {
$data['sitemap_path'] = '/' . ltrim($data['sitemap_path'], '/');
$path = rtrim($data['sitemap_path'], '\\/') . '/' . $data['sitemap_filename'];
- /** @var $validator \Magento\MediaStorage\Model\File\Validator\AvailablePath */
- $validator = $this->_objectManager->create(\Magento\MediaStorage\Model\File\Validator\AvailablePath::class);
- /** @var $helper \Magento\Sitemap\Helper\Data */
- $helper = $this->_objectManager->get(\Magento\Sitemap\Helper\Data::class);
- $validator->setPaths($helper->getValidPaths());
- if (!$validator->isValid($path)) {
- foreach ($validator->getMessages() as $message) {
+ $this->_pathValidator->setPaths($this->_sitemapHelper->getValidPaths());
+ if (!$this->_pathValidator->isValid($path)) {
+ foreach ($this->_pathValidator->getMessages() as $message) {
+ $this->messageManager->addErrorMessage($message);
+ }
+ // save data in session
+ $this->_session->setFormData($data);
+ // redirect to edit form
+ return false;
+ }
+
+ $filename = rtrim($data['sitemap_filename']);
+ $this->_stringValidator->setMax(self::MAX_FILENAME_LENGTH);
+ if (!$this->_stringValidator->isValid($filename)) {
+ foreach ($this->_stringValidator->getMessages() as $message) {
$this->messageManager->addErrorMessage($message);
}
// save data in session
- $this->_objectManager->get(\Magento\Backend\Model\Session::class)->setFormData($data);
+ $this->_session->setFormData($data);
// redirect to edit form
return false;
}
@@ -49,9 +112,8 @@ protected function validatePath(array $data)
*/
protected function clearSiteMap(\Magento\Sitemap\Model\Sitemap $model)
{
- /** @var \Magento\Framework\Filesystem\Directory\Write $directory */
- $directory = $this->_objectManager->get(\Magento\Framework\Filesystem::class)
- ->getDirectoryWrite(DirectoryList::ROOT);
+ /** @var \Magento\Framework\Filesystem $directory */
+ $directory = $this->_filesystem->getDirectoryWrite(DirectoryList::ROOT);
if ($this->getRequest()->getParam('sitemap_id')) {
$model->load($this->getRequest()->getParam('sitemap_id'));
@@ -74,7 +136,7 @@ protected function saveData($data)
{
// init model and set data
/** @var \Magento\Sitemap\Model\Sitemap $model */
- $model = $this->_objectManager->create(\Magento\Sitemap\Model\Sitemap::class);
+ $model = $this->_sitemapFactory->create();
$this->clearSiteMap($model);
$model->setData($data);
@@ -85,13 +147,13 @@ protected function saveData($data)
// display success message
$this->messageManager->addSuccessMessage(__('You saved the sitemap.'));
// clear previously saved data from session
- $this->_objectManager->get(\Magento\Backend\Model\Session::class)->setFormData(false);
+ $this->_session->setFormData(false);
return $model->getId();
} catch (\Exception $e) {
// display error message
$this->messageManager->addErrorMessage($e->getMessage());
// save data in session
- $this->_objectManager->get(\Magento\Backend\Model\Session::class)->setFormData($data);
+ $this->_session->setFormData($data);
}
return false;
}
diff --git a/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php b/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php
index f77954101df7c..0e5758a3d8f48 100644
--- a/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php
+++ b/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php
@@ -7,6 +7,7 @@
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
use Magento\Framework\Controller\ResultFactory;
+use Magento\Sitemap\Controller\Adminhtml\Sitemap\Save;
class SaveTest extends \PHPUnit\Framework\TestCase
{
@@ -18,12 +19,7 @@ class SaveTest extends \PHPUnit\Framework\TestCase
/**
* @var \Magento\Backend\App\Action\Context
*/
- protected $context;
-
- /**
- * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
- */
- protected $objectManagerHelper;
+ protected $contextMock;
/**
* @var \Magento\Framework\HTTP\PhpEnvironment\Request|\PHPUnit_Framework_MockObject_MockObject
@@ -50,8 +46,41 @@ class SaveTest extends \PHPUnit\Framework\TestCase
*/
protected $messageManagerMock;
+ /**
+ * @var \Magento\Framework\Validator\StringLength|\PHPUnit_Framework_MockObject_MockObject
+ */
+ protected $lengthValidator;
+
+ /**
+ * @var \Magento\MediaStorage\Model\File\Validator\AvailablePath|\PHPUnit_Framework_MockObject_MockObject
+ */
+ protected $pathValidator;
+
+ /**
+ * @var \Magento\Sitemap\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
+ */
+ protected $helper;
+
+ /**
+ * @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject
+ */
+ protected $fileSystem;
+
+ /**
+ * @var \Magento\Sitemap\Model\SitemapFactory|\PHPUnit_Framework_MockObject_MockObject
+ */
+ protected $siteMapFactory;
+
+ /**
+ * @var \Magento\Backend\Model\Session|\PHPUnit_Framework_MockObject_MockObject
+ */
+ protected $session;
+
protected function setUp()
{
+ $this->contextMock = $this->getMockBuilder(\Magento\Backend\App\Action\Context::class)
+ ->disableOriginalConstructor()
+ ->getMock();
$this->requestMock = $this->getMockBuilder(\Magento\Framework\App\RequestInterface::class)
->disableOriginalConstructor()
->setMethods(['getPostValue'])
@@ -66,27 +95,48 @@ protected function setUp()
->getMock();
$this->messageManagerMock = $this->getMockBuilder(\Magento\Framework\Message\ManagerInterface::class)
->getMock();
-
+ $this->helper = $this->getMockBuilder(\Magento\Sitemap\Helper\Data::class)
+ ->disableOriginalConstructor()
+ ->getMock();
$this->resultFactoryMock->expects($this->once())
->method('create')
->with(ResultFactory::TYPE_REDIRECT)
->willReturn($this->resultRedirectMock);
+ $this->session = $this->getMockBuilder(\Magento\Backend\Model\Session::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['setFormData'])
+ ->getMock();
- $this->objectManagerHelper = new ObjectManagerHelper($this);
- $this->context = $this->objectManagerHelper->getObject(
- \Magento\Backend\App\Action\Context::class,
- [
- 'resultFactory' => $this->resultFactoryMock,
- 'request' => $this->requestMock,
- 'messageManager' => $this->messageManagerMock,
- 'objectManager' => $this->objectManagerMock
- ]
- );
- $this->saveController = $this->objectManagerHelper->getObject(
- \Magento\Sitemap\Controller\Adminhtml\Sitemap\Save::class,
- [
- 'context' => $this->context
- ]
+ $this->contextMock->expects($this->once())
+ ->method('getMessageManager')
+ ->willReturn($this->messageManagerMock);
+ $this->contextMock->expects($this->once())
+ ->method('getRequest')
+ ->willReturn($this->requestMock);
+ $this->contextMock->expects($this->once())
+ ->method('getResultFactory')
+ ->willReturn($this->resultFactoryMock);
+ $this->contextMock->expects($this->once())
+ ->method('getSession')
+ ->willReturn($this->session);
+
+ $this->lengthValidator = $this->getMockBuilder(\Magento\Framework\Validator\StringLength::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->pathValidator =
+ $this->getMockBuilder(\Magento\MediaStorage\Model\File\Validator\AvailablePath::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->fileSystem = $this->createMock(\Magento\Framework\Filesystem::class);
+ $this->siteMapFactory = $this->createMock(\Magento\Sitemap\Model\SitemapFactory::class);
+
+ $this->saveController = new Save(
+ $this->contextMock,
+ $this->lengthValidator,
+ $this->pathValidator,
+ $this->helper,
+ $this->fileSystem,
+ $this->siteMapFactory
);
}
@@ -105,11 +155,8 @@ public function testSaveEmptyDataShouldRedirectToDefault()
public function testTryToSaveInvalidDataShouldFailWithErrors()
{
- $validatorClass = \Magento\MediaStorage\Model\File\Validator\AvailablePath::class;
- $helperClass = \Magento\Sitemap\Helper\Data::class;
$validPaths = [];
$messages = ['message1', 'message2'];
- $sessionClass = \Magento\Backend\Model\Session::class;
$data = ['sitemap_filename' => 'sitemap_filename', 'sitemap_path' => '/sitemap_path'];
$siteMapId = 1;
@@ -121,37 +168,83 @@ public function testTryToSaveInvalidDataShouldFailWithErrors()
->with('sitemap_id')
->willReturn($siteMapId);
- $validator = $this->createMock($validatorClass);
- $validator->expects($this->once())
+ $this->pathValidator->expects($this->once())
->method('setPaths')
->with($validPaths)
->willReturnSelf();
- $validator->expects($this->once())
+ $this->pathValidator->expects($this->once())
->method('isValid')
->with('/sitemap_path/sitemap_filename')
->willReturn(false);
- $validator->expects($this->once())
+ $this->pathValidator->expects($this->once())
->method('getMessages')
->willReturn($messages);
- $helper = $this->createMock($helperClass);
- $helper->expects($this->once())
+ $this->helper->expects($this->once())
->method('getValidPaths')
->willReturn($validPaths);
- $session = $this->createPartialMock($sessionClass, ['setFormData']);
- $session->expects($this->once())
+ $this->session->expects($this->once())
->method('setFormData')
->with($data)
->willReturnSelf();
- $this->objectManagerMock->expects($this->once())
- ->method('create')
- ->with($validatorClass)
- ->willReturn($validator);
- $this->objectManagerMock->expects($this->any())
- ->method('get')
- ->willReturnMap([[$helperClass, $helper], [$sessionClass, $session]]);
+ $this->messageManagerMock->expects($this->at(0))
+ ->method('addErrorMessage')
+ ->withConsecutive(
+ [$messages[0]],
+ [$messages[1]]
+ )
+ ->willReturnSelf();
+
+ $this->resultRedirectMock->expects($this->once())
+ ->method('setPath')
+ ->with('adminhtml/*/edit', ['sitemap_id' => $siteMapId])
+ ->willReturnSelf();
+
+ $this->assertSame($this->resultRedirectMock, $this->saveController->execute());
+ }
+
+ public function testTryToSaveInvalidFileNameShouldFailWithErrors()
+ {
+ $validPaths = [];
+ $messages = ['message1', 'message2'];
+ $data = ['sitemap_filename' => 'sitemap_filename', 'sitemap_path' => '/sitemap_path'];
+ $siteMapId = 1;
+
+ $this->requestMock->expects($this->once())
+ ->method('getPostValue')
+ ->willReturn($data);
+ $this->requestMock->expects($this->once())
+ ->method('getParam')
+ ->with('sitemap_id')
+ ->willReturn($siteMapId);
+
+ $this->lengthValidator->expects($this->once())
+ ->method('isValid')
+ ->with('sitemap_filename')
+ ->willReturn(false);
+ $this->lengthValidator->expects($this->once())
+ ->method('getMessages')
+ ->willReturn($messages);
+
+ $this->pathValidator->expects($this->once())
+ ->method('setPaths')
+ ->with($validPaths)
+ ->willReturnSelf();
+ $this->pathValidator->expects($this->once())
+ ->method('isValid')
+ ->with('/sitemap_path/sitemap_filename')
+ ->willReturn(true);
+
+ $this->helper->expects($this->once())
+ ->method('getValidPaths')
+ ->willReturn($validPaths);
+
+ $this->session->expects($this->once())
+ ->method('setFormData')
+ ->with($data)
+ ->willReturnSelf();
$this->messageManagerMock->expects($this->at(0))
->method('addErrorMessage')
From 825fa30f043cdee014dcb6602eed50616a2f601c Mon Sep 17 00:00:00 2001
From: shikhamis11
Date: Thu, 1 Nov 2018 17:59:28 +0530
Subject: [PATCH 013/254] fixed store wise product filter issue
Fixed issue - #18374
Unable to get product attribute value for store-view scope type in product collection loaded for a specific store.
---
.../Magento/Eav/Model/Entity/Collection/AbstractCollection.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php
index 0eb87374f3ba3..eba9976260bed 100644
--- a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php
+++ b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php
@@ -399,7 +399,7 @@ public function addAttributeToFilter($attribute, $condition = null, $joinType =
*/
public function addFieldToFilter($attribute, $condition = null)
{
- return $this->addAttributeToFilter($attribute, $condition);
+ return $this->addAttributeToFilter($attribute, $condition,'left');
}
/**
From fd52e94b69f2ec44552fb1ff21a3897d114f620a Mon Sep 17 00:00:00 2001
From: Stanislav Idolov
Date: Fri, 21 Dec 2018 16:15:37 -0600
Subject: [PATCH 014/254] Fixed code style issue
---
.../Magento/Eav/Model/Entity/Collection/AbstractCollection.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php
index eba9976260bed..6d9e5e88cdfe5 100644
--- a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php
+++ b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php
@@ -399,7 +399,7 @@ public function addAttributeToFilter($attribute, $condition = null, $joinType =
*/
public function addFieldToFilter($attribute, $condition = null)
{
- return $this->addAttributeToFilter($attribute, $condition,'left');
+ return $this->addAttributeToFilter($attribute, $condition, 'left');
}
/**
From 12c04d69385ee41470de73400049bf84a7534aab Mon Sep 17 00:00:00 2001
From: DmytroPaidych
Date: Wed, 9 Jan 2019 16:03:26 +0200
Subject: [PATCH 015/254] MAGETWO-97212: Enable skipped test - Move Anchored
Category with Products (cron is ON, "Update on Save")
---
.../Catalog/Test/Repository/Category.xml | 26 +++++++++++++++++++
.../Category/MoveCategoryEntityTest.xml | 6 ++---
.../Test/Block/Navigation.php | 24 ++++++++++++++---
3 files changed, 48 insertions(+), 8 deletions(-)
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml
index d529f74865985..014d685cfdb7c 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/Category.xml
@@ -179,5 +179,31 @@
- catalogProductSimple::default
+
+ DefaultSubcategory%isolation%
+ default-subcategory-%isolation%
+
+ - default_anchored_category_with_product
+
+ Yes
+ Yes
+ Yes
+
+ - catalogProductSimple::default
+
+
+
+ Category%isolation%
+ category%isolation%
+ Yes
+ Yes
+ Yes
+
+ - default_category
+
+
+ - catalogProductSimple::product_5_dollar
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/MoveCategoryEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/MoveCategoryEntityTest.xml
index 446011902c096..b79769b5be4fe 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/MoveCategoryEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/MoveCategoryEntityTest.xml
@@ -15,8 +15,7 @@
- MAGETWO-65147: Category is not present in Layered navigation block when anchor is on
- default_subcategory_with_anchored_parent
+ default_subcategory_with_anchored_parent_with_product
default
2
@@ -25,9 +24,8 @@
- MAGETWO-65147: Category is not present in Layered navigation block when anchor is on
default_subcategory_with_anchored_parent
- default_anchor_subcategory_with_anchored_parent
+ default_subcategory_with_anchored_parent_with_product
default_category
2
diff --git a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php
index 3c36fe82b1307..9d2b6a0ed0e7a 100644
--- a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php
+++ b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php
@@ -64,6 +64,13 @@ class Navigation extends Block
*/
private $productQty = '/following-sibling::span[contains(text(), "%s")]';
+ /**
+ * Selector for child element with product quantity.
+ *
+ * @var string
+ */
+ private $productQtyInCategory = '/span[contains(text(), "%s")]';
+
/**
* Remove all applied filters.
*
@@ -124,10 +131,19 @@ public function applyFilter($filter, $linkPattern)
*/
public function isCategoryVisible(Category $category, $qty)
{
- return $this->_rootElement->find(
- sprintf($this->categoryName, $category->getName()) . sprintf($this->productQty, $qty),
- Locator::SELECTOR_XPATH
- )->isVisible();
+ $link = $this->_rootElement->find(sprintf($this->optionTitle, 'Category'), Locator::SELECTOR_XPATH);
+ if ($link->isVisible()) {
+ $link->click();
+ return $this->_rootElement->find(
+ sprintf($this->categoryName, $category->getName()) . sprintf($this->productQtyInCategory, $qty),
+ Locator::SELECTOR_XPATH
+ )->isVisible();
+ } else {
+ return $this->_rootElement->find(
+ sprintf($this->categoryName, $category->getName()) . sprintf($this->productQty, $qty),
+ Locator::SELECTOR_XPATH
+ )->isVisible();
+ }
}
/**
From fb821b4f18eaa7ad350529f8fbd2887af3bb7438 Mon Sep 17 00:00:00 2001
From: Oleg Onufer
Date: Mon, 14 Jan 2019 16:52:42 +0200
Subject: [PATCH 016/254] MAGETWO-97240: Category rules should apply to complex
products
---
.../ActionGroup/AdminCategoryActionGroup.xml | 11 ++
...reateApiConfigurableProductActionGroup.xml | 13 ++
.../AdminCartPriceRulesFormSection.xml | 3 +
...yRulesShouldApplyToComplexProductsTest.xml | 135 ++++++++++++++++++
4 files changed, 162 insertions(+)
create mode 100644 app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
index 57f91b78fcbe9..138ae0370e965 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
@@ -263,4 +263,15 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml
index 033e6757c3bf9..c0a9f03906030 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminCreateApiConfigurableProductActionGroup.xml
@@ -62,4 +62,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml
index c3680e1c3ceaf..f528f97f0b386 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml
@@ -41,9 +41,12 @@
+
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml
new file mode 100644
index 0000000000000..3762b69b745c4
--- /dev/null
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 99d6e43098dbc33dcfbd922521e685eaa791837f Mon Sep 17 00:00:00 2001
From: Govind Sharma
Date: Tue, 15 Jan 2019 17:27:03 +0530
Subject: [PATCH 017/254] Updated _payment.less file to fix update button issue
Updated _payment.less file to fix update button issue
---
.../web/css/source/module/checkout/_payments.less | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less
index dd9db0e715308..d7e3de57f4657 100644
--- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less
+++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less
@@ -118,6 +118,7 @@
.primary {
.action-update {
margin-right: 0;
+ margin-bottom:20px;
}
}
From da46b6ac353d1cbd9e58686516d31a9025110db1 Mon Sep 17 00:00:00 2001
From: Govind Sharma
Date: Wed, 16 Jan 2019 08:50:36 +0530
Subject: [PATCH 018/254] fix indent
---
.../web/css/source/module/checkout/_payments.less | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less
index d7e3de57f4657..7428b1a108b25 100644
--- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less
+++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_payments.less
@@ -118,7 +118,7 @@
.primary {
.action-update {
margin-right: 0;
- margin-bottom:20px;
+ margin-bottom: 20px;
}
}
From 74b2098d878e71ec39284019ad887edce815f049 Mon Sep 17 00:00:00 2001
From: Arvinda kumar
Date: Wed, 16 Jan 2019 18:07:31 +0530
Subject: [PATCH 019/254] issue fixed #20337 Option Title breaking in two line
because applying wrong css for manage width
issue fixed #20337 Option Title breaking in two line because applying wrong css for manage width
---
.../adminhtml/Magento/backend/web/css/source/forms/_fields.less | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
index 02925881253ea..81a55443d6a3c 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
@@ -531,7 +531,7 @@
& > .admin__field {
&:first-child {
position: static;
-
+ width: 100%;
& > .admin__field-label {
#mix-grid .column(@field-label-grid__column, @field-grid__columns);
cursor: pointer;
From 25f3d7d5508dd84221a6d4799b0734b8ddafc68d Mon Sep 17 00:00:00 2001
From: Oleg Onufer
Date: Wed, 16 Jan 2019 15:25:51 +0200
Subject: [PATCH 020/254] MAGETWO-97240: Category rules should apply to complex
products
---
.../ActionGroup/AdminCategoryActionGroup.xml | 2 +-
.../AdminCartPriceRuleActionGroup.xml | 23 ++++++++++++
.../Test/Mftf/Data/SalesRuleData.xml | 4 +++
...yRulesShouldApplyToComplexProductsTest.xml | 35 +++++--------------
4 files changed, 36 insertions(+), 28 deletions(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
index 138ae0370e965..a5c26d2530a66 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
@@ -272,6 +272,6 @@
-
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml
index e5907e1e9c0f5..2b8b5eb4ad17c 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml
@@ -38,4 +38,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml
index ded1d2806a684..0fbc68a773122 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Data/SalesRuleData.xml
@@ -171,4 +171,8 @@
10
1
+
+
+ by_fixed
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml
index 3762b69b745c4..52598e98fd563 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml
@@ -16,11 +16,11 @@
-
+
-
+
@@ -71,34 +71,15 @@
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
From f50d5accea7f43cf5100772cc6fd90cdc15702ff Mon Sep 17 00:00:00 2001
From: Oleg Onufer
Date: Thu, 17 Jan 2019 14:52:32 +0200
Subject: [PATCH 021/254] MAGETWO-97240: Category rules should apply to complex
products
---
.../Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml
index 2b8b5eb4ad17c..210259f474ee9 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml
@@ -44,7 +44,7 @@
-
+
From 20fd58914382220cb4b5050d0540ec8f62c63814 Mon Sep 17 00:00:00 2001
From: Nazar Klovanych
Date: Fri, 18 Jan 2019 00:00:55 +0200
Subject: [PATCH 022/254] add mage/adminhtml/tools for Base64
---
app/code/Magento/Variable/view/adminhtml/web/variables.js | 3 ++-
.../wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Variable/view/adminhtml/web/variables.js b/app/code/Magento/Variable/view/adminhtml/web/variables.js
index 47f027f27102d..bf8bfbc570ce2 100644
--- a/app/code/Magento/Variable/view/adminhtml/web/variables.js
+++ b/app/code/Magento/Variable/view/adminhtml/web/variables.js
@@ -16,7 +16,8 @@ define([
'Magento_Variable/js/custom-directive-generator',
'Magento_Ui/js/lib/spinner',
'jquery/ui',
- 'prototype'
+ 'prototype',
+ 'mage/adminhtml/tools'
], function (jQuery, notification, $t, wysiwyg, registry, mageApply, utils, configGenerator, customGenerator, loader) {
'use strict';
diff --git a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js
index e6f12a2e51acf..96091e4099676 100644
--- a/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js
+++ b/lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js
@@ -9,7 +9,8 @@ define([
'Magento_Variable/js/config-directive-generator',
'Magento_Variable/js/custom-directive-generator',
'wysiwygAdapter',
- 'jquery'
+ 'jquery',
+ 'mage/adminhtml/tools'
], function (configDirectiveGenerator, customDirectiveGenerator, wysiwyg, jQuery) {
return function (config) {
tinymce.create('tinymce.plugins.magentovariable', {
From ddb1137b96ff0ae93c2e78dff62e02da31f9a02a Mon Sep 17 00:00:00 2001
From: Vivek Kumar
Date: Thu, 17 Jan 2019 17:53:04 +0530
Subject: [PATCH 023/254] Issue Fixed: #8086: Multiline admin field is broken
---
app/code/Magento/Config/Model/Config.php | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/code/Magento/Config/Model/Config.php b/app/code/Magento/Config/Model/Config.php
index b1074e92cc949..bec44e9d55757 100644
--- a/app/code/Magento/Config/Model/Config.php
+++ b/app/code/Magento/Config/Model/Config.php
@@ -424,6 +424,11 @@ protected function _processGroup(
if (!isset($fieldData['value'])) {
$fieldData['value'] = null;
}
+
+ if ($field->getType() == 'multiline' && is_array($fieldData['value'])) {
+ $fieldData['value'] = trim(implode(PHP_EOL, $fieldData['value']));
+ }
+
$data = [
'field' => $fieldId,
'groups' => $groups,
From 9ca8077242bd6bb7a09c8bb77f4495b39787fcb0 Mon Sep 17 00:00:00 2001
From: Sergii Ivashchenko
Date: Fri, 18 Jan 2019 14:07:02 +0200
Subject: [PATCH 024/254] Update
app/code/Magento/Eav/Model/Attribute/Data/File.php
Co-Authored-By: Nazar65
---
app/code/Magento/Eav/Model/Attribute/Data/File.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Eav/Model/Attribute/Data/File.php b/app/code/Magento/Eav/Model/Attribute/Data/File.php
index b8ca34986111b..8a29c1f2326cf 100644
--- a/app/code/Magento/Eav/Model/Attribute/Data/File.php
+++ b/app/code/Magento/Eav/Model/Attribute/Data/File.php
@@ -146,7 +146,7 @@ protected function _validateByRules($value)
return $this->_fileValidator->getMessages();
}
- if (empty($value['tmp_name']) && !is_uploaded_file($value['tmp_name'])) {
+ if (empty($value['tmp_name']) || !is_uploaded_file($value['tmp_name'])) {
return [__('"%1" is not a valid file.', $label)];
}
From 035e8d736961c1a074b8a732ec3bbd993670aacc Mon Sep 17 00:00:00 2001
From: rajneesh1dev
Date: Tue, 22 Jan 2019 11:24:14 +0530
Subject: [PATCH 025/254] Updated phpdocs, property access levels,removed
underscore, added backward compatible constructor params
---
.../Controller/Adminhtml/Sitemap/Save.php | 56 +++++++++----------
.../Controller/Adminhtml/Sitemap/SaveTest.php | 26 ++++-----
2 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php
index 23e1d2e786900..d0cb650028e99 100644
--- a/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php
+++ b/app/code/Magento/Sitemap/Controller/Adminhtml/Sitemap/Save.php
@@ -17,29 +17,29 @@ class Save extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
const MAX_FILENAME_LENGTH = 32;
/**
- * @var $_stringValidator
+ * @var \Magento\Framework\Validator\StringLength
*/
- public $_stringValidator;
+ private $stringValidator;
/**
- * @var $_pathValidator
+ * @var \Magento\MediaStorage\Model\File\Validator\AvailablePath
*/
- public $_pathValidator;
+ private $pathValidator;
/**
- * @var $_sitemapHelper
+ * @var \Magento\Sitemap\Helper\Data
*/
- public $_sitemapHelper;
+ private $sitemapHelper;
/**
- * @var $_filesystem
+ * @var \Magento\Framework\Filesystem
*/
- public $_filesystem;
+ private $filesystem;
/**
- * @var $_sitemapFactory
+ * @var \Magento\Sitemap\Model\SitemapFactory
*/
- public $_sitemapFactory;
+ private $sitemapFactory;
/**
* Save constructor.
@@ -52,18 +52,18 @@ class Save extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
*/
public function __construct(
\Magento\Backend\App\Action\Context $context,
- \Magento\Framework\Validator\StringLength $stringValidator,
- \Magento\MediaStorage\Model\File\Validator\AvailablePath $pathValidator,
- \Magento\Sitemap\Helper\Data $sitemapHelper,
- \Magento\Framework\Filesystem $filesystem,
- \Magento\Sitemap\Model\SitemapFactory $sitemapFactory
+ \Magento\Framework\Validator\StringLength $stringValidator = null,
+ \Magento\MediaStorage\Model\File\Validator\AvailablePath $pathValidator = null,
+ \Magento\Sitemap\Helper\Data $sitemapHelper = null,
+ \Magento\Framework\Filesystem $filesystem = null,
+ \Magento\Sitemap\Model\SitemapFactory $sitemapFactory = null
) {
parent::__construct($context);
- $this->_stringValidator = $stringValidator;
- $this->_pathValidator = $pathValidator;
- $this->_sitemapHelper = $sitemapHelper;
- $this->_filesystem = $filesystem;
- $this->_sitemapFactory = $sitemapFactory;
+ $this->stringValidator = $stringValidator ?: $this->_objectManager->get(\Magento\Framework\Validator\StringLength::class);
+ $this->pathValidator = $pathValidator ?: $this->_objectManager->get(\Magento\MediaStorage\Model\File\Validator\AvailablePath::class);
+ $this->sitemapHelper = $sitemapHelper ?: $this->_objectManager->get(\Magento\Sitemap\Helper\Data::class);
+ $this->filesystem = $filesystem ?: $this->_objectManager->get(\Magento\Framework\Filesystem::class);
+ $this->sitemapFactory = $sitemapFactory ?: $this->_objectManager->get(\Magento\Sitemap\Model\SitemapFactory::class);
}
/**
@@ -78,9 +78,9 @@ protected function validatePath(array $data)
if (!empty($data['sitemap_filename']) && !empty($data['sitemap_path'])) {
$data['sitemap_path'] = '/' . ltrim($data['sitemap_path'], '/');
$path = rtrim($data['sitemap_path'], '\\/') . '/' . $data['sitemap_filename'];
- $this->_pathValidator->setPaths($this->_sitemapHelper->getValidPaths());
- if (!$this->_pathValidator->isValid($path)) {
- foreach ($this->_pathValidator->getMessages() as $message) {
+ $this->pathValidator->setPaths($this->sitemapHelper->getValidPaths());
+ if (!$this->pathValidator->isValid($path)) {
+ foreach ($this->pathValidator->getMessages() as $message) {
$this->messageManager->addErrorMessage($message);
}
// save data in session
@@ -90,9 +90,9 @@ protected function validatePath(array $data)
}
$filename = rtrim($data['sitemap_filename']);
- $this->_stringValidator->setMax(self::MAX_FILENAME_LENGTH);
- if (!$this->_stringValidator->isValid($filename)) {
- foreach ($this->_stringValidator->getMessages() as $message) {
+ $this->stringValidator->setMax(self::MAX_FILENAME_LENGTH);
+ if (!$this->stringValidator->isValid($filename)) {
+ foreach ($this->stringValidator->getMessages() as $message) {
$this->messageManager->addErrorMessage($message);
}
// save data in session
@@ -113,7 +113,7 @@ protected function validatePath(array $data)
protected function clearSiteMap(\Magento\Sitemap\Model\Sitemap $model)
{
/** @var \Magento\Framework\Filesystem $directory */
- $directory = $this->_filesystem->getDirectoryWrite(DirectoryList::ROOT);
+ $directory = $this->filesystem->getDirectoryWrite(DirectoryList::ROOT);
if ($this->getRequest()->getParam('sitemap_id')) {
$model->load($this->getRequest()->getParam('sitemap_id'));
@@ -136,7 +136,7 @@ protected function saveData($data)
{
// init model and set data
/** @var \Magento\Sitemap\Model\Sitemap $model */
- $model = $this->_sitemapFactory->create();
+ $model = $this->sitemapFactory->create();
$this->clearSiteMap($model);
$model->setData($data);
diff --git a/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php b/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php
index 0e5758a3d8f48..70a8ab700d301 100644
--- a/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php
+++ b/app/code/Magento/Sitemap/Test/Unit/Controller/Adminhtml/Sitemap/SaveTest.php
@@ -14,67 +14,67 @@ class SaveTest extends \PHPUnit\Framework\TestCase
/**
* @var \Magento\Sitemap\Controller\Adminhtml\Sitemap\Save
*/
- protected $saveController;
+ private $saveController;
/**
* @var \Magento\Backend\App\Action\Context
*/
- protected $contextMock;
+ private $contextMock;
/**
* @var \Magento\Framework\HTTP\PhpEnvironment\Request|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $requestMock;
+ private $requestMock;
/**
* @var \Magento\Framework\Controller\ResultFactory|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $resultFactoryMock;
+ private $resultFactoryMock;
/**
* @var \Magento\Backend\Model\View\Result\Redirect|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $resultRedirectMock;
+ private $resultRedirectMock;
/**
* @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $objectManagerMock;
+ private $objectManagerMock;
/**
* @var \Magento\Framework\Message\ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $messageManagerMock;
+ private $messageManagerMock;
/**
* @var \Magento\Framework\Validator\StringLength|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $lengthValidator;
+ private $lengthValidator;
/**
* @var \Magento\MediaStorage\Model\File\Validator\AvailablePath|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $pathValidator;
+ private $pathValidator;
/**
* @var \Magento\Sitemap\Helper\Data|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $helper;
+ private $helper;
/**
* @var \Magento\Framework\Filesystem|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $fileSystem;
+ private $fileSystem;
/**
* @var \Magento\Sitemap\Model\SitemapFactory|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $siteMapFactory;
+ private $siteMapFactory;
/**
* @var \Magento\Backend\Model\Session|\PHPUnit_Framework_MockObject_MockObject
*/
- protected $session;
+ private $session;
protected function setUp()
{
From f669a4d2982579d768cb9c09fecceb720e3582e4 Mon Sep 17 00:00:00 2001
From: Nainesh
Date: Thu, 17 Jan 2019 16:54:48 +0530
Subject: [PATCH 026/254] 'Fixes-for-customer-login-page-input-field' :: On
customer login page input field are short width on tablet view
---
.../Magento/blank/Magento_Customer/web/css/source/_module.less | 2 +-
.../Magento/luma/Magento_Customer/web/css/source/_module.less | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less
index 9df59ca5dac92..a94fedbcbbd14 100644
--- a/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less
+++ b/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less
@@ -421,7 +421,7 @@
> .field {
> .control {
- width: 55%;
+ width: 80%;
}
}
}
diff --git a/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
index 2e7856d390bd0..61fc2610fc2e5 100755
--- a/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
+++ b/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
@@ -375,7 +375,7 @@
.fieldset {
> .field {
> .control {
- width: 55%;
+ width: 80%;
}
}
}
From 40a62741285b064fd9e4850244605e2dfed44a16 Mon Sep 17 00:00:00 2001
From: Nainesh
Date: Thu, 17 Jan 2019 16:54:48 +0530
Subject: [PATCH 027/254] 'Fixes-for-customer-login-page-input-field' :: On
customer login page input field are short width on tablet view
---
.../Magento/blank/Magento_Customer/web/css/source/_module.less | 2 +-
.../Magento/luma/Magento_Customer/web/css/source/_module.less | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less
index 9df59ca5dac92..a94fedbcbbd14 100644
--- a/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less
+++ b/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less
@@ -421,7 +421,7 @@
> .field {
> .control {
- width: 55%;
+ width: 80%;
}
}
}
diff --git a/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
index 2e7856d390bd0..61fc2610fc2e5 100755
--- a/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
+++ b/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
@@ -375,7 +375,7 @@
.fieldset {
> .field {
> .control {
- width: 55%;
+ width: 80%;
}
}
}
From 207a1594c13921d943cf1f96a4c781ea94ac7f05 Mon Sep 17 00:00:00 2001
From: Wouter Samaey
Date: Thu, 24 Jan 2019 13:57:43 +0100
Subject: [PATCH 028/254] Added original exception as the cause to the new
exception on product delete error
---
app/code/Magento/Catalog/Model/ProductRepository.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Catalog/Model/ProductRepository.php b/app/code/Magento/Catalog/Model/ProductRepository.php
index d124bf5e42639..91830482b9250 100644
--- a/app/code/Magento/Catalog/Model/ProductRepository.php
+++ b/app/code/Magento/Catalog/Model/ProductRepository.php
@@ -647,7 +647,8 @@ public function delete(ProductInterface $product)
throw new CouldNotSaveException(__($e->getMessage()));
} catch (\Exception $e) {
throw new \Magento\Framework\Exception\StateException(
- __('The "%1" product couldn\'t be removed.', $sku)
+ __('The "%1" product couldn\'t be removed.', $sku),
+ $e
);
}
$this->removeProductFromLocalCache($sku);
From 02d7b9329bb78511761d905951b7abb9428e29ae Mon Sep 17 00:00:00 2001
From: Wouter Samaey
Date: Thu, 24 Jan 2019 14:20:46 +0100
Subject: [PATCH 029/254] =?UTF-8?q?Added=20another=20=E2=80=9Ccause?=
=?UTF-8?q?=E2=80=9D=20exception=20to=20the=20new=20exception?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/code/Magento/Catalog/Model/ProductRepository.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Catalog/Model/ProductRepository.php b/app/code/Magento/Catalog/Model/ProductRepository.php
index 91830482b9250..48f45d0ce9373 100644
--- a/app/code/Magento/Catalog/Model/ProductRepository.php
+++ b/app/code/Magento/Catalog/Model/ProductRepository.php
@@ -644,7 +644,7 @@ public function delete(ProductInterface $product)
unset($this->instancesById[$product->getId()]);
$this->resourceModel->delete($product);
} catch (ValidatorException $e) {
- throw new CouldNotSaveException(__($e->getMessage()));
+ throw new CouldNotSaveException(__($e->getMessage()), $e);
} catch (\Exception $e) {
throw new \Magento\Framework\Exception\StateException(
__('The "%1" product couldn\'t be removed.', $sku),
From 122e5c2f61bd29fa6a329af2f23f4441a64b1ea9 Mon Sep 17 00:00:00 2001
From: LisovyiEvhenii
Date: Thu, 24 Jan 2019 15:34:04 +0200
Subject: [PATCH 030/254] #13982: Customer Login Block sets the title for the
page when rendered. Move setPageTitle from Block to layout configs
---
app/code/Magento/Customer/Block/Form/Login.php | 9 ---------
.../view/frontend/layout/customer_account_login.xml | 5 +++++
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/app/code/Magento/Customer/Block/Form/Login.php b/app/code/Magento/Customer/Block/Form/Login.php
index 7b265ae1f0f32..d3d3306a49b44 100644
--- a/app/code/Magento/Customer/Block/Form/Login.php
+++ b/app/code/Magento/Customer/Block/Form/Login.php
@@ -47,15 +47,6 @@ public function __construct(
$this->_customerSession = $customerSession;
}
- /**
- * @return $this
- */
- protected function _prepareLayout()
- {
- $this->pageConfig->getTitle()->set(__('Customer Login'));
- return parent::_prepareLayout();
- }
-
/**
* Retrieve form posting url
*
diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml
index d49dae6dee58f..00f9c4ed84d24 100644
--- a/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml
+++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml
@@ -7,6 +7,11 @@
-->
+
+
+ Customer Login
+
+
From 40d9c7e452eaae742f35ea587bbc6f8a2d3fc8d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Bajsarowicz?=
Date: Thu, 24 Jan 2019 20:21:00 +0100
Subject: [PATCH 031/254] Optimize snail_case replacement to PascalCase
---
.../Magento/Catalog/Controller/Adminhtml/Product/GridOnly.php | 2 +-
.../Unit/Model/Category/CurrentUrlRewritesRegeneratorTest.php | 2 +-
.../Unit/Model/Product/CurrentUrlRewritesRegeneratorTest.php | 2 +-
.../Test/Unit/Observer/AfterImportDataObserverTest.php | 2 +-
.../Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php | 2 +-
.../Tax/Test/Unit/Model/Sales/Total/Quote/ShippingTest.php | 2 +-
.../Test/Fixture/CatalogSearchQuery/QueryText.php | 2 +-
.../tests/app/Magento/Widget/Test/Handler/Widget/Curl.php | 2 +-
.../Magento/Framework/Api/SimpleDataObjectConverter.php | 4 ++--
lib/internal/Magento/Framework/Code/NameBuilder.php | 2 +-
lib/internal/Magento/Framework/DataObject.php | 4 ++--
lib/internal/Magento/Framework/DataObject/Copy.php | 4 ++--
lib/internal/Magento/Framework/Module/PackageInfo.php | 3 +--
13 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/GridOnly.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/GridOnly.php
index 40e62895caffc..2ddd16b00dfd0 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/GridOnly.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/GridOnly.php
@@ -47,7 +47,7 @@ public function execute()
$this->productBuilder->build($this->getRequest());
$block = $this->getRequest()->getParam('gridOnlyBlock');
- $blockClassSuffix = str_replace(' ', '_', ucwords(str_replace('_', ' ', $block)));
+ $blockClassSuffix = ucwords($block, '_');
/** @var \Magento\Framework\Controller\Result\Raw $resultRaw */
$resultRaw = $this->resultRawFactory->create();
diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/CurrentUrlRewritesRegeneratorTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/CurrentUrlRewritesRegeneratorTest.php
index fbc620a6d741a..294cf8562906d 100644
--- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/CurrentUrlRewritesRegeneratorTest.php
+++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Category/CurrentUrlRewritesRegeneratorTest.php
@@ -252,7 +252,7 @@ protected function getCurrentRewritesMocks($currentRewrites)
->disableOriginalConstructor()->getMock();
foreach ($urlRewrite as $key => $value) {
$url->expects($this->any())
- ->method('get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))))
+ ->method('get' . str_replace('_', '', ucwords($key, '_')))
->will($this->returnValue($value));
}
$rewrites[] = $url;
diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Product/CurrentUrlRewritesRegeneratorTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Product/CurrentUrlRewritesRegeneratorTest.php
index 4855478b8488a..c431743fc0b51 100644
--- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Product/CurrentUrlRewritesRegeneratorTest.php
+++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/Product/CurrentUrlRewritesRegeneratorTest.php
@@ -294,7 +294,7 @@ protected function getCurrentRewritesMocks($currentRewrites)
->disableOriginalConstructor()->getMock();
foreach ($urlRewrite as $key => $value) {
$url->expects($this->any())
- ->method('get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))))
+ ->method('get' . str_replace('_', '', ucwords($key, '_')))
->will($this->returnValue($value));
}
$rewrites[] = $url;
diff --git a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/AfterImportDataObserverTest.php b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/AfterImportDataObserverTest.php
index fd9ab10537f1c..3984d949332d3 100644
--- a/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/AfterImportDataObserverTest.php
+++ b/app/code/Magento/CatalogUrlRewrite/Test/Unit/Observer/AfterImportDataObserverTest.php
@@ -694,7 +694,7 @@ protected function currentUrlRewritesRegeneratorGetCurrentRewritesMocks($current
->disableOriginalConstructor()->getMock();
foreach ($urlRewrite as $key => $value) {
$url->expects($this->any())
- ->method('get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))))
+ ->method('get' . str_replace('_', '', ucwords($key, '_')))
->will($this->returnValue($value));
}
$rewrites[] = $url;
diff --git a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php
index bf49f3d479132..77da6950fecf7 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/Calculation/RateRepositoryTest.php
@@ -252,7 +252,7 @@ private function getTaxRateMock(array $taxRateData)
foreach ($taxRateData as $key => $value) {
// convert key from snake case to upper case
$taxRateMock->expects($this->any())
- ->method('get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key))))
+ ->method('get' . str_replace('_', '', ucwords($key, '_')))
->will($this->returnValue($value));
}
diff --git a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/ShippingTest.php b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/ShippingTest.php
index 77e25d6f14574..2bfebc984bb81 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/ShippingTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/ShippingTest.php
@@ -133,7 +133,7 @@ private function getMockObject($className, array $objectState)
$getterValueMap = [];
$methods = ['__wakeup'];
foreach ($objectState as $key => $value) {
- $getterName = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));
+ $getterName = 'get' . str_replace('_', '', ucwords($key, '_'));
$getterValueMap[$getterName] = $value;
$methods[] = $getterName;
}
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php
index e2193b799c3be..11a8693723f25 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php
@@ -61,7 +61,7 @@ private function createProducts(FixtureFactory $fixtureFactory, $productsData)
$searchValue = isset($productData[2]) ? $productData[2] : $productData[1];
if ($this->data === null) {
if ($product->hasData($searchValue)) {
- $getProperty = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $searchValue)));
+ $getProperty = 'get' . str_replace('_', '', ucwords($searchValue, '_'));
$this->data = $product->$getProperty();
} else {
$this->data = $searchValue;
diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Handler/Widget/Curl.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Handler/Widget/Curl.php
index 1a024eefe162d..13c16c888fbb0 100644
--- a/dev/tests/functional/tests/app/Magento/Widget/Test/Handler/Widget/Curl.php
+++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Handler/Widget/Curl.php
@@ -172,7 +172,7 @@ protected function prepareWidgetInstance(array $data)
$widgetInstances = [];
foreach ($data['widget_instance'] as $key => $widgetInstance) {
$pageGroup = $widgetInstance['page_group'];
- $method = 'prepare' . str_replace(' ', '', ucwords(str_replace('_', ' ', $pageGroup))) . 'Group';
+ $method = 'prepare' . str_replace('_', '', ucwords($pageGroup, '_')) . 'Group';
if (!method_exists(__CLASS__, $method)) {
throw new \Exception('Method for prepare page group "' . $method . '" is not exist.');
}
diff --git a/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php b/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php
index 49d824a4f2e5a..4dbf4680f8988 100644
--- a/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php
+++ b/lib/internal/Magento/Framework/Api/SimpleDataObjectConverter.php
@@ -58,7 +58,7 @@ public function convertKeysToCamelCase(array $dataArray)
if (is_array($fieldValue) && !$this->_isSimpleSequentialArray($fieldValue)) {
$fieldValue = $this->convertKeysToCamelCase($fieldValue);
}
- $fieldName = lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $fieldName))));
+ $fieldName = lcfirst(str_replace('_', '', ucwords($fieldName, '_')));
$response[$fieldName] = $fieldValue;
}
return $response;
@@ -148,7 +148,7 @@ protected function _unpackAssociativeArray($data)
*/
public static function snakeCaseToUpperCamelCase($input)
{
- return str_replace(' ', '', ucwords(str_replace('_', ' ', $input)));
+ return str_replace('_', '', ucwords($input, '_'));
}
/**
diff --git a/lib/internal/Magento/Framework/Code/NameBuilder.php b/lib/internal/Magento/Framework/Code/NameBuilder.php
index c27a896b65f04..13a17d7c13b0f 100644
--- a/lib/internal/Magento/Framework/Code/NameBuilder.php
+++ b/lib/internal/Magento/Framework/Code/NameBuilder.php
@@ -23,7 +23,7 @@ public function buildClassName($parts)
$separator = '\\';
$string = join($separator, $parts);
$string = str_replace('_', $separator, $string);
- $className = str_replace(' ', $separator, ucwords(str_replace($separator, ' ', $string)));
+ $className = ucwords($string, $separator);
return $className;
}
}
diff --git a/lib/internal/Magento/Framework/DataObject.php b/lib/internal/Magento/Framework/DataObject.php
index 9ff004c53bb9b..7f056d38c8fd7 100644
--- a/lib/internal/Magento/Framework/DataObject.php
+++ b/lib/internal/Magento/Framework/DataObject.php
@@ -202,7 +202,7 @@ protected function _getData($key)
*/
public function setDataUsingMethod($key, $args = [])
{
- $method = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));
+ $method = 'set' . str_replace('_', '', ucwords($key, '_'));
$this->{$method}($args);
return $this;
}
@@ -216,7 +216,7 @@ public function setDataUsingMethod($key, $args = [])
*/
public function getDataUsingMethod($key, $args = null)
{
- $method = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));
+ $method = 'get' . str_replace('_', '', ucwords($key, '_'));
return $this->{$method}($args);
}
diff --git a/lib/internal/Magento/Framework/DataObject/Copy.php b/lib/internal/Magento/Framework/DataObject/Copy.php
index 8d8896c6cb62a..6a908ae78a343 100644
--- a/lib/internal/Magento/Framework/DataObject/Copy.php
+++ b/lib/internal/Magento/Framework/DataObject/Copy.php
@@ -239,7 +239,7 @@ protected function _setFieldsetFieldValue($target, $targetCode, $value)
*/
protected function getAttributeValueFromExtensibleDataObject($source, $code)
{
- $method = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $code)));
+ $method = 'get' . str_replace('_', '', ucwords($code, '_'));
$methodExists = method_exists($source, $method);
if ($methodExists == true) {
@@ -273,7 +273,7 @@ protected function getAttributeValueFromExtensibleDataObject($source, $code)
*/
protected function setAttributeValueFromExtensibleDataObject($target, $code, $value)
{
- $method = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $code)));
+ $method = 'set' . str_replace('_', '', ucwords($code, '_'));
$methodExists = method_exists($target, $method);
if ($methodExists == true) {
diff --git a/lib/internal/Magento/Framework/Module/PackageInfo.php b/lib/internal/Magento/Framework/Module/PackageInfo.php
index 0dce507ba26f4..848ad4495f39e 100644
--- a/lib/internal/Magento/Framework/Module/PackageInfo.php
+++ b/lib/internal/Magento/Framework/Module/PackageInfo.php
@@ -176,8 +176,7 @@ public function getNonExistingDependencies()
protected function convertPackageNameToModuleName($packageName)
{
$moduleName = str_replace('magento/module-', '', $packageName);
- $moduleName = str_replace('-', ' ', $moduleName);
- $moduleName = str_replace(' ', '', ucwords($moduleName));
+ $moduleName = str_replace('-', '', ucwords($moduleName, '-'));
return 'Magento_' . $moduleName;
}
From 93f1caa3623e711b6699107bb3dcb24e982eb750 Mon Sep 17 00:00:00 2001
From: LisovyiEvhenii
Date: Fri, 25 Jan 2019 10:32:37 +0200
Subject: [PATCH 032/254] #13982: fix page title to be displayed both in head's
and page's title
---
.../view/frontend/layout/customer_account_login.xml | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml
index 00f9c4ed84d24..3518df736c4ac 100644
--- a/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml
+++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_login.xml
@@ -6,12 +6,10 @@
*/
-->
+
+ Customer Login
+
-
-
- Customer Login
-
-
From 5c7d8994776ce6d902b7ef793afd8fafd21722f1 Mon Sep 17 00:00:00 2001
From: Graham Wharton
Date: Fri, 25 Jan 2019 13:22:21 +0000
Subject: [PATCH 033/254] Changed references to "Store" to "Scope" in framework
components.
---
.../Sales/Model/Order/Email/SenderBuilder.php | 2 +-
.../Model/Order/Email/SenderBuilderTest.php | 8 +++---
.../Mail/Template/TransportBuilder.php | 26 ++++++++++++++-----
.../Unit/Template/TransportBuilderTest.php | 8 +++---
4 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php b/app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php
index a7d749ec04c7d..ed9e38822245f 100644
--- a/app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php
+++ b/app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php
@@ -106,7 +106,7 @@ protected function configureEmailTemplate()
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
- $this->transportBuilder->setFromByStore(
+ $this->transportBuilder->setFromByScope(
$this->identityContainer->getEmailIdentity(),
$this->identityContainer->getStore()->getId()
);
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/SenderBuilderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/SenderBuilderTest.php
index 759d60d9e6613..24cd54e3a46b3 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/SenderBuilderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/SenderBuilderTest.php
@@ -76,7 +76,7 @@ protected function setUp()
'setTemplateIdentifier',
'setTemplateOptions',
'setTemplateVars',
- 'setFromByStore',
+ 'setFromByScope',
]
);
@@ -103,7 +103,7 @@ protected function setUp()
->method('getEmailIdentity')
->will($this->returnValue($emailIdentity));
$this->transportBuilder->expects($this->once())
- ->method('setFromByStore')
+ ->method('setFromByScope')
->with($this->equalTo($emailIdentity), 1);
$this->identityContainerMock->expects($this->once())
@@ -146,7 +146,7 @@ public function testSend()
->method('getId')
->willReturn(1);
$this->transportBuilder->expects($this->once())
- ->method('setFromByStore')
+ ->method('setFromByScope')
->with($identity, 1);
$this->transportBuilder->expects($this->once())
->method('addTo')
@@ -176,7 +176,7 @@ public function testSendCopyTo()
->method('addTo')
->with($this->equalTo('example@mail.com'));
$this->transportBuilder->expects($this->once())
- ->method('setFromByStore')
+ ->method('setFromByScope')
->with($identity, 1);
$this->identityContainerMock->expects($this->once())
->method('getStore')
diff --git a/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php b/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
index a7bb96122a84d..0d69b3d96cebf 100644
--- a/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
+++ b/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
@@ -177,29 +177,43 @@ public function setReplyTo($email, $name = null)
/**
* Set mail from address
*
- * @deprecated This function sets the from address for the first store only.
- * new function setFromByStore introduced to allow setting of from address
- * based on store.
- * @see setFromByStore()
+ * @deprecated This function sets the from address but does not provide
+ * a way of setting the correct from addresses based on the scope.
+ * @see setFromByScope()
*
* @param string|array $from
* @return $this
*/
public function setFrom($from)
{
- return $this->setFromByStore($from, null);
+ return $this->setFromByScope($from, null);
}
/**
* Set mail from address by store
*
+ * @deprecated Use setFromByScope
+ * @see setFromByScope()
+ *
* @param string|array $from
* @param string|int $store
* @return $this
*/
public function setFromByStore($from, $store = null)
{
- $result = $this->_senderResolver->resolve($from, $store);
+ return $this->setFromByScope($from, $store);
+ }
+
+ /**
+ * Set mail from address by scopeId
+ *
+ * @param string|array $from
+ * @param string|int $scopeId
+ * @return $this
+ */
+ public function setFromByScope($from, $scopeId = null)
+ {
+ $result = $this->_senderResolver->resolve($from, $scopeId);
$this->message->setFromAddress($result['email'], $result['name']);
return $this;
}
diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php
index b476eecd7f59f..5e3309af6497b 100644
--- a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php
+++ b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php
@@ -167,20 +167,20 @@ public function getTransportDataProvider()
/**
* @return void
*/
- public function testSetFromByStore()
+ public function testSetFromByScope()
{
$sender = ['email' => 'from@example.com', 'name' => 'name'];
- $store = 1;
+ $scopeId = 1;
$this->senderResolverMock->expects($this->once())
->method('resolve')
- ->with($sender, $store)
+ ->with($sender, $scopeId)
->willReturn($sender);
$this->messageMock->expects($this->once())
->method('setFromAddress')
->with($sender['email'], $sender['name'])
->willReturnSelf();
- $this->builder->setFromByStore($sender, $store);
+ $this->builder->setFromByScope($sender, $scopeId);
}
/**
From 71b24df7f2262f95a01732a2bbb1abb96fe53f23 Mon Sep 17 00:00:00 2001
From: Oleg Onufer
Date: Fri, 25 Jan 2019 16:38:57 +0200
Subject: [PATCH 034/254] MAGETWO-97240: Category rules should apply to complex
products
---
...tegoryRulesShouldApplyToComplexProductsTest.xml | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml
index 52598e98fd563..d8c5b42dbaaaf 100644
--- a/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/StorefrontCategoryRulesShouldApplyToComplexProductsTest.xml
@@ -31,28 +31,28 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
From a0516563c682a9d3b51ffd0f0aa7040591dedf0a Mon Sep 17 00:00:00 2001
From: Nazar Klovanych
Date: Sat, 26 Jan 2019 21:44:12 +0200
Subject: [PATCH 035/254] Update File.php to resolve issue 19983
---
app/code/Magento/Eav/Model/Attribute/Data/File.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Eav/Model/Attribute/Data/File.php b/app/code/Magento/Eav/Model/Attribute/Data/File.php
index 8a29c1f2326cf..32283d38a065f 100644
--- a/app/code/Magento/Eav/Model/Attribute/Data/File.php
+++ b/app/code/Magento/Eav/Model/Attribute/Data/File.php
@@ -146,7 +146,7 @@ protected function _validateByRules($value)
return $this->_fileValidator->getMessages();
}
- if (empty($value['tmp_name']) || !is_uploaded_file($value['tmp_name'])) {
+ if (!empty($value['tmp_name']) || !file_exists($value['tmp_name'])) {
return [__('"%1" is not a valid file.', $label)];
}
From 13722031d11aeb6ce92f0272db06714bce7840e0 Mon Sep 17 00:00:00 2001
From: Nazar
Date: Sat, 26 Jan 2019 21:45:56 +0200
Subject: [PATCH 036/254] Update File.php
---
app/code/Magento/Eav/Model/Attribute/Data/File.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Eav/Model/Attribute/Data/File.php b/app/code/Magento/Eav/Model/Attribute/Data/File.php
index 32283d38a065f..a52c88261166e 100644
--- a/app/code/Magento/Eav/Model/Attribute/Data/File.php
+++ b/app/code/Magento/Eav/Model/Attribute/Data/File.php
@@ -146,7 +146,7 @@ protected function _validateByRules($value)
return $this->_fileValidator->getMessages();
}
- if (!empty($value['tmp_name']) || !file_exists($value['tmp_name'])) {
+ if (!empty($value['tmp_name']) && !file_exists($value['tmp_name'])) {
return [__('"%1" is not a valid file.', $label)];
}
From 4dc983488b0dafa8a67b3cd1866b0bfdbb8c5868 Mon Sep 17 00:00:00 2001
From: DmytroPaidych
Date: Tue, 29 Jan 2019 04:22:01 +0200
Subject: [PATCH 037/254] MAGETWO-97212: Enable skipped test - Move Anchored
Category with Products (cron is ON, "Update on Save")
---
.../LayeredNavigation/Test/Block/Navigation.php | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php
index 9d2b6a0ed0e7a..97c43d7c4e2ce 100644
--- a/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php
+++ b/dev/tests/functional/tests/app/Magento/LayeredNavigation/Test/Block/Navigation.php
@@ -131,16 +131,17 @@ public function applyFilter($filter, $linkPattern)
*/
public function isCategoryVisible(Category $category, $qty)
{
- $link = $this->_rootElement->find(sprintf($this->optionTitle, 'Category'), Locator::SELECTOR_XPATH);
- if ($link->isVisible()) {
- $link->click();
+ $link = sprintf($this->categoryName, $category->getName());
+
+ if (!$this->_rootElement->find($link, Locator::SELECTOR_XPATH)->isVisible()) {
+ $this->openFilterContainer('Category', $link);
return $this->_rootElement->find(
- sprintf($this->categoryName, $category->getName()) . sprintf($this->productQtyInCategory, $qty),
+ $link . sprintf($this->productQtyInCategory, $qty),
Locator::SELECTOR_XPATH
)->isVisible();
} else {
return $this->_rootElement->find(
- sprintf($this->categoryName, $category->getName()) . sprintf($this->productQty, $qty),
+ $link . sprintf($this->productQty, $qty),
Locator::SELECTOR_XPATH
)->isVisible();
}
From e907219ec470321c1638d4ff69935e08e8b450ab Mon Sep 17 00:00:00 2001
From: DmytroPaidych
Date: Wed, 30 Jan 2019 06:07:42 +0200
Subject: [PATCH 038/254] MAGETWO-97237: Delete Product Staging Update when the
Product is used
---
.../Test/Mftf/Data/ProductLinkData.xml | 19 +++++++++++++++++++
.../Test/Mftf/Data/ProductLinksData.xml | 14 ++++++++++++++
.../AdminCreateWidgetActionGroup.xml | 12 +++---------
.../Widget/Test/Mftf/Data/WidgetsData.xml | 1 -
.../Test/Mftf/Page/AdminNewWidgetPage.xml | 1 +
5 files changed, 37 insertions(+), 10 deletions(-)
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Data/ProductLinkData.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Data/ProductLinksData.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductLinkData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductLinkData.xml
new file mode 100644
index 0000000000000..000bb2095002c
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductLinkData.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+ related
+ simple
+ 1
+ Qty1000
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductLinksData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductLinksData.xml
new file mode 100644
index 0000000000000..bd4f807880ab8
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductLinksData.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ RelatedProductLink
+
+
diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml
index 2dcfc4e99333a..969ab58b04876 100644
--- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml
+++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminCreateWidgetActionGroup.xml
@@ -65,23 +65,17 @@
-
+
-
-
-
-
-
-
-
-
+
+
diff --git a/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml b/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
index 6773dee7cfaa9..1ce16a01fab1d 100644
--- a/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
+++ b/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
@@ -33,7 +33,6 @@
Header
-
Catalog Product Link
Product Link Block Template
diff --git a/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml b/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml
index d495a36f68d0a..2e08c239c810a 100644
--- a/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml
+++ b/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml
@@ -10,5 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
+
From d7ba787a107ec5599dd60af84ca99fa73fff6b40 Mon Sep 17 00:00:00 2001
From: Arvinda kumar
Date: Thu, 31 Jan 2019 12:07:12 +0530
Subject: [PATCH 039/254] _fields.less updated
_fields.less updated
---
.../adminhtml/Magento/backend/web/css/source/forms/_fields.less | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
index 81a55443d6a3c..abef32dc48cd0 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/_fields.less
@@ -531,7 +531,6 @@
& > .admin__field {
&:first-child {
position: static;
- width: 100%;
& > .admin__field-label {
#mix-grid .column(@field-label-grid__column, @field-grid__columns);
cursor: pointer;
@@ -685,6 +684,7 @@
margin: 0;
opacity: 1;
position: static;
+ width: 100%;
}
}
& > .admin__field-label {
From e25e3ddf94ea1b1726aa17dd3eb90503714325dc Mon Sep 17 00:00:00 2001
From: DmytroPaidych
Date: Thu, 31 Jan 2019 14:01:35 +0200
Subject: [PATCH 040/254] MAGETWO-97237: Delete Product Staging Update when the
Product is used
---
.../Catalog/Test/Mftf/Data/WidgetsData.xml | 15 +++++++++++++++
.../Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml | 14 ++++++++++++++
.../Test/Mftf/Section/AdminNewWidgetSection.xml | 14 ++++++++++++++
.../AdminNewWidgetSelectProductPopupSection.xml | 0
.../Magento/Widget/Test/Mftf/Data/WidgetsData.xml | 4 ----
.../Widget/Test/Mftf/Page/AdminNewWidgetPage.xml | 1 -
.../Test/Mftf/Section/AdminNewWidgetSection.xml | 1 -
7 files changed, 43 insertions(+), 6 deletions(-)
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Data/WidgetsData.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Section/AdminNewWidgetSection.xml
rename app/code/Magento/{Widget => Catalog}/Test/Mftf/Section/AdminNewWidgetSelectProductPopupSection.xml (100%)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/WidgetsData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/WidgetsData.xml
new file mode 100644
index 0000000000000..83f0a56c21545
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/WidgetsData.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+ Catalog Product Link
+ Product Link Block Template
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml b/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml
new file mode 100644
index 0000000000000..f645c6cd54278
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminNewWidgetSection.xml
new file mode 100644
index 0000000000000..5329ad48c8f43
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminNewWidgetSection.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSelectProductPopupSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminNewWidgetSelectProductPopupSection.xml
similarity index 100%
rename from app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSelectProductPopupSection.xml
rename to app/code/Magento/Catalog/Test/Mftf/Section/AdminNewWidgetSelectProductPopupSection.xml
diff --git a/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml b/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
index 1ce16a01fab1d..27222298408de 100644
--- a/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
+++ b/app/code/Magento/Widget/Test/Mftf/Data/WidgetsData.xml
@@ -32,8 +32,4 @@
Cart Price Rule Related
Header
-
- Catalog Product Link
- Product Link Block Template
-
diff --git a/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml b/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml
index 2e08c239c810a..d495a36f68d0a 100644
--- a/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml
+++ b/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml
@@ -10,6 +10,5 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
-
diff --git a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml
index 22f8a1e0fe981..8cf7fcfa2ec6c 100644
--- a/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml
+++ b/app/code/Magento/Widget/Test/Mftf/Section/AdminNewWidgetSection.xml
@@ -29,6 +29,5 @@
-
From 366b06103238a145460e9128532951d6517fe30b Mon Sep 17 00:00:00 2001
From: DmytroPaidych
Date: Thu, 31 Jan 2019 15:15:02 +0200
Subject: [PATCH 041/254] MAGETWO-97237: Delete Product Staging Update when the
Product is used
---
app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml b/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml
index f645c6cd54278..e23a503266e33 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Page/AdminNewWidgetPage.xml
@@ -8,7 +8,7 @@
-
+
From 4bb06ef6bccb10c881d7803350060a177bfd60b9 Mon Sep 17 00:00:00 2001
From: Dipti 2Jcommerce
Date: Thu, 31 Jan 2019 19:00:59 +0530
Subject: [PATCH 042/254] ipad-view-order-summary-block
---
.../web/css/source/module/checkout/_order-summary.less | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less
index 9bad9518f5724..85a960e8bc05a 100644
--- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less
+++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less
@@ -148,14 +148,14 @@
}
.product-item-name-block {
- display: table-cell;
+ display: block;
padding-right: @indent__xs;
text-align: left;
}
.subtotal {
- display: table-cell;
- text-align: right;
+ display: block;
+ text-align: left;
}
.price {
From 99f260a14f48b56eaf8185f7c926fe01cfcd1fd7 Mon Sep 17 00:00:00 2001
From: Ilan Parmentier
Date: Thu, 31 Jan 2019 14:44:29 +0100
Subject: [PATCH 043/254] Update details.phtml
Good afternoon,
I just encountered a problem with product's tabs in product info.
I realized when description or other custom tabs have links, when you click on it, nothing happen.
It caused by the script mage/tabs.js in details.phtml.
The current link to trigger the tab is declared with data-role="switch" instead of a data-role="trigger".
https://github.com/magento/magento2/blob/4f232511ceba6f1f7bf6f73b3b5609bd087f8c74/app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml#L24-L37
When not even the trigger and the header is declared respectively by data-role="heading" and data-role="trigger", the script based it search on the current collapsible panel declared by data-role="collapsible".
https://github.com/magento/magento2/blob/4f232511ceba6f1f7bf6f73b3b5609bd087f8c74/lib/web/mage/tabs.js#L99-L124
You can simply try by adding a link in the product description.
Tell me if I am wrong.
Cheers,
Ilan PARMENTIER
---
.../Catalog/view/frontend/templates/product/view/details.phtml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml
index af664051b1431..003ae6b0c3844 100644
--- a/app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml
+++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml
@@ -26,7 +26,7 @@
data-role="collapsible" id="tab-label-= /* @escapeNotVerified */ $alias ?>">
= /* @escapeNotVerified */ $label ?>
From d4027d61b968999d77c194c5517b19465af8ba55 Mon Sep 17 00:00:00 2001
From: Ravi Chandra
Date: Fri, 1 Feb 2019 18:05:35 +0530
Subject: [PATCH 044/254] Correct spelling
---
app/code/Magento/Ui/view/base/web/js/grid/data-storage.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Ui/view/base/web/js/grid/data-storage.js b/app/code/Magento/Ui/view/base/web/js/grid/data-storage.js
index dad67da3ea8ad..547cdab16cdf1 100644
--- a/app/code/Magento/Ui/view/base/web/js/grid/data-storage.js
+++ b/app/code/Magento/Ui/view/base/web/js/grid/data-storage.js
@@ -199,7 +199,7 @@ define([
},
/**
- * Caches requests object with provdided parameters
+ * Caches requests object with provided parameters
* and data object associated with it.
*
* @param {Object} data - Data associated with request.
From 60c0c10078a7d9db87603ffc6996e37c1ea4e8ad Mon Sep 17 00:00:00 2001
From: Ravi Chandra
Date: Fri, 1 Feb 2019 18:09:51 +0530
Subject: [PATCH 045/254] Correct spelling
---
app/code/Magento/Ui/view/base/web/js/lib/view/utils/bindings.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/bindings.js b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/bindings.js
index 77de8a1ceb0ed..48515b668f80d 100644
--- a/app/code/Magento/Ui/view/base/web/js/lib/view/utils/bindings.js
+++ b/app/code/Magento/Ui/view/base/web/js/lib/view/utils/bindings.js
@@ -89,7 +89,7 @@ define([
/**
* Adds specified bindings to each DOM element in
- * collection and evalutes them with provided context.
+ * collection and evaluates them with provided context.
*
* @param {(Object|Function)} data - Either bindings object or a function
* which returns bindings data for each element in collection.
From d5729beaf9f62ce9599de191d829a019edcf675f Mon Sep 17 00:00:00 2001
From: Serhiy Yelahin
Date: Mon, 4 Feb 2019 09:47:40 +0200
Subject: [PATCH 046/254] MAGETWO-97968: Minicart isn't updated for disabled
products
---
.../frontend/templates/cart/noItems.phtml | 7 ++++
.../view/frontend/web/js/empty-cart.js | 12 ++++++
...efrontGuestCheckoutDisabledProductTest.xml | 42 +++++++++++++++++--
3 files changed, 57 insertions(+), 4 deletions(-)
create mode 100644 app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
diff --git a/app/code/Magento/Checkout/view/frontend/templates/cart/noItems.phtml b/app/code/Magento/Checkout/view/frontend/templates/cart/noItems.phtml
index 1c0c221a550cd..67ac4a9335565 100644
--- a/app/code/Magento/Checkout/view/frontend/templates/cart/noItems.phtml
+++ b/app/code/Magento/Checkout/view/frontend/templates/cart/noItems.phtml
@@ -13,3 +13,10 @@
$block->escapeUrl($block->getContinueShoppingUrl())) ?>
= $block->getChildHtml('shopping.cart.table.after') ?>
+
\ No newline at end of file
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js b/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
new file mode 100644
index 0000000000000..27d38697afe39
--- /dev/null
+++ b/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
@@ -0,0 +1,12 @@
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+define([
+ 'Magento_Customer/js/customer-data'
+], function (customerData) {
+ 'use strict';
+
+ customerData.reload(['cart'], false);
+});
diff --git a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml
index ab0db2dac643e..456474bbc28cf 100644
--- a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml
+++ b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml
@@ -22,6 +22,9 @@
+
+
+
@@ -73,13 +76,14 @@
+
-
+
@@ -97,7 +101,6 @@
-
@@ -114,10 +117,41 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 92d4ffadeb479344c01ad35d8fb5149cb545d7c0 Mon Sep 17 00:00:00 2001
From: Dipti 2Jcommerce
Date: Mon, 4 Feb 2019 15:21:34 +0530
Subject: [PATCH 047/254] ipad-view-order-summary-block
---
.../module/checkout/_order-summary.less | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less
index 85a960e8bc05a..ae21a3877c350 100644
--- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less
+++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less
@@ -227,3 +227,27 @@
}
}
}
+
+//
+// Tablet
+// _____________________________________________
+
+@media only screen and (max-width: @screen__m) {
+ .opc-block-summary {
+ .product-item {
+ .product-item-inner {
+ display: block;
+ }
+
+ .product-item-name-block {
+ display: block;
+ text-align: left;
+ }
+
+ .subtotal {
+ display: block;
+ text-align: left;
+ }
+ }
+ }
+}
\ No newline at end of file
From 022e8eb3a1e0a86a626bc1a41cefcad53181b3a3 Mon Sep 17 00:00:00 2001
From: Serhiy Yelahin
Date: Mon, 4 Feb 2019 16:27:59 +0200
Subject: [PATCH 048/254] MAGETWO-97968: Minicart isn't updated for disabled
products
---
.../Test/StorefrontGuestCheckoutDisabledProductTest.xml | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml
index 456474bbc28cf..29715d073d01b 100644
--- a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml
+++ b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml
@@ -75,6 +75,8 @@
+
+
@@ -85,13 +87,11 @@
-
-
@@ -100,7 +100,6 @@
-
@@ -124,22 +123,18 @@
-
-
-
-
From a18f3b67a2c7c58368ea72f97802c26b67c56907 Mon Sep 17 00:00:00 2001
From: Kevin Kozan
Date: Mon, 4 Feb 2019 11:34:47 -0600
Subject: [PATCH 049/254] MC-4416: Convert CreateProductAttributeEntityTest to
MFTF
- Variation MC-10894
---
.../AdminProductAttributeActionGroup.xml | 17 ++++++
.../Test/Mftf/Data/ProductAttributeData.xml | 5 ++
.../AdminCreateProductAttributeSection.xml | 8 +++
.../AdminProductAttributeGridSection.xml | 2 +-
.../Test/CreateProductAttributeEntityTest.xml | 53 +++++++++++++++++++
5 files changed, 84 insertions(+), 1 deletion(-)
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
index 80cadbb6571f2..f998108c890d8 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
@@ -47,4 +47,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
index b367cdcab9d8b..4c106b6e69226 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
@@ -115,4 +115,9 @@
true
ProductAttributeFrontendLabel
+
+ text
+ defaultValue
+ No
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
index 05be20b14acc0..72a0639403501 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
@@ -24,6 +24,10 @@
+
@@ -77,6 +81,10 @@
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml
index 160948f8f1f2c..d63198e1556d6 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml
@@ -10,7 +10,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
new file mode 100644
index 0000000000000..7449b6e473e2f
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From cc68f37e80688b5b74cde97267ce4eb91ef208c0 Mon Sep 17 00:00:00 2001
From: Kavitha
Date: Tue, 5 Feb 2019 10:20:14 -0600
Subject: [PATCH 050/254] MC-4379: Convert
SubcategoryNotIncludeInNavigationMenuTest to MFTF
---
.../Catalog/Test/Mftf/Data/CategoryData.xml | 6 +++
...ubcategoryIsNotVisibleInNavigationTest.xml | 53 +++++++++++++++++++
...tegoryIsNotVisibleInNavigationMenuTest.xml | 52 ++++++++++++++++++
...ubcategoryIsNotVisibleInNavigationTest.xml | 53 +++++++++++++++++++
...tegoryIsNotVisibleInNavigationMenuTest.xml | 52 ++++++++++++++++++
5 files changed, 216 insertions(+)
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml
index a11c3fd0d7afa..27167d03d528e 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/CategoryData.xml
@@ -104,4 +104,10 @@
false
true
+
+ InactiveNotInMenu
+ inactivenotinmenu
+ false
+ false
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
new file mode 100644
index 0000000000000..d6126916046a9
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml
new file mode 100644
index 0000000000000..9362719ba56de
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
new file mode 100644
index 0000000000000..2b8f47d1ca265
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml
new file mode 100644
index 0000000000000..e250fa7b15dd1
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 7b9c6058e8462165dd975ab9d005f671d29a5492 Mon Sep 17 00:00:00 2001
From: Alexandre Jardin
Date: Tue, 5 Feb 2019 15:11:29 +0100
Subject: [PATCH 051/254] Make the module list more deterministic
---
.../Framework/Module/ModuleList/Loader.php | 36 +++++++++++--
.../Test/Unit/ModuleList/LoaderTest.php | 51 +++++++++++++++++++
2 files changed, 82 insertions(+), 5 deletions(-)
diff --git a/lib/internal/Magento/Framework/Module/ModuleList/Loader.php b/lib/internal/Magento/Framework/Module/ModuleList/Loader.php
index bdfb77762b41c..80958f65e110e 100644
--- a/lib/internal/Magento/Framework/Module/ModuleList/Loader.php
+++ b/lib/internal/Magento/Framework/Module/ModuleList/Loader.php
@@ -126,16 +126,21 @@ private function getModuleConfigs()
*
* @param array $origList
* @return array
- * @SuppressWarnings(PHPMD.UnusedLocalVariable)
+ * @throws \Exception
*/
- private function sortBySequence($origList)
+ private function sortBySequence(array $origList): array
{
ksort($origList);
+ $modules = $this->prearrangeModules($origList);
+
$expanded = [];
- foreach ($origList as $moduleName => $value) {
+ foreach ($modules as $moduleName => $value) {
+ $sequence = $this->expandSequence($origList, $moduleName);
+ asort($sequence);
+
$expanded[] = [
'name' => $moduleName,
- 'sequence' => $this->expandSequence($origList, $moduleName),
+ 'sequence' => $sequence,
];
}
@@ -143,7 +148,7 @@ private function sortBySequence($origList)
$total = count($expanded);
for ($i = 0; $i < $total - 1; $i++) {
for ($j = $i; $j < $total; $j++) {
- if (in_array($expanded[$j]['name'], $expanded[$i]['sequence'])) {
+ if (in_array($expanded[$j]['name'], $expanded[$i]['sequence'], true)) {
$temp = $expanded[$i];
$expanded[$i] = $expanded[$j];
$expanded[$j] = $temp;
@@ -159,6 +164,27 @@ private function sortBySequence($origList)
return $result;
}
+ /**
+ * Prearrange all modules by putting those from Magento before the others
+ *
+ * @param array $modules
+ * @return array
+ */
+ private function prearrangeModules(array $modules): array
+ {
+ $breakdown = ['magento' => [], 'others' => []];
+
+ foreach ($modules as $moduleName => $moduleDetails) {
+ if (strpos($moduleName, 'Magento_') !== false) {
+ $breakdown['magento'][$moduleName] = $moduleDetails;
+ } else {
+ $breakdown['others'][$moduleName] = $moduleDetails;
+ }
+ }
+
+ return array_merge($breakdown['magento'], $breakdown['others']);
+ }
+
/**
* Accumulate information about all transitive "sequence" references
*
diff --git a/lib/internal/Magento/Framework/Module/Test/Unit/ModuleList/LoaderTest.php b/lib/internal/Magento/Framework/Module/Test/Unit/ModuleList/LoaderTest.php
index fe613450fd485..a62bb5fa70f97 100644
--- a/lib/internal/Magento/Framework/Module/Test/Unit/ModuleList/LoaderTest.php
+++ b/lib/internal/Magento/Framework/Module/Test/Unit/ModuleList/LoaderTest.php
@@ -160,4 +160,55 @@ public function testLoadCircular()
]));
$this->loader->load();
}
+
+ /**
+ * @throws \Magento\Framework\Exception\LocalizedException
+ */
+ public function testLoadPrearranged(): void
+ {
+ $fixtures = [
+ 'Foo_Bar' => ['name' => 'Foo_Bar', 'sequence' => ['Magento_Store']],
+ 'Magento_Directory' => ['name' => 'Magento_Directory', 'sequence' => ['Magento_Store']],
+ 'Magento_Store' => ['name' => 'Magento_Store', 'sequence' => []],
+ 'Magento_Theme' => ['name' => 'Magento_Theme', 'sequence' => ['Magento_Store', 'Magento_Directory']],
+ 'Test_HelloWorld' => ['name' => 'Test_HelloWorld', 'sequence' => ['Magento_Theme']]
+ ];
+
+ $index = 0;
+ foreach ($fixtures as $name => $fixture) {
+ $this->converter->expects($this->at($index++))->method('convert')->willReturn([$name => $fixture]);
+ }
+
+ $this->registry->expects($this->once())
+ ->method('getPaths')
+ ->willReturn([
+ '/path/to/Foo_Bar',
+ '/path/to/Magento_Directory',
+ '/path/to/Magento_Store',
+ '/path/to/Magento_Theme',
+ '/path/to/Test_HelloWorld'
+ ]);
+
+ $this->driver->expects($this->exactly(5))
+ ->method('fileGetContents')
+ ->will($this->returnValueMap([
+ ['/path/to/Foo_Bar/etc/module.xml', null, null, self::$sampleXml],
+ ['/path/to/Magento_Directory/etc/module.xml', null, null, self::$sampleXml],
+ ['/path/to/Magento_Store/etc/module.xml', null, null, self::$sampleXml],
+ ['/path/to/Magento_Theme/etc/module.xml', null, null, self::$sampleXml],
+ ['/path/to/Test_HelloWorld/etc/module.xml', null, null, self::$sampleXml],
+ ]));
+
+ // Load the full module list information
+ $result = $this->loader->load();
+
+ $this->assertSame(
+ ['Magento_Store', 'Magento_Directory', 'Magento_Theme', 'Foo_Bar', 'Test_HelloWorld'],
+ array_keys($result)
+ );
+
+ foreach ($fixtures as $name => $fixture) {
+ $this->assertSame($fixture, $result[$name]);
+ }
+ }
}
From a51df0ab6ef6433f5cb25c30f3d753c2c40bd2a3 Mon Sep 17 00:00:00 2001
From: Kevin Kozan
Date: Wed, 6 Feb 2019 11:49:25 -0600
Subject: [PATCH 052/254] MC-4416: Convert CreateProductAttributeEntityTest to
MFTF
- Added 3 variations
- Added asserts to first variation
---
.../AdminProductAttributeActionGroup.xml | 41 +++-
.../Test/Mftf/Data/ProductAttributeData.xml | 19 ++
.../Test/Mftf/Page/AdminProductCreatePage.xml | 2 +
.../AdminCreateProductAttributeSection.xml | 6 +
.../AdminProductAddAttributeModalSection.xml | 19 ++
.../Section/AdminProductAttributesSection.xml | 17 ++
.../Section/AdminProductFormActionSection.xml | 1 +
.../Test/CreateProductAttributeEntityTest.xml | 209 +++++++++++++++++-
8 files changed, 311 insertions(+), 3 deletions(-)
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAddAttributeModalSection.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributesSection.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
index f998108c890d8..89321f8f6506a 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
@@ -47,6 +47,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -58,10 +72,35 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
index 4c106b6e69226..b31a3cc859221 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
@@ -120,4 +120,23 @@
defaultValue
No
+
+ date
+ No
+
+
+ date
+ No
+
+
+ select
+ Dropdown
+ No
+ opt1Admin
+ opt1Front
+ opt2Admin
+ opt2Front
+ opt3Admin
+ opt3Front
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml b/app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml
index b3ed3f478f810..e4c4ece5ac6cf 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml
@@ -15,8 +15,10 @@
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
index 72a0639403501..5f083171f97cb 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
@@ -23,6 +23,12 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAddAttributeModalSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAddAttributeModalSection.xml
new file mode 100644
index 0000000000000..7962e8117a8be
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAddAttributeModalSection.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributesSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributesSection.xml
new file mode 100644
index 0000000000000..46a516b538f09
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributesSection.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormActionSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormActionSection.xml
index aa752e0e2289c..1652546b0acb3 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormActionSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormActionSection.xml
@@ -10,6 +10,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
index 7449b6e473e2f..fd878e7f87fe4 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
@@ -34,11 +34,11 @@
-
+
-
+
@@ -49,5 +49,210 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From f77e404aabf6c7e5e20db61e50116f85c38bc12f Mon Sep 17 00:00:00 2001
From: Kevin Kozan
Date: Wed, 6 Feb 2019 13:39:32 -0600
Subject: [PATCH 053/254] MC-4416: Convert CreateProductAttributeEntityTest to
MFTF
- Added 2 variations
---
.../Test/Mftf/Data/ProductAttributeData.xml | 18 +++
.../Test/CreateProductAttributeEntityTest.xml | 151 ++++++++++++++++++
2 files changed, 169 insertions(+)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
index b31a3cc859221..82c96b8049c2e 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
@@ -139,4 +139,22 @@
opt3Admin
opt3Front
+
+ multiselect
+ Multiple Select
+ No
+ opt1Admin
+ opt1Front
+ opt2Admin
+ opt2Front
+ opt3Admin
+ opt3Front
+
+
+ select
+ Dropdown
+ No
+ opt1'Admin
+ opt1'Front
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
index fd878e7f87fe4..551d7af1d6a30 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
@@ -255,4 +255,155 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 83bdb2213c02f97d8c32f2a65a735272175ca34f Mon Sep 17 00:00:00 2001
From: Kavitha
Date: Wed, 6 Feb 2019 15:27:40 -0600
Subject: [PATCH 054/254] MC-4410: Convert
DeleteAssignedToTemplateProductAttributeTest to MFTF
---
.../Test/Mftf/Data/ProductAttributeData.xml | 21 +++++
.../AdminProductAttributeSetGridSection.xml | 1 +
.../Mftf/Section/AdminProductFormSection.xml | 1 +
...wnProductAttributeFromAttributeSetTest.xml | 72 +++++++++++++++
...ldProductAttributeFromAttributeSetTest.xml | 88 +++++++++++++++++++
5 files changed, 183 insertions(+)
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
index b367cdcab9d8b..89fb6bc033ee3 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
@@ -115,4 +115,25 @@
true
ProductAttributeFrontendLabel
+
+ attribute
+ text
+ global
+ false
+ false
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ ProductAttributeFrontendLabel
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetGridSection.xml
index b906e2fa9084b..aaf8906466d74 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetGridSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetGridSection.xml
@@ -14,5 +14,6 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
index e2ccbe165a0b2..0638d38a98296 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
@@ -57,6 +57,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml
new file mode 100644
index 0000000000000..3841c061c2629
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteDropdownProductAttributeFromAttributeSetTest.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml
new file mode 100644
index 0000000000000..c3cafb17c5eac
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminDeleteTextFieldProductAttributeFromAttributeSetTest.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From e95c678c4db2b29fad6bf7f319dcb1f16dd4c15f Mon Sep 17 00:00:00 2001
From: Patrick McLain
Date: Tue, 29 Jan 2019 14:03:10 -0500
Subject: [PATCH 055/254] Proposal For setPaymentMethodOnCart
Ref #293
---
app/code/Magento/BraintreeGraphQl/README.md | 4 +
.../Magento/BraintreeGraphQl/composer.json | 24 ++
.../BraintreeGraphQl/etc/graphql/di.xml | 27 ++
.../Magento/BraintreeGraphQl/etc/module.xml | 10 +
.../BraintreeGraphQl/etc/schema.graphqls | 18 +
.../Magento/BraintreeGraphQl/registration.php | 10 +
.../AdditionalDataBuilderInterface.php | 13 +
.../Payment/AdditionalDataBuilderPool.php | 32 ++
.../Payment/DefaultAdditionalDataBuilder.php | 43 +++
.../Model/Cart/Payment/MethodBuilder.php | 62 ++++
.../Cart/Payment/PaymentDataProvider.php | 35 ++
.../Model/Resolver/CartPaymentMethod.php | 58 +++
.../Model/Resolver/SetPaymentMethodOnCart.php | 102 ++++++
.../Magento/QuoteGraphQl/etc/schema.graphqls | 21 ++
composer.json | 1 +
composer.lock | 4 +-
.../Quote/SetPaymentMethodOnCartTest.php | 335 ++++++++++++++++++
17 files changed, 797 insertions(+), 2 deletions(-)
create mode 100644 app/code/Magento/BraintreeGraphQl/README.md
create mode 100644 app/code/Magento/BraintreeGraphQl/composer.json
create mode 100644 app/code/Magento/BraintreeGraphQl/etc/graphql/di.xml
create mode 100644 app/code/Magento/BraintreeGraphQl/etc/module.xml
create mode 100644 app/code/Magento/BraintreeGraphQl/etc/schema.graphqls
create mode 100644 app/code/Magento/BraintreeGraphQl/registration.php
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/Payment/AdditionalDataBuilderInterface.php
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/Payment/AdditionalDataBuilderPool.php
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/Payment/DefaultAdditionalDataBuilder.php
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/Payment/MethodBuilder.php
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/Payment/PaymentDataProvider.php
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Resolver/CartPaymentMethod.php
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Resolver/SetPaymentMethodOnCart.php
create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetPaymentMethodOnCartTest.php
diff --git a/app/code/Magento/BraintreeGraphQl/README.md b/app/code/Magento/BraintreeGraphQl/README.md
new file mode 100644
index 0000000000000..f6740e4d250e9
--- /dev/null
+++ b/app/code/Magento/BraintreeGraphQl/README.md
@@ -0,0 +1,4 @@
+# BraintreeGraphQl
+
+**BraintreeGraphQl** provides type and resolver for method additional
+information.
\ No newline at end of file
diff --git a/app/code/Magento/BraintreeGraphQl/composer.json b/app/code/Magento/BraintreeGraphQl/composer.json
new file mode 100644
index 0000000000000..a322db9d257dc
--- /dev/null
+++ b/app/code/Magento/BraintreeGraphQl/composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "magento/module-braintree-graph-ql",
+ "description": "N/A",
+ "type": "magento2-module",
+ "require": {
+ "php": "~7.1.3||~7.2.0",
+ "magento/framework": "*"
+ },
+ "suggest": {
+ "magento/module-graph-ql": "*"
+ },
+ "license": [
+ "OSL-3.0",
+ "AFL-3.0"
+ ],
+ "autoload": {
+ "files": [
+ "registration.php"
+ ],
+ "psr-4": {
+ "Magento\\BraintreeGraphQl\\": ""
+ }
+ }
+}
diff --git a/app/code/Magento/BraintreeGraphQl/etc/graphql/di.xml b/app/code/Magento/BraintreeGraphQl/etc/graphql/di.xml
new file mode 100644
index 0000000000000..3788a0c2f1325
--- /dev/null
+++ b/app/code/Magento/BraintreeGraphQl/etc/graphql/di.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+ - BraintreeAdditionalDataBuilder
+ - BraintreeVaultAdditionalDataBuilder
+
+
+
+
+
+ Magento\Braintree\Model\Ui\ConfigProvider::CODE
+
+
+
+
+ Magento\Braintree\Model\Ui\ConfigProvider::CC_VAULT_CODE
+
+
+
diff --git a/app/code/Magento/BraintreeGraphQl/etc/module.xml b/app/code/Magento/BraintreeGraphQl/etc/module.xml
new file mode 100644
index 0000000000000..2133e95a69104
--- /dev/null
+++ b/app/code/Magento/BraintreeGraphQl/etc/module.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/app/code/Magento/BraintreeGraphQl/etc/schema.graphqls b/app/code/Magento/BraintreeGraphQl/etc/schema.graphqls
new file mode 100644
index 0000000000000..83c98a68d85ee
--- /dev/null
+++ b/app/code/Magento/BraintreeGraphQl/etc/schema.graphqls
@@ -0,0 +1,18 @@
+# Copyright © Magento, Inc. All rights reserved.
+# See COPYING.txt for license details.
+
+input PaymentMethodInput {
+ braintree: BraintreeInput
+ braintree_vault: BraintreeVaultInput
+}
+
+input BraintreeInput {
+ payment_method_nonce: String!
+ is_active_payment_token_enabler: Boolean!
+}
+
+input BraintreeVaultInput {
+ payment_method_nonce: String!
+ public_hash: String!
+ is_active_payment_token_enabler: Boolean!
+}
diff --git a/app/code/Magento/BraintreeGraphQl/registration.php b/app/code/Magento/BraintreeGraphQl/registration.php
new file mode 100644
index 0000000000000..37f7ef30864cb
--- /dev/null
+++ b/app/code/Magento/BraintreeGraphQl/registration.php
@@ -0,0 +1,10 @@
+builders = $builders;
+ }
+
+ public function buildForMethod(string $methodCode, array $args): array
+ {
+ $additionalData = [];
+ if (isset($this->builders[$methodCode])) {
+ $additionalData = $this->builders[$methodCode]->build($args);
+ }
+
+ return $additionalData;
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/Payment/DefaultAdditionalDataBuilder.php b/app/code/Magento/QuoteGraphQl/Model/Cart/Payment/DefaultAdditionalDataBuilder.php
new file mode 100644
index 0000000000000..5a032ccc6386d
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/Payment/DefaultAdditionalDataBuilder.php
@@ -0,0 +1,43 @@
+arrayManager = $arrayManager;
+ $this->methodCode = $methodCode;
+ }
+
+ public function build(array $args): array
+ {
+ return $this->arrayManager->get($this->getAdditionalDataPath(), $args) ?? [];
+ }
+
+ private function getAdditionalDataPath(): string
+ {
+ return sprintf(static::INPUT_PATH_ADDITIONAL_DATA, $this->methodCode);
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/Payment/MethodBuilder.php b/app/code/Magento/QuoteGraphQl/Model/Cart/Payment/MethodBuilder.php
new file mode 100644
index 0000000000000..110e24d7d0fe5
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/Payment/MethodBuilder.php
@@ -0,0 +1,62 @@
+paymentFactory = $paymentFactory;
+ $this->additionalDataBuilderPool = $additionalDataBuilderPool;
+ $this->arrayManager = $arrayManager;
+ }
+
+ public function build(array $args): PaymentInterface
+ {
+ $method = (string) $this->arrayManager->get('input/payment_method/method', $args);
+
+ return $this->paymentFactory->create([
+ 'data' => [
+ PaymentInterface::KEY_METHOD => $method,
+ PaymentInterface::KEY_PO_NUMBER => $this->arrayManager->get('input/payment_method/po_number', $args),
+ PaymentInterface::KEY_ADDITIONAL_DATA => $this->additionalDataBuilderPool->buildForMethod(
+ $method,
+ $args
+ ),
+ ]
+ ]);
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/Payment/PaymentDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Cart/Payment/PaymentDataProvider.php
new file mode 100644
index 0000000000000..22adc69d1cc58
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/Payment/PaymentDataProvider.php
@@ -0,0 +1,35 @@
+getPayment();
+ if (!$payment) {
+ return [];
+ }
+
+ return [
+ 'method' => $payment->getMethod(),
+ 'po_number' => $payment->getPoNumber(),
+ ];
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartPaymentMethod.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartPaymentMethod.php
new file mode 100644
index 0000000000000..9e75256cd9b2b
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartPaymentMethod.php
@@ -0,0 +1,58 @@
+paymentDataProvider = $paymentDataProvider;
+ $this->getCartForUser = $getCartForUser;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
+ {
+ if (!isset($value['cart_id'])) {
+ throw new LocalizedException(__('"model" value should be specified'));
+ }
+
+ $maskedCartId = $value['cart_id'];
+ $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId());
+
+ return $this->paymentDataProvider->getCartPayment($cart);
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetPaymentMethodOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetPaymentMethodOnCart.php
new file mode 100644
index 0000000000000..5e48b3413f7ce
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetPaymentMethodOnCart.php
@@ -0,0 +1,102 @@
+maskedQuoteIdToQuoteId = $maskedQuoteIdToQuoteId;
+ $this->getCartForUser = $getCartForUser;
+ $this->arrayManager = $arrayManager;
+ $this->paymentMethodManagement = $paymentMethodManagement;
+ $this->methodBuilder = $methodBuilder;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
+ {
+ $paymentMethod = $this->arrayManager->get('input/payment_method', $args);
+ $maskedCartId = $this->arrayManager->get('input/cart_id', $args);
+
+ if (!$maskedCartId) {
+ throw new GraphQlInputException(__('Required parameter "cart_id" is missing'));
+ }
+ if (!$paymentMethod) {
+ throw new GraphQlInputException(__('Required parameter "payment_method" is missing'));
+ }
+
+ $maskedCartId = $args['input']['cart_id'];
+ $cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId());
+
+ try {
+ $this->paymentMethodManagement->set($cart->getId(), $this->methodBuilder->build($args));
+ } catch (LocalizedException $e) {
+ throw new GraphQlInputException(__($e->getMessage()));
+ }
+
+ return [
+ 'cart' => [
+ 'cart_id' => $maskedCartId,
+ ],
+ ];
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
index 4c1101a5f90a8..e1dd06f64cf88 100644
--- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
@@ -15,6 +15,17 @@ type Mutation {
setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput
setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingMethodsOnCart")
addSimpleProductsToCart(input: AddSimpleProductsToCartInput): AddSimpleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart")
+ setPaymentMethodOnCart(input: SetPaymentMethodOnCartInput): SetPaymentMethodOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetPaymentMethodOnCart")
+}
+
+input SetPaymentMethodOnCartInput {
+ cart_id: String!
+ payment_method: PaymentMethodInput!
+}
+
+input PaymentMethodInput {
+ method: String!
+ po_number: String
}
input SetShippingAddressesOnCartInput {
@@ -64,6 +75,10 @@ input ShippingMethodForAddressInput {
shipping_method_code: String!
}
+type SetPaymentMethodOnCartOutput {
+ cart: Cart!
+}
+
type SetBillingAddressOnCartOutput {
cart: Cart!
}
@@ -98,6 +113,7 @@ type Cart {
items: [CartItemInterface]
applied_coupon: AppliedCoupon
addresses: [CartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartAddresses")
+ payment_method: CartPaymentMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartPaymentMethod")
}
type CartAddress {
@@ -118,6 +134,11 @@ type CartAddress {
cart_items: [CartItemQuantity]
}
+type CartPaymentMethod {
+ method: String
+ po_number: String
+}
+
type CartItemQuantity {
cart_item_id: String!
quantity: Float!
diff --git a/composer.json b/composer.json
index 3222de2d1fe0f..69924d836b9e7 100644
--- a/composer.json
+++ b/composer.json
@@ -108,6 +108,7 @@
"magento/module-backend": "*",
"magento/module-backup": "*",
"magento/module-braintree": "*",
+ "magento/module-braintree-graph-ql": "*",
"magento/module-bundle": "*",
"magento/module-bundle-graph-ql": "*",
"magento/module-bundle-import-export": "*",
diff --git a/composer.lock b/composer.lock
index 697e7df3e19aa..172866d59f4ff 100644
--- a/composer.lock
+++ b/composer.lock
@@ -1,10 +1,10 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "content-hash": "3f58ddc5609e6a934ee3706006357646",
+ "content-hash": "bee21a1a1fa89a8a2dc5aedcd087d1e7",
"packages": [
{
"name": "braintree/braintree_php",
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetPaymentMethodOnCartTest.php
new file mode 100644
index 0000000000000..cd16123d428b0
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetPaymentMethodOnCartTest.php
@@ -0,0 +1,335 @@
+quoteResource = $objectManager->create(QuoteResource::class);
+ $this->quote = $objectManager->create(Quote::class);
+ $this->quoteIdToMaskedId = $objectManager->create(QuoteIdToMaskedQuoteIdInterface::class);
+ $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
+ $this->config = $objectManager->get(Config::class);
+ $this->cacheList = $objectManager->get(TypeListInterface::class);
+
+ foreach (static::OFFLINE_METHOD_CODES as $offlineMethodCode) {
+ $this->config->saveConfig(
+ 'payment/' . $offlineMethodCode . '/active',
+ '1',
+ ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
+ 0
+ );
+ }
+ $this->cacheList->cleanType('config');
+ }
+
+ /**
+ * @inheritdoc
+ */
+ protected function tearDown()
+ {
+ foreach (static::OFFLINE_METHOD_CODES as $offlineMethodCode) {
+ //Never no disable checkmo method
+ if ($offlineMethodCode === Checkmo::PAYMENT_METHOD_CHECKMO_CODE) {
+ continue;
+ }
+ $this->config->saveConfig(
+ 'payment/' . $offlineMethodCode . '/active',
+ '0',
+ ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
+ 0
+ );
+ }
+ $this->cacheList->cleanType('config');
+ }
+
+ /**
+ * @param string $methodCode
+ * @dataProvider dataProviderOfflinePaymentMethods
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
+ */
+ public function testSetPaymentMethodOnCart(string $methodCode)
+ {
+ /** @var \Magento\Config\Model\ResourceModel\Config $config */
+ $config = ObjectManager::getInstance()->get(\Magento\Config\Model\ResourceModel\Config::class);
+ $config->saveConfig(
+ 'payment/' . $methodCode . '/active',
+ 1,
+ ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
+ 0
+ );
+
+ $this->quoteResource->load(
+ $this->quote,
+ 'test_order_1',
+ 'reserved_order_id'
+ );
+ $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+
+ $query = $this->prepareMutationQuery(
+ $maskedQuoteId,
+ $methodCode
+ );
+
+ $response = $this->sendRequestWithToken($query);
+
+ $this->assertArrayHasKey('setPaymentMethodOnCart', $response);
+ $this->assertArrayHasKey('cart', $response['setPaymentMethodOnCart']);
+ $this->assertEquals($maskedQuoteId, $response['setPaymentMethodOnCart']['cart']['cart_id']);
+ $this->assertArrayHasKey('payment_method', $response['setPaymentMethodOnCart']['cart']);
+ $this->assertEquals($methodCode, $response['setPaymentMethodOnCart']['cart']['payment_method']['method']);
+ }
+
+ public function dataProviderOfflinePaymentMethods(): array
+ {
+ $methods = [];
+ foreach (static::OFFLINE_METHOD_CODES as $offlineMethodCode) {
+ //Purchase order requires additional input and is tested separately
+ if ($offlineMethodCode === Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE) {
+ continue;
+ }
+ $methods[] = [$offlineMethodCode];
+ }
+
+ return $methods;
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
+ */
+ public function testSetNonExistingPaymentMethod()
+ {
+ $paymentMethod = 'noway';
+ $this->quoteResource->load(
+ $this->quote,
+ 'test_order_1',
+ 'reserved_order_id'
+ );
+ $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+
+ $query = $this->prepareMutationQuery(
+ $maskedQuoteId,
+ $paymentMethod
+ );
+
+ $this->expectExceptionMessage('The requested Payment Method is not available.');
+ $this->sendRequestWithToken($query);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
+ */
+ public function testSetPaymentMethodByGuestToCustomerCart()
+ {
+ $paymentMethod = 'checkmo';
+ $this->quoteResource->load(
+ $this->quote,
+ 'test_order_1',
+ 'reserved_order_id'
+ );
+ $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+
+ $query = $this->prepareMutationQuery(
+ $maskedQuoteId,
+ $paymentMethod
+ );
+
+ $this->expectExceptionMessage(
+ "The current user cannot perform operations on cart \"$maskedQuoteId\""
+ );
+
+ $this->graphQlQuery($query);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
+ */
+ public function testSetPaymentMethodPurchaseOrderOnCart()
+ {
+ $methodCode = \Magento\OfflinePayments\Model\Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE;
+ $poNumber = 'GQL-19002';
+
+ /** @var \Magento\Config\Model\ResourceModel\Config $config */
+ $config = ObjectManager::getInstance()->get(\Magento\Config\Model\ResourceModel\Config::class);
+ $config->saveConfig(
+ 'payment/' . $methodCode . '/active',
+ 1,
+ ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
+ 0
+ );
+
+ $this->quoteResource->load(
+ $this->quote,
+ 'test_order_1',
+ 'reserved_order_id'
+ );
+ $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+
+ $query = <<sendRequestWithToken($query);
+
+ $this->assertArrayHasKey('setPaymentMethodOnCart', $response);
+ $this->assertArrayHasKey('cart', $response['setPaymentMethodOnCart']);
+ $this->assertEquals($maskedQuoteId, $response['setPaymentMethodOnCart']['cart']['cart_id']);
+ $this->assertArrayHasKey('payment_method', $response['setPaymentMethodOnCart']['cart']);
+ $this->assertEquals($methodCode, $response['setPaymentMethodOnCart']['cart']['payment_method']['method']);
+ $this->assertEquals($poNumber, $response['setPaymentMethodOnCart']['cart']['payment_method']['po_number']);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
+ */
+ public function testPurchaseOrderPaymentMethodFailingValidation()
+ {
+ $this->quoteResource->load(
+ $this->quote,
+ 'test_order_1',
+ 'reserved_order_id'
+ );
+ $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+
+ $query = $this->prepareMutationQuery(
+ $maskedQuoteId,
+ Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE
+ );
+
+ $this->expectExceptionMessage('Purchase order number is a required field.');
+ $this->sendRequestWithToken($query);
+ }
+
+ /**
+ * Generates query for setting the specified shipping method on cart
+ *
+ * @param string $maskedQuoteId
+ * @param string $methodCode
+ * @return string
+ */
+ private function prepareMutationQuery(
+ string $maskedQuoteId,
+ string $methodCode
+ ) : string {
+ return <<customerTokenService->createCustomerAccessToken('customer@example.com', 'password');
+ $headerMap = ['Authorization' => 'Bearer ' . $customerToken];
+
+ return $this->graphQlQuery($query, [], '', $headerMap);
+ }
+}
From 8ec9a3ab8bfe02aa7bb4da56249dfe493c7fb049 Mon Sep 17 00:00:00 2001
From: jaideepghosh
Date: Thu, 7 Feb 2019 19:44:41 +0530
Subject: [PATCH 056/254] Update static block in nginx.conf
Update the 'nginx.conf.sample' to allow the browsers for accessing the static contents even in multisite mode also.
---
nginx.conf.sample | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/nginx.conf.sample b/nginx.conf.sample
index 90604808f6ec0..eec85c74cec69 100644
--- a/nginx.conf.sample
+++ b/nginx.conf.sample
@@ -99,16 +99,16 @@ location /static/ {
# Remove signature of the static files that is used to overcome the browser cache
location ~ ^/static/version {
- rewrite ^/static/(version[^/]+/)?(.*)$ /static/$2 last;
+ rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
}
- location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$ {
+ location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
add_header Cache-Control "public";
add_header X-Frame-Options "SAMEORIGIN";
expires +1y;
if (!-f $request_filename) {
- rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
+ rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
}
}
location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
@@ -117,11 +117,11 @@ location /static/ {
expires off;
if (!-f $request_filename) {
- rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
+ rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
}
}
if (!-f $request_filename) {
- rewrite ^/static/?(.*)$ /static.php?resource=$1 last;
+ rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
}
add_header X-Frame-Options "SAMEORIGIN";
}
From e5603018be8113f3acd124b896da4666c538dcea Mon Sep 17 00:00:00 2001
From: jaideepghosh
Date: Thu, 7 Feb 2019 19:49:47 +0530
Subject: [PATCH 057/254] update nginx.conf.sample to serve json also.
---
nginx.conf.sample | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nginx.conf.sample b/nginx.conf.sample
index eec85c74cec69..ce3891627bc8c 100644
--- a/nginx.conf.sample
+++ b/nginx.conf.sample
@@ -102,7 +102,7 @@ location /static/ {
rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last;
}
- location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
+ location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|json)$ {
add_header Cache-Control "public";
add_header X-Frame-Options "SAMEORIGIN";
expires +1y;
From dac75945cc1969f4efdfb0a05e516cb5fa037b3c Mon Sep 17 00:00:00 2001
From: sathakur
Date: Thu, 7 Feb 2019 12:17:08 -0600
Subject: [PATCH 058/254] MC-4408: Convert UpdateSimpleProductEntityTest to
MFTF
---
.../Catalog/Test/Mftf/Data/ProductData.xml | 125 +++++++++++++-
.../Mftf/Data/SimpleProductOptionData.xml | 20 +++
.../Catalog/Test/Mftf/Data/TierPriceData.xml | 8 +-
...minProductFormAdvancedInventorySection.xml | 7 +-
.../Mftf/Section/AdminProductFormSection.xml | 3 +-
.../Section/StorefrontProductPageSection.xml | 3 +-
...rifyDataOverridingOnStoreViewLevelTest.xml | 86 ++++++++++
...rifyDataOverridingOnStoreViewLevelTest.xml | 84 ++++++++++
...dminUpdateSimpleProductTieredPriceTest.xml | 142 ++++++++++++++++
...RegularPriceInStockDisabledProductTest.xml | 93 +++++++++++
...WithRegularPriceInStockEnabledFlatTest.xml | 141 ++++++++++++++++
...PriceInStockNotVisibleIndividuallyTest.xml | 104 ++++++++++++
...arPriceInStockUnassignFromCategoryTest.xml | 68 ++++++++
...ceInStockVisibleInCatalogAndSearchTest.xml | 126 ++++++++++++++
...arPriceInStockVisibleInCatalogOnlyTest.xml | 126 ++++++++++++++
...larPriceInStockVisibleInSearchOnlyTest.xml | 126 ++++++++++++++
...gularPriceInStockWithCustomOptionsTest.xml | 156 ++++++++++++++++++
...eProductWithRegularPriceOutOfStockTest.xml | 124 ++++++++++++++
.../StorefrontQuickSearchResultsSection.xml | 2 +-
.../CreateCustomStoreViewActionGroup.xml | 17 ++
20 files changed, 1551 insertions(+), 10 deletions(-)
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Data/SimpleProductOptionData.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
index 47dff6cb17c85..6cc5117069062 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
@@ -696,4 +696,127 @@
virtual-product
virtual
-
+
+ test-simple-product
+ TestSimpleProduct
+ test_simple_product_sku
+ 325.02
+ 89
+ In Stock
+ IN STOCK
+ 89.0000
+ Search
+ simple
+ EavStock100
+
+
+ test-simple-product
+ TestSimpleProduct
+ test_simple_product_sku
+ 325.03
+ 25
+ Out of Stock
+ OUT OF STOCK
+ 125.0000
+ simple
+ EavStock100
+
+
+ test-simple-product
+ TestSimpleProduct
+ test_simple_product_sku
+ 245.00
+ 200
+ In Stock
+ IN STOCK
+ 120.0000
+ Catalog, Search
+ simple
+ EavStock100
+
+
+ test-simple-product
+ TestSimpleProduct
+ test_simple_product_sku
+ 325.01
+ 125
+ In Stock
+ IN STOCK
+ 25.0000
+ Catalog
+ simple
+ EavStock100
+
+
+ test-simple-product
+ TestSimpleProduct
+ test_simple_product_sku
+ 300.00
+ 34
+ In Stock
+ IN STOCK
+ 1
+ This item has weight
+ simple
+ EavStock100
+
+
+ test-simple-product
+ TestSimpleProduct
+ test_simple_product_sku
+ 1.99
+ Taxable Goods
+ 1000
+ 1
+ IN STOCK
+ 1
+ This item has weight
+ Catalog, Search
+ simple
+ EavStock100
+
+
+ test-simple-product
+ TestSimpleProduct
+ test_simple_product_sku
+ 245.00
+ 343.00
+ 200
+ In Stock
+ IN STOCK
+ 120.0000
+ simple
+ EavStock100
+
+
+ test-simple-product
+ TestSimpleProduct
+ test_simple_product_sku
+ 74.00
+ 87
+ In Stock
+ 333.0000
+ simple
+ EavStock100
+
+
+ test-simple-product
+ TestSimpleProduct
+ test_simple_product_sku
+ 325.00
+ 123
+ In Stock
+ 129.0000
+ Not Visible Individually
+ simple
+ EavStock100
+
+
+ test-simple-product
+ TestSimpleProduct
+ test_simple_product_sku
+ 9.99
+ simple
+ EavStock100
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/SimpleProductOptionData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/SimpleProductOptionData.xml
new file mode 100644
index 0000000000000..157a4d410263b
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/SimpleProductOptionData.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+ Test3 option
+ Drop-down
+ 1
+ 40 Percent
+ 40.00
+ Percent
+ sku_drop_down_row_1
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml
index 7fd0c65a2f753..c3207f540af5c 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml
@@ -42,4 +42,10 @@
24.00
15
-
+
+ All Websites [USD]
+ ALL GROUPS
+ 500,000.00
+ 1
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml
index a1bb27bb45a29..e027c54e5c17e 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedInventorySection.xml
@@ -19,9 +19,6 @@
+
-
-
-
-
-
+
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
index ad3e140c0818e..e06f953434b43 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
@@ -27,6 +27,7 @@
+
@@ -183,4 +184,4 @@
-
+
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductPageSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductPageSection.xml
index e9c8f53f97e5f..8055ecfe00cde 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductPageSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductPageSection.xml
@@ -22,5 +22,6 @@
+
-
+
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml
new file mode 100644
index 0000000000000..a5c2e1aa3a6de
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml
new file mode 100644
index 0000000000000..cd18110368919
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml
new file mode 100644
index 0000000000000..e63b1fdfe31bc
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{simpleProductTierPrice300InStock.storefrontStatus}}
+ productStockAvailableStatus
+
+
+
+ ${{simpleProductTierPrice300InStock.price}}
+ productPriceAmount
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml
new file mode 100644
index 0000000000000..7c2f8b4c458cc
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml
new file mode 100644
index 0000000000000..8f032b93c37b5
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml
@@ -0,0 +1,141 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{simpleProductEnabledFlat.storefrontStatus}}
+ productStockAvailableStatus
+
+
+
+ ${{simpleProductEnabledFlat.price}}
+ productPriceAmount
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml
new file mode 100644
index 0000000000000..c163e7bfa7ab9
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml
new file mode 100644
index 0000000000000..8476afe5263e6
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml
new file mode 100644
index 0000000000000..a7c7b66171983
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{simpleProductRegularPrice245InStock.storefrontStatus}}
+ productStockAvailableStatus
+
+
+
+ ${{simpleProductRegularPrice245InStock.price}}
+ productPriceAmount
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml
new file mode 100644
index 0000000000000..675206283a4ef
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{simpleProductRegularPrice32501InStock.storefrontStatus}}
+ productStockAvailableStatus
+
+
+
+ ${{simpleProductRegularPrice32501InStock.price}}
+ productPriceAmount
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml
new file mode 100644
index 0000000000000..4b54b0e7c6fcf
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{simpleProductRegularPrice325InStock.storefrontStatus}}
+ productStockAvailableStatus
+
+
+
+ ${{simpleProductRegularPrice325InStock.price}}
+ productPriceAmount
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml
new file mode 100644
index 0000000000000..2ee993d2af696
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{simpleProductRegularPriceCustomOptions.storefrontStatus}}
+ productStockAvailableStatus
+
+
+
+ ${{simpleProductRegularPriceCustomOptions.price}}
+ productPriceAmount
+
+
+
+
+
+
+
+
+ grabFourthOptions
+ ['-- Please Select --', {{simpleProductCustomizableOption.option_0_title}} +$98.00]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml
new file mode 100644
index 0000000000000..ea575bdb2771e
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{simpleProductRegularPrice32503OutOfStock.storefrontStatus}}
+ productStockAvailableStatus
+
+
+
+ ${{simpleProductRegularPrice32503OutOfStock.price}}
+ productPriceAmount
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchResultsSection.xml b/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchResultsSection.xml
index 9e04bbb12a796..9e5bde9a2be49 100644
--- a/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchResultsSection.xml
+++ b/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchResultsSection.xml
@@ -14,6 +14,6 @@
-
+
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml
index 31bbe7550e5a1..bef2ab27dafc0 100644
--- a/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/CreateCustomStoreViewActionGroup.xml
@@ -21,4 +21,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 0654c3226c1da6e67ceb830e333f1dd31aa9b8d1 Mon Sep 17 00:00:00 2001
From: Vitaliy Boyko
Date: Thu, 7 Feb 2019 23:40:33 +0200
Subject: [PATCH 059/254] graphQl-352: is email available
---
.../Customer/IsEmailAvailableDataProvider.php | 40 ++++++++++++++
.../Model/Resolver/IsEmailAvailable.php | 55 +++++++++++++++++++
.../CustomerGraphQl/etc/schema.graphqls | 7 +++
.../GraphQl/Customer/IsEmailAvailableTest.php | 50 +++++++++++++++++
4 files changed, 152 insertions(+)
create mode 100644 app/code/Magento/CustomerGraphQl/Model/Customer/IsEmailAvailableDataProvider.php
create mode 100644 app/code/Magento/CustomerGraphQl/Model/Resolver/IsEmailAvailable.php
create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/IsEmailAvailableTest.php
diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/IsEmailAvailableDataProvider.php b/app/code/Magento/CustomerGraphQl/Model/Customer/IsEmailAvailableDataProvider.php
new file mode 100644
index 0000000000000..9ec4ab9377ead
--- /dev/null
+++ b/app/code/Magento/CustomerGraphQl/Model/Customer/IsEmailAvailableDataProvider.php
@@ -0,0 +1,40 @@
+accountManagement = $accountManagement;
+ }
+
+ /**
+ * Check is Email available
+ *
+ * @param string $email
+ * @return bool
+ */
+ public function execute(string $email): bool
+ {
+ return $this->accountManagement->isEmailAvailable($email);
+ }
+}
diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/IsEmailAvailable.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/IsEmailAvailable.php
new file mode 100644
index 0000000000000..a5edb78e67bfd
--- /dev/null
+++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/IsEmailAvailable.php
@@ -0,0 +1,55 @@
+isEmailAvailableDataProvider = $isEmailAvailableDataProvider;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function resolve(
+ Field $field,
+ $context,
+ ResolveInfo $info,
+ array $value = null,
+ array $args = null
+ ) {
+ $email = $args['email'] ?? null;
+ if (!$email) {
+ throw new GraphQlInputException(__('"Email should be specified'));
+ }
+ $isEmailAvailable = $this->isEmailAvailableDataProvider->execute($email);
+
+ return [
+ 'is_email_available' => $isEmailAvailable
+ ];
+ }
+}
diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
index f4a417fe2f017..139ac80be8429 100644
--- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
@@ -3,6 +3,9 @@
type Query {
customer: Customer @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\Customer") @doc(description: "The customer query returns information about a customer account")
+ isEmailAvailable (
+ email: String! @doc(description: "The new customer email")
+ ): IsEmailAvailableOutput @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\IsEmailAvailable")
}
type Mutation {
@@ -126,6 +129,10 @@ type CustomerAddressAttribute {
value: String @doc(description: "Attribute value")
}
+type IsEmailAvailableOutput {
+ is_email_available: Boolean @doc(description: "Is email availabel value")
+}
+
enum CountryCodeEnum @doc(description: "The list of countries codes") {
AF @doc(description: "Afghanistan")
AX @doc(description: "Åland Islands")
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/IsEmailAvailableTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/IsEmailAvailableTest.php
new file mode 100644
index 0000000000000..37693fbba7fef
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/IsEmailAvailableTest.php
@@ -0,0 +1,50 @@
+graphQlQuery($query);
+
+ self::assertArrayHasKey('isEmailAvailable', $response);
+ self::assertArrayHasKey('is_email_available', $response['isEmailAvailable']);
+ self::assertFalse($response['isEmailAvailable']['is_email_available']);
+ }
+
+ public function testEmailAvailable()
+ {
+ $query =
+ <<graphQlQuery($query);
+
+ self::assertArrayHasKey('isEmailAvailable', $response);
+ self::assertArrayHasKey('is_email_available', $response['isEmailAvailable']);
+ self::assertTrue($response['isEmailAvailable']['is_email_available']);
+ }
+}
From 29c858f7f12577287523a81d2b890caa6a69a427 Mon Sep 17 00:00:00 2001
From: Maria Kovdrysh
Date: Fri, 8 Feb 2019 13:26:31 -0600
Subject: [PATCH 060/254] MC-4409: Convert UpdateProductAttributeEntityTest to
MFTF
---
.../AdminProductAttributeSetActionGroup.xml | 9 +++
.../Test/Mftf/Data/ProductAttributeData.xml | 42 +++++++++++
.../AdminCreateProductAttributeSection.xml | 2 +
.../AdminProductAttributeSetGridSection.xml | 1 +
...ibleInStorefrontAdvancedSearchFormTest.xml | 71 +++++++++++++++++++
...ibleInStorefrontAdvancedSearchFormTest.xml | 71 +++++++++++++++++++
6 files changed, 196 insertions(+)
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
index a3b4203b7a69e..458fb9a509559 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
@@ -54,4 +54,13 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
index 3d21d1c9efc92..866cff65d8bc5 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
@@ -73,6 +73,27 @@
true
ProductAttributeFrontendLabel
+
+ attribute
+ select
+ global
+ false
+ false
+ false
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ ProductAttributeFrontendLabel
+
testattribute
select
@@ -115,6 +136,27 @@
true
ProductAttributeFrontendLabel
+
+ attribute
+ multiselect
+ global
+ false
+ false
+ false
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ true
+ ProductAttributeFrontendLabel
+
news_from_date
Set Product as New from Date
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
index 05be20b14acc0..09ccbc9929a2e 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
@@ -81,5 +81,7 @@
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetGridSection.xml
index b906e2fa9084b..3fad50adb771a 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetGridSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeSetGridSection.xml
@@ -14,5 +14,6 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
new file mode 100644
index 0000000000000..c0d334861642d
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
new file mode 100644
index 0000000000000..b7fdb7bd67941
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 5a1ccb84be4afb5cc2a7a09e23b6d7c3cdf61e79 Mon Sep 17 00:00:00 2001
From: Kavitha
Date: Fri, 8 Feb 2019 14:00:55 -0600
Subject: [PATCH 061/254] MC-4527: Convert
VerifyConfigurableProductEntityPriceTest to MFTF
---
...oductPriceWithDisabledChildProductTest.xml | 156 +++++++++++++++++
...uctPriceWithOutOfStockChildProductTest.xml | 157 ++++++++++++++++++
2 files changed, 313 insertions(+)
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml
create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml
new file mode 100644
index 0000000000000..0d83d59b4ce32
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml
@@ -0,0 +1,156 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 10.00
+
+
+
+
+
+ 20.00
+
+
+
+
+
+ 30.00
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml
new file mode 100644
index 0000000000000..f5650feeff71b
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 10.00
+
+
+
+
+
+ 20.00
+
+
+
+
+
+ 30.00
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 753c83187dd71bed499dfeaae327b1a919a798f0 Mon Sep 17 00:00:00 2001
From: Ji Lu
Date: Fri, 8 Feb 2019 14:59:37 -0600
Subject: [PATCH 062/254] MC-10913: Customer Login on Storefront with Incorrect
Credentials
---
.../Page/StorefrontCustomerSignInPage.xml | 1 +
...StorefrontCustomerLoginMessagesSection.xml | 14 ++++++++
...frontLoginWithIncorrectCredentialsTest.xml | 35 +++++++++++++++++++
3 files changed, 50 insertions(+)
create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerLoginMessagesSection.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/StorefrontLoginWithIncorrectCredentialsTest.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerSignInPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerSignInPage.xml
index 0d4fef8f6e967..b4814a3e4bedd 100644
--- a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerSignInPage.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerSignInPage.xml
@@ -10,5 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerLoginMessagesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerLoginMessagesSection.xml
new file mode 100644
index 0000000000000..554b27d93afb6
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerLoginMessagesSection.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontLoginWithIncorrectCredentialsTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontLoginWithIncorrectCredentialsTest.xml
new file mode 100644
index 0000000000000..9a6c1c5ec8988
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontLoginWithIncorrectCredentialsTest.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From ddde7f678a59c1a0cc9779f290d9195861108cb7 Mon Sep 17 00:00:00 2001
From: Dominic
Date: Sun, 10 Feb 2019 11:12:20 +0530
Subject: [PATCH 063/254] fixed-pagination-issue-admin-review-grid
---
lib/web/mage/adminhtml/grid.js | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/lib/web/mage/adminhtml/grid.js b/lib/web/mage/adminhtml/grid.js
index c9af869d79161..b16b2c9defce0 100644
--- a/lib/web/mage/adminhtml/grid.js
+++ b/lib/web/mage/adminhtml/grid.js
@@ -531,12 +531,19 @@ define([
/**
* @param {Object} event
*/
- inputPage: function (event) {
+ inputPage: function (event, lastId) {
var element = Event.element(event),
- keyCode = event.keyCode || event.which;
+ keyCode = event.keyCode || event.which,
+ enteredValue = parseInt(element.value),
+ lastId = parseInt(lastId);
+
if (keyCode == Event.KEY_RETURN) { //eslint-disable-line eqeqeq
- this.setPage(element.value);
+ if (enteredValue > lastId) {
+ this.setPage(lastId);
+ } else {
+ this.setPage(element.value);
+ }
}
/*if(keyCode>47 && keyCode<58){
From c0a98a087b3df9a0023e9a65ca8e710b4494bdf3 Mon Sep 17 00:00:00 2001
From: Dominic
Date: Sun, 10 Feb 2019 11:27:50 +0530
Subject: [PATCH 064/254] fixed-pagination-issue-admin-review-grid
---
lib/web/mage/adminhtml/grid.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/web/mage/adminhtml/grid.js b/lib/web/mage/adminhtml/grid.js
index b16b2c9defce0..b7e696ae8f4bd 100644
--- a/lib/web/mage/adminhtml/grid.js
+++ b/lib/web/mage/adminhtml/grid.js
@@ -530,6 +530,7 @@ define([
/**
* @param {Object} event
+ * @param int lastId
*/
inputPage: function (event, lastId) {
var element = Event.element(event),
From b6baf8fbe273d5a28e622ca62ab7aefd42a3069e Mon Sep 17 00:00:00 2001
From: Dominic
Date: Sun, 10 Feb 2019 11:31:49 +0530
Subject: [PATCH 065/254] fixed-pagination-issue-admin-review-grid-clean-code
---
lib/web/mage/adminhtml/grid.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/web/mage/adminhtml/grid.js b/lib/web/mage/adminhtml/grid.js
index b7e696ae8f4bd..e27dd9c2a0d26 100644
--- a/lib/web/mage/adminhtml/grid.js
+++ b/lib/web/mage/adminhtml/grid.js
@@ -538,12 +538,11 @@ define([
enteredValue = parseInt(element.value),
lastId = parseInt(lastId);
-
if (keyCode == Event.KEY_RETURN) { //eslint-disable-line eqeqeq
if (enteredValue > lastId) {
this.setPage(lastId);
} else {
- this.setPage(element.value);
+ this.setPage(enteredValue);
}
}
From cab38a21087525b72add16910b6eccf7eb7e1b63 Mon Sep 17 00:00:00 2001
From: Vinai Kopp
Date: Sun, 3 Feb 2019 17:46:26 +0530
Subject: [PATCH 066/254] magento/magento2#20773: Make autoloader PSR-4
compliant
---
.../Code/Generator/AutoloaderTest.php | 85 +++++++++++++++++++
.../Framework/Code/Generator/Autoloader.php | 70 +++++++++++++--
2 files changed, 146 insertions(+), 9 deletions(-)
create mode 100644 dev/tests/integration/testsuite/Magento/Framework/Code/Generator/AutoloaderTest.php
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Code/Generator/AutoloaderTest.php b/dev/tests/integration/testsuite/Magento/Framework/Code/Generator/AutoloaderTest.php
new file mode 100644
index 0000000000000..0e1b51b3ae273
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Framework/Code/Generator/AutoloaderTest.php
@@ -0,0 +1,85 @@
+createMock(LoggerInterface::class);
+ $this->getTestFrameworkObjectManager()->addSharedInstance($loggerTestDouble, MagentoMonologLogger::class);
+ }
+
+ /**
+ * @after
+ */
+ public function removeLoggerTestDouble(): void
+ {
+ $this->getTestFrameworkObjectManager()->removeSharedInstance(MagentoMonologLogger::class);
+ }
+
+ /**
+ * @param \RuntimeException $testException
+ * @return Generator|MockObject
+ */
+ private function createExceptionThrowingGeneratorTestDouble(\RuntimeException $testException)
+ {
+ /** @var Generator|MockObject $generatorStub */
+ $generatorStub = $this->createMock(Generator::class);
+ $generatorStub->method('generateClass')->willThrowException($testException);
+
+ return $generatorStub;
+ }
+
+ public function testLogsExceptionDuringGeneration(): void
+ {
+ $exceptionMessage = 'Test exception thrown during generation';
+ $testException = new \RuntimeException($exceptionMessage);
+
+ $loggerMock = ObjectManager::getInstance()->get(LoggerInterface::class);
+ $loggerMock->expects($this->once())->method('debug')->with($exceptionMessage, ['exception' => $testException]);
+
+ $autoloader = new Autoloader($this->createExceptionThrowingGeneratorTestDouble($testException));
+ $this->assertNull($autoloader->load(NonExistingClassName::class));
+ }
+
+ public function testFiltersDuplicateExceptionMessages(): void
+ {
+ $exceptionMessage = 'Test exception thrown during generation';
+ $testException = new \RuntimeException($exceptionMessage);
+
+ $loggerMock = ObjectManager::getInstance()->get(LoggerInterface::class);
+ $loggerMock->expects($this->once())->method('debug')->with($exceptionMessage, ['exception' => $testException]);
+
+ $autoloader = new Autoloader($this->createExceptionThrowingGeneratorTestDouble($testException));
+ $autoloader->load(OneNonExistingClassName::class);
+ $autoloader->load(AnotherNonExistingClassName::class);
+ }
+}
diff --git a/lib/internal/Magento/Framework/Code/Generator/Autoloader.php b/lib/internal/Magento/Framework/Code/Generator/Autoloader.php
index c214008393609..1afa97729b158 100644
--- a/lib/internal/Magento/Framework/Code/Generator/Autoloader.php
+++ b/lib/internal/Magento/Framework/Code/Generator/Autoloader.php
@@ -3,37 +3,89 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+
namespace Magento\Framework\Code\Generator;
+use Magento\Framework\App\ObjectManager;
use Magento\Framework\Code\Generator;
+use Psr\Log\LoggerInterface;
class Autoloader
{
/**
- * @var \Magento\Framework\Code\Generator
+ * @var Generator
*/
protected $_generator;
/**
- * @param \Magento\Framework\Code\Generator $generator
+ * Enables guarding against spamming the debug log with duplicate messages, as
+ * the generation exception will be thrown multiple times within a single request.
+ *
+ * @var string
+ */
+ private $lastGenerationErrorMessage;
+
+ /**
+ * @param Generator $generator
*/
- public function __construct(
- \Magento\Framework\Code\Generator $generator
- ) {
+ public function __construct(Generator $generator)
+ {
$this->_generator = $generator;
}
/**
* Load specified class name and generate it if necessary
*
+ * According to PSR-4 section 2.4 an autoloader MUST NOT throw an exception and SHOULD NOT return a value.
+ *
+ * @see https://www.php-fig.org/psr/psr-4/
+ *
* @param string $className
- * @return bool True if class was loaded
+ * @return void
*/
public function load($className)
{
- if (!class_exists($className)) {
- return Generator::GENERATION_ERROR != $this->_generator->generateClass($className);
+ if (! class_exists($className)) {
+ try {
+ $this->_generator->generateClass($className);
+ } catch (\Exception $exception) {
+ $this->tryToLogExceptionMessageIfNotDuplicate($exception);
+ }
+ }
+ }
+
+ /**
+ * @param \Exception $exception
+ */
+ private function tryToLogExceptionMessageIfNotDuplicate(\Exception $exception): void
+ {
+ if ($this->lastGenerationErrorMessage !== $exception->getMessage()) {
+ $this->lastGenerationErrorMessage = $exception->getMessage();
+ $this->tryToLogException($exception);
+ }
+ }
+
+ /**
+ * Try to capture the exception message.
+ *
+ * The Autoloader is instantiated before the ObjectManager, so the LoggerInterface can not be injected.
+ * The Logger is instantiated in the try/catch block because ObjectManager might still not be initialized.
+ * In that case the exception message can not be captured.
+ *
+ * The debug level is used for logging in case class generation fails for a common class, but a custom
+ * autoloader is used later in the stack. A more severe log level would fill the logs with messages on production.
+ * The exception message now can be accessed in developer mode if debug logging is enabled.
+ *
+ * @param \Exception $exception
+ * @return void
+ */
+ private function tryToLogException(\Exception $exception): void
+ {
+ try {
+ $logger = ObjectManager::getInstance()->get(LoggerInterface::class);
+ $logger->debug($exception->getMessage(), ['exception' => $exception]);
+ } catch (\Exception $ignoreThisException) {
+ // Do not take an action here, since the original exception might have been caused by logger
}
- return true;
}
}
From 9a6b215c7f282423d27a5d1c87eb61ef0d32147f Mon Sep 17 00:00:00 2001
From: Ji Lu
Date: Mon, 11 Feb 2019 09:58:25 -0600
Subject: [PATCH 067/254] MC-10913: Customer Login on Storefront with Incorrect
Credentials
---
.../Magento/Customer/Test/TestCase/LoginOnFrontendFailTest.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/LoginOnFrontendFailTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/LoginOnFrontendFailTest.xml
index 2dea52c1b7fcc..bf84d2be43a11 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/LoginOnFrontendFailTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/LoginOnFrontendFailTest.xml
@@ -9,6 +9,7 @@
default
+ mftf_migrated:yes
From 6cd6dc32c474c496c72533df09db8af7d6848923 Mon Sep 17 00:00:00 2001
From: Ji Lu
Date: Mon, 11 Feb 2019 10:08:26 -0600
Subject: [PATCH 068/254] MC-13679: Forgot Password on Storefront validates
customer email input
---
.../Page/StorefrontCustomerSignInPage.xml | 1 +
.../Page/StorefrontForgotPasswordPage.xml | 14 +++++++
...StorefrontCustomerLoginMessagesSection.xml | 15 +++++++
.../StorefrontCustomerSignInFormSection.xml | 1 +
.../StorefrontForgotPasswordSection.xml | 16 ++++++++
.../Test/StorefrontForgotPasswordTest.xml | 40 +++++++++++++++++++
.../TestCase/ForgotPasswordOnFrontendTest.xml | 1 +
7 files changed, 88 insertions(+)
create mode 100644 app/code/Magento/Customer/Test/Mftf/Page/StorefrontForgotPasswordPage.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerLoginMessagesSection.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/StorefrontForgotPasswordSection.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/StorefrontForgotPasswordTest.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerSignInPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerSignInPage.xml
index 0d4fef8f6e967..b4814a3e4bedd 100644
--- a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerSignInPage.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerSignInPage.xml
@@ -10,5 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontForgotPasswordPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontForgotPasswordPage.xml
new file mode 100644
index 0000000000000..2633a0c760cec
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontForgotPasswordPage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerLoginMessagesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerLoginMessagesSection.xml
new file mode 100644
index 0000000000000..078021db062cc
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerLoginMessagesSection.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml
index 25c07ca9cb3c9..f52b379379ad1 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSignInFormSection.xml
@@ -12,6 +12,7 @@
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontForgotPasswordSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontForgotPasswordSection.xml
new file mode 100644
index 0000000000000..bdae69c425db1
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontForgotPasswordSection.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontForgotPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontForgotPasswordTest.xml
new file mode 100644
index 0000000000000..acacc2c063f7c
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontForgotPasswordTest.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml
index 0d168451c6d32..7bf916157c5dc 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ForgotPasswordOnFrontendTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
customer_US
captcha_storefront_disable
From fe8cc058dbc617ab9c5b3e181a599d923e0f7e06 Mon Sep 17 00:00:00 2001
From: Vitaliy Boyko
Date: Mon, 11 Feb 2019 21:05:32 +0200
Subject: [PATCH 069/254] graphQl-292: payment method list
---
.../AvailablePaymentMethodsDataProvider.php | 53 +++++++++++++++++++
.../AvailablePaymentMethodsResolver.php | 48 +++++++++++++++++
.../Magento/QuoteGraphQl/etc/schema.graphqls | 6 +++
3 files changed, 107 insertions(+)
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/PaymentMethod/AvailablePaymentMethodsDataProvider.php
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethodsResolver.php
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/PaymentMethod/AvailablePaymentMethodsDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Cart/PaymentMethod/AvailablePaymentMethodsDataProvider.php
new file mode 100644
index 0000000000000..daa51d8729995
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/PaymentMethod/AvailablePaymentMethodsDataProvider.php
@@ -0,0 +1,53 @@
+informationManagement = $informationManagement;
+ }
+
+ /**
+ * Collect and return information about available payment methods
+ *
+ * @param CartInterface $cart
+ * @return array
+ */
+ public function getPaymentMethods(CartInterface $cart): array
+ {
+ $paymentInformation = $this->informationManagement->getPaymentInformation($cart->getId());
+ $paymentMethods = $paymentInformation->getPaymentMethods();
+
+ $paymentMethodsNested = [];
+ foreach ($paymentMethods as $paymentMethod) {
+ $paymentMethodsNested[] = [
+ 'title' => $paymentMethod->getTitle(),
+ 'code' => $paymentMethod->getCode()
+ ];
+ }
+
+ return $paymentMethodsNested;
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethodsResolver.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethodsResolver.php
new file mode 100644
index 0000000000000..17747ec11b25a
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethodsResolver.php
@@ -0,0 +1,48 @@
+addressDataProvider = $addressDataProvider;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
+ {
+ if (!isset($value['model'])) {
+ throw new LocalizedException(__('"model" value should be specified'));
+ }
+
+ $cart = $value['model'];
+
+ return $this->addressDataProvider->getPaymentMethods($cart);
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
index 4c1101a5f90a8..072810de0bb47 100644
--- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
@@ -98,6 +98,7 @@ type Cart {
items: [CartItemInterface]
applied_coupon: AppliedCoupon
addresses: [CartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartAddresses")
+ available_payment_methods : [CheckoutPaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethodsResolver") @doc(description: "Available payment methods")
}
type CartAddress {
@@ -141,6 +142,11 @@ type CheckoutShippingMethod {
# TODO: Add more complex structure for shipping rates
}
+type CheckoutPaymentMethod @doc(description: "The type contains list of active payment methods") {
+ code : String @doc(description: "The payment method code")
+ title : String @doc(description: "The payment method title.")
+}
+
enum AdressTypeEnum {
SHIPPING
BILLING
From edc8f53815248c1cb23324ee7c85ebb0d2d197eb Mon Sep 17 00:00:00 2001
From: Ji Lu
Date: Mon, 11 Feb 2019 14:19:06 -0600
Subject: [PATCH 070/254] MC-10916: Update Customer Password on Storefront,
Valid Current Password MC-10917: Update Customer Password on Storefront,
Invalid Current Password MC-10918: Update Customer Password on Storefront,
Invalid Confirmation Password
---
.../LoginToStorefrontActionGroup.xml | 10 +++
...frontCustomerAccountChangePasswordPage.xml | 14 ++++
...frontCustomerAccountInformationSection.xml | 6 +-
...omerDashboardAccountInformationSection.xml | 2 +
.../StorefrontCustomerMessagesSection.xml | 15 ++++
.../StorefrontUpdateCustomerPasswordTest.xml | 81 +++++++++++++++++++
.../TestCase/ChangeCustomerPasswordTest.xml | 3 +
7 files changed, 130 insertions(+), 1 deletion(-)
create mode 100644 app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerAccountChangePasswordPage.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerMessagesSection.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
index 7be36ffbd9bc4..79961b2bfc297 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
@@ -16,4 +16,14 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerAccountChangePasswordPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerAccountChangePasswordPage.xml
new file mode 100644
index 0000000000000..43198297b1731
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerAccountChangePasswordPage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml
index 59da4e9279a03..b819a78002c62 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerAccountInformationSection.xml
@@ -14,6 +14,10 @@
-
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection.xml
index 70d1bb6675db5..e888343a5be2a 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerDashboardAccountInformationSection.xml
@@ -10,6 +10,8 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerMessagesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerMessagesSection.xml
new file mode 100644
index 0000000000000..07d044921c8e5
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerMessagesSection.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml
new file mode 100644
index 0000000000000..a168a5f380538
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml
index 9765b9d9340a7..f94d99b07ec6e 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml
@@ -9,6 +9,7 @@
default
+ mftf_migrated:yes
123123^q
123123^a
123123^a
@@ -17,6 +18,7 @@
default
+ mftf_migrated:yes
123123
123123^a
123123^a
@@ -24,6 +26,7 @@
default
+ mftf_migrated:yes
123123^q
123123^a
123123^d
From b7fe54689d2e1486a9efec9cf1455d3c226fbfa2 Mon Sep 17 00:00:00 2001
From: sathakur
Date: Tue, 12 Feb 2019 11:43:39 -0600
Subject: [PATCH 071/254] MC-4538: Convert RegisterCustomerFrontendEntityTest
to MFTF
---
.../ActionGroup/DeleteCustomerActionGroup.xml | 17 ++++++
...SignUpNewUserFromStorefrontActionGroup.xml | 28 ++++++++--
.../AdminEditCustomerInformationSection.xml | 1 +
.../AdminEditCustomerNewsletterSection.xml | 14 +++++
.../StorefrontCustomerCreateFormSection.xml | 1 +
...stomerOnStorefrontSignupNewsletterTest.xml | 54 +++++++++++++++++++
...AdminCreateNewCustomerOnStorefrontTest.xml | 38 +++++++++++++
7 files changed, 150 insertions(+), 3 deletions(-)
create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontTest.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml
index 4d531214db150..7fb9f906474f7 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml
@@ -24,4 +24,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml
index 76acf6e865963..323dbc2bd5b5f 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml
@@ -24,7 +24,29 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -48,6 +70,6 @@
-
+
-
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml
index f5bbb84eaa593..0c3d89f5782d8 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml
@@ -11,5 +11,6 @@
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml
new file mode 100644
index 0000000000000..51b4b54c5c8b6
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerNewsletterSection.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml
index ee14ee5c165c5..8881a2a012ce8 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml
@@ -12,6 +12,7 @@
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml
new file mode 100644
index 0000000000000..081cd684cf2f0
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontSignupNewsletterTest.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontTest.xml
new file mode 100644
index 0000000000000..11f2e83f43be9
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCreateNewCustomerOnStorefrontTest.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From e4b46e7a032380249747722ba4756fc38ccb34dc Mon Sep 17 00:00:00 2001
From: Dominic
Date: Tue, 12 Feb 2019 23:32:12 +0530
Subject: [PATCH 072/254] return-cart-id-null
---
.../QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php
index f4335b262c854..ff0298416cdf8 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php
@@ -81,6 +81,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
$this->addProductsToCart->execute($cart, $cartItems);
$cartData = $this->extractDataFromCart->execute($cart);
+ $cartData["cart_id"] = $cartHash;
return [
'cart' => $cartData,
From 9e0fb4b008e78caa4fc049166067dedfc1a13742 Mon Sep 17 00:00:00 2001
From: Vitaliy Boyko
Date: Tue, 12 Feb 2019 22:06:36 +0200
Subject: [PATCH 073/254] graphQl-239: refactoring, adjusting tests
---
.../Resolver/Product/ProductImage/Url.php | 8 +-
.../DataProvider/Image/Placeholder.php | 74 +++++--------------
.../DataProvider/Image/Placeholder/Theme.php | 71 ++++++++++++++++++
.../GraphQl/Catalog/ProductImageTest.php | 13 ++++
4 files changed, 105 insertions(+), 61 deletions(-)
create mode 100644 app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder/Theme.php
diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php
index 8b6275f2f3e0e..23a8c2d15c09e 100644
--- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php
+++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Product/ProductImage/Url.php
@@ -27,20 +27,18 @@ class Url implements ResolverInterface
/**
* @var PlaceholderProvider
*/
- private $_placeholderProvider;
+ private $placeholderProvider;
/**
- * Url constructor.
* @param ImageFactory $productImageFactory
* @param PlaceholderProvider $placeholderProvider
*/
public function __construct(
ImageFactory $productImageFactory,
PlaceholderProvider $placeholderProvider
-
) {
$this->productImageFactory = $productImageFactory;
- $this->_placeholderProvider = $placeholderProvider;
+ $this->placeholderProvider = $placeholderProvider;
}
/**
@@ -83,7 +81,7 @@ private function getImageUrl(string $imageType, ?string $imagePath): string
->setBaseFile($imagePath);
if ($image->isBaseFilePlaceholder()) {
- return $this->_placeholderProvider->getPlaceholder($imageType);
+ return $this->placeholderProvider->getPlaceholder($imageType);
}
return $image->getUrl();
diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
index d9691a079a328..a558ec2bfa253 100644
--- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
+++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
@@ -8,102 +8,64 @@
namespace Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Image;
use Magento\Catalog\Model\View\Asset\PlaceholderFactory;
-use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\View\Asset\Repository as AssetRepository;
-use Magento\Framework\View\Design\Theme\ThemeProviderInterface;
-use Magento\Store\Model\StoreManagerInterface;
/**
- * Class Placeholder
- * @package Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Image
+ * Image Placeholder provider
*/
class Placeholder
{
/**
* @var PlaceholderFactory
*/
- private $_placeholderFactory;
+ private $placeholderFactory;
+
/**
* @var AssetRepository
*/
- private $_assetRepository;
- /**
- * @var ScopeConfigInterface
- */
- private $_scopeConfig;
- /**
- * @var StoreManagerInterface
- */
- private $_storeManager;
+ private $assetRepository;
+
/**
- * @var ThemeProviderInterface
+ * @var Theme
*/
- private $_themeProvider;
+ private $theme;
/**
* Placeholder constructor.
* @param PlaceholderFactory $placeholderFactory
* @param AssetRepository $assetRepository
- * @param ScopeConfigInterface $scopeConfig
- * @param StoreManagerInterface $storeManager
- * @param ThemeProviderInterface $themeProvider
+ * @param Theme $theme
*/
public function __construct(
PlaceholderFactory $placeholderFactory,
AssetRepository $assetRepository,
- ScopeConfigInterface $scopeConfig,
- StoreManagerInterface $storeManager,
- ThemeProviderInterface $themeProvider
+ Theme $theme
) {
- $this->_placeholderFactory = $placeholderFactory;
- $this->_assetRepository = $assetRepository;
- $this->_scopeConfig = $scopeConfig;
- $this->_storeManager = $storeManager;
- $this->_themeProvider = $themeProvider;
+ $this->placeholderFactory = $placeholderFactory;
+ $this->assetRepository = $assetRepository;
+ $this->theme = $theme;
}
/**
* Get placeholder
*
- * @param $imageType
+ * @param string $imageType
* @return string
* @throws \Magento\Framework\Exception\NoSuchEntityException
*/
- public function getPlaceholder($imageType): string
+ public function getPlaceholder(string $imageType): string
{
- $imageAsset = $this->_placeholderFactory->create(['type' => $imageType]);
+ $imageAsset = $this->placeholderFactory->create(['type' => $imageType]);
// check if placeholder defined in config
if ($imageAsset->getFilePath()) {
return $imageAsset->getUrl();
}
- return $this->_assetRepository->createAsset(
+ $themeData = $this->theme->getThemeData();
+ return $this->assetRepository->createAsset(
"Magento_Catalog::images/product/placeholder/{$imageType}.jpg",
- $this->getThemeData()
+ $themeData
)->getUrl();
}
-
- /**
- * Get theme model
- *
- * @return mixed
- * @throws \Magento\Framework\Exception\NoSuchEntityException
- */
- public function getThemeData()
- {
- $themeId = $this->_scopeConfig->getValue(
- \Magento\Framework\View\DesignInterface::XML_PATH_THEME_ID,
- \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
- $this->_storeManager->getStore()->getId()
- );
-
- /** @var $theme \Magento\Framework\View\Design\ThemeInterface */
- $theme = $this->_themeProvider->getThemeById($themeId);
-
- $data = $theme->getData();
- $data['themeModel'] = $theme;
-
- return $data;
- }
}
diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder/Theme.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder/Theme.php
new file mode 100644
index 0000000000000..3988dbbc25b33
--- /dev/null
+++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder/Theme.php
@@ -0,0 +1,71 @@
+scopeConfig = $scopeConfig;
+ $this->storeManager = $storeManager;
+ $this->themeProvider = $themeProvider;
+ }
+
+ /**
+ * Get theme model
+ *
+ * @return array
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ public function getThemeData(): array
+ {
+ $themeId = $this->scopeConfig->getValue(
+ \Magento\Framework\View\DesignInterface::XML_PATH_THEME_ID,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $this->storeManager->getStore()->getId()
+ );
+
+ /** @var $theme \Magento\Framework\View\Design\ThemeInterface */
+ $theme = $this->themeProvider->getThemeById($themeId);
+
+ $data = $theme->getData();
+ $data['themeModel'] = $theme;
+
+ return $data;
+ }
+}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php
index bb9c67f6d753d..b957292a3ac28 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/ProductImageTest.php
@@ -60,12 +60,25 @@ public function testProductWithoutBaseImage()
url
label
}
+ small_image {
+ url
+ label
+ }
}
}
}
QUERY;
$response = $this->graphQlQuery($query);
self::assertEquals('Simple Product', $response['products']['items'][0]['image']['label']);
+ self::assertStringEndsWith(
+ 'images/product/placeholder/image.jpg',
+ $response['products']['items'][0]['image']['url']
+ );
+ self::assertEquals('Simple Product', $response['products']['items'][0]['small_image']['label']);
+ self::assertStringEndsWith(
+ 'images/product/placeholder/small_image.jpg',
+ $response['products']['items'][0]['small_image']['url']
+ );
}
/**
From 74e632e5c9ffcca9d90efa8691e59d88429d3f3d Mon Sep 17 00:00:00 2001
From: Kevin Kozan
Date: Tue, 12 Feb 2019 14:38:11 -0600
Subject: [PATCH 074/254] MC-4416: Convert CreateProductAttributeEntityTest to
MFTF
- Fixed TestCaseId for variation.
---
.../Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
index 551d7af1d6a30..f8f0d066f7a4e 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
@@ -179,7 +179,7 @@
-
+
From e72d452e33ec3519594380dae052a353d6d9c1d6 Mon Sep 17 00:00:00 2001
From: Vitaliy Boyko
Date: Tue, 12 Feb 2019 23:39:57 +0200
Subject: [PATCH 075/254] graphQl-239: fixed namespace
---
.../Model/Resolver/Products/DataProvider/Image/Placeholder.php | 1 +
.../Resolver/Products/DataProvider/Image/Placeholder/Theme.php | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
index a558ec2bfa253..699613893949b 100644
--- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
+++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
@@ -7,6 +7,7 @@
namespace Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Image;
+use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Image\Placeholder\Theme;
use Magento\Catalog\Model\View\Asset\PlaceholderFactory;
use Magento\Framework\View\Asset\Repository as AssetRepository;
diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder/Theme.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder/Theme.php
index 3988dbbc25b33..dc48c5ef69346 100644
--- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder/Theme.php
+++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder/Theme.php
@@ -5,7 +5,7 @@
*/
declare(strict_types=1);
-namespace Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Image;
+namespace Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Image\Placeholder;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\View\Design\Theme\ThemeProviderInterface;
From b46c740c6f2a2ccc940f4040b45314b0301d644b Mon Sep 17 00:00:00 2001
From: Nathan Smith
Date: Wed, 13 Feb 2019 09:01:48 -0600
Subject: [PATCH 076/254] MAGETWO-98225: AuthorizenetAcceptjs broken for
multi-shipping checkout
- Fixed option
- Added config test coverage
---
app/code/Magento/AuthorizenetAcceptjs/etc/payment.xml | 2 +-
.../Magento/AuthorizenetAcceptjs/Gateway/ConfigTest.php | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/AuthorizenetAcceptjs/etc/payment.xml b/app/code/Magento/AuthorizenetAcceptjs/etc/payment.xml
index b8292839c3bd1..b9f8d40b03006 100644
--- a/app/code/Magento/AuthorizenetAcceptjs/etc/payment.xml
+++ b/app/code/Magento/AuthorizenetAcceptjs/etc/payment.xml
@@ -9,7 +9,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd">
- 1
+ 0
diff --git a/dev/tests/integration/testsuite/Magento/AuthorizenetAcceptjs/Gateway/ConfigTest.php b/dev/tests/integration/testsuite/Magento/AuthorizenetAcceptjs/Gateway/ConfigTest.php
index 7e6aeda5a7a6d..a37f927274242 100644
--- a/dev/tests/integration/testsuite/Magento/AuthorizenetAcceptjs/Gateway/ConfigTest.php
+++ b/dev/tests/integration/testsuite/Magento/AuthorizenetAcceptjs/Gateway/ConfigTest.php
@@ -8,6 +8,7 @@
namespace Magento\AuthorizenetAcceptjs\Gateway;
+use Magento\Framework\Config\Data;
use Magento\Payment\Model\Method\Adapter;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\ObjectManager;
@@ -40,5 +41,11 @@ public function testVerifyConfiguration()
$this->assertTrue($paymentAdapter->canUseInternal());
$this->assertTrue($paymentAdapter->canEdit());
$this->assertTrue($paymentAdapter->canFetchTransactionInfo());
+
+ /** @var Data $configReader */
+ $configReader = $this->objectManager->get('Magento\Payment\Model\Config\Data');
+ $value = $configReader->get('methods/authorizenet_acceptjs/allow_multiple_address');
+
+ $this->assertSame('0', $value);
}
}
From b3c1ecd401bad12cdf6d9c8e5a064297e4bc5837 Mon Sep 17 00:00:00 2001
From: Soumya Unnikrishnan
Date: Wed, 13 Feb 2019 09:04:53 -0600
Subject: [PATCH 077/254] MC-4544: Convert PasswordAutocompleteOffTest to MFTF
---
.../LoginToStorefrontActionGroup.xml | 8 +++
.../StorefrontCustomerActionGroup.xml | 3 +
.../Section/StorefrontPanelHeaderSection.xml | 1 +
.../Mftf/Test/PasswordAutocompleteOffTest.xml | 62 +++++++++++++++++++
.../TestCase/PasswordAutocompleteOffTest.xml | 1 +
5 files changed, 75 insertions(+)
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
index 7be36ffbd9bc4..ae720e9bbf2a1 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
@@ -16,4 +16,12 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml
index fc5c1b881752e..1759c8a4eb6a3 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml
@@ -15,4 +15,7 @@
stepKey="clickHeaderCustomerMenuButton" />
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontPanelHeaderSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontPanelHeaderSection.xml
index 1955c6a417ba9..0e6970e350240 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontPanelHeaderSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontPanelHeaderSection.xml
@@ -14,6 +14,7 @@
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
new file mode 100644
index 0000000000000..798f9476e16a7
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/PasswordAutocompleteOffTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/PasswordAutocompleteOffTest.xml
index b4188ebd98ae7..7f267c1f171f6 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/PasswordAutocompleteOffTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/PasswordAutocompleteOffTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
default
disable_guest_checkout,password_autocomplete_off
From 85ed36805bcc51c85155c1d9e7f27722607325f4 Mon Sep 17 00:00:00 2001
From: Kavitha
Date: Wed, 13 Feb 2019 13:17:57 -0600
Subject: [PATCH 078/254] MC-4535: Convert DeleteCustomerBackendEntityTest to
MFTF
---
.../AdminDeleteCustomerActionGroup.xml | 18 +++++++
.../Mftf/Section/AdminCustomerGridSection.xml | 1 +
.../Mftf/Test/AdminDeleteCustomerTest.xml | 47 +++++++++++++++++++
3 files changed, 66 insertions(+)
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerTest.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerActionGroup.xml
index d08f10b22419d..a3334dbd6c842 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerActionGroup.xml
@@ -21,4 +21,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml
index d9d3bfe7f737c..7cc32a5fcecd7 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml
@@ -11,5 +11,6 @@
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerTest.xml
new file mode 100644
index 0000000000000..7fef916fc458a
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminDeleteCustomerTest.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 55374cc319ee981d710c869e4fd387097e44651d Mon Sep 17 00:00:00 2001
From: Soumya Unnikrishnan
Date: Wed, 13 Feb 2019 13:21:36 -0600
Subject: [PATCH 079/254] MC-4544: Convert PasswordAutocompleteOffTest to MFTF
removed a group tag that wasn't necessary
---
.../Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
index 798f9476e16a7..7e5def00f813b 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
@@ -16,7 +16,6 @@
-
From 8200acc3a86d55016b2d26e502e05ddac98e300b Mon Sep 17 00:00:00 2001
From: Kavitha
Date: Wed, 13 Feb 2019 16:14:26 -0600
Subject: [PATCH 080/254] MC-4526: Convert
VerifyConfigurableProductLayeredNavigationTest to MFTF
---
.../StorefrontProductAttributeActionGroup.xml | 26 +++
...nfigurableProductLayeredNavigationTest.xml | 148 ++++++++++++++++++
2 files changed, 174 insertions(+)
create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductAttributeActionGroup.xml
create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductAttributeActionGroup.xml
new file mode 100644
index 0000000000000..8fab65527315e
--- /dev/null
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductAttributeActionGroup.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml
new file mode 100644
index 0000000000000..a230b6851da73
--- /dev/null
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 04f325eb0455bb1e80c82a0a4d150936c3d2c6b5 Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Thu, 14 Feb 2019 10:59:15 -0600
Subject: [PATCH 081/254] MC-4379: Convert
SubcategoryNotIncludeInNavigationMenuTest to MFTF
- Reference createData instead of entity directly
---
...nuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml | 6 +++---
...tegoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml | 6 +++---
...nuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml | 6 +++---
...dminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
index d6126916046a9..fd22142fcb097 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveAndNotIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
@@ -35,7 +35,7 @@
-
+
@@ -45,9 +45,9 @@
-
+
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml
index 9362719ba56de..b6c76d6577210 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveCategoryAndSubcategoryIsNotVisibleInNavigationMenuTest.xml
@@ -34,7 +34,7 @@
-
+
@@ -44,9 +44,9 @@
-
+
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
index 2b8f47d1ca265..c9cd9acd9708c 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckInactiveIncludeInMenuCategoryAndSubcategoryIsNotVisibleInNavigationTest.xml
@@ -35,7 +35,7 @@
-
+
@@ -45,9 +45,9 @@
-
+
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml
index e250fa7b15dd1..f5872ac3efca0 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckSubCategoryIsNotVisibleInNavigationMenuTest.xml
@@ -34,7 +34,7 @@
-
+
@@ -44,9 +44,9 @@
-
+
-
+
From 285e95b8e89acfe781be241b2e668eb9a7d0d4dd Mon Sep 17 00:00:00 2001
From: Soumya Unnikrishnan
Date: Thu, 14 Feb 2019 11:30:48 -0600
Subject: [PATCH 082/254] MC-4544: Convert PasswordAutocompleteOffTest to MFTF
Merge branch 'mtf-eol' of https://github.com/magento-pangolin/magento2ce into MC-4544
Updated as per review comments - removed old code
---
.../Mftf/ActionGroup/LoginToStorefrontActionGroup.xml | 8 --------
1 file changed, 8 deletions(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
index ae720e9bbf2a1..7be36ffbd9bc4 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
@@ -16,12 +16,4 @@
-
-
-
-
-
-
-
-
From 098ca6c5877c4ea1c4e6ab9ed815a04e07a03d64 Mon Sep 17 00:00:00 2001
From: sathakur
Date: Thu, 14 Feb 2019 15:29:12 -0600
Subject: [PATCH 083/254] MC-4534: Convert UpdateCustomerFrontendEntityTest to
MFTF
---
.../ActionGroup/DeleteCustomerActionGroup.xml | 21 ++++-
...SignUpNewUserFromStorefrontActionGroup.xml | 77 ++++++++++++++++++-
.../Customer/Test/Mftf/Data/AddressData.xml | 48 +++++++++++-
.../Customer/Test/Mftf/Data/CustomerData.xml | 13 +++-
.../Mftf/Section/AdminCustomerGridSection.xml | 3 +-
.../StorefrontCustomerSidebarSection.xml | 4 +-
...refrontUpdateCustomerAddressFranceTest.xml | 52 +++++++++++++
.../StorefrontUpdateCustomerAddressUKTest.xml | 57 ++++++++++++++
...pdateCustomerInformationAddAddressTest.xml | 57 ++++++++++++++
9 files changed, 323 insertions(+), 9 deletions(-)
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressFranceTest.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressUKTest.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyNoXssInjectionOnUpdateCustomerInformationAddAddressTest.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml
index 4d531214db150..04568eb6eb23f 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml
@@ -24,4 +24,23 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml
index 76acf6e865963..f59374605608d 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml
@@ -39,15 +39,86 @@
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml b/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml
index da36cf722325e..e456ddbec5d4d 100755
--- a/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml
@@ -191,4 +191,50 @@
true
false
-
+
+ John
+ Doe
+ Magento
+ 0123456789-02134567
+
+ - 172, Westminster Bridge Rd
+ - 7700 xyz street
+
+ GB
+ United Kingdom
+ London
+
+
+ 12345
+
+
+ Jaen
+ Reno
+ Magento
+ 555-888-111-999
+
+ - 18-20 Rue Maréchal Lecler
+ - 18-20 Rue Maréchal Lecler
+
+ FR
+ France
+ Quintin
+ Côtes-d'Armor
+ 12345
+
+
+ Jany
+ Doe
+ Magento
+ 555-888-111-999
+
+ - 7700 West Parmer Lane
+ - 7700 West Parmer Lane
+
+ US
+ United States
+ Denver
+ Colorado
+ 12345
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml
index b3c0d8d9e0047..e3bcef319262e 100644
--- a/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml
@@ -178,4 +178,15 @@
US_Default_Billing_Address_TX
US_Default_Shipping_Address_CA
-
+
+ 1
+ true
+ true
+ Patric.Patric@example.com
+ Patrick</title></head><svg/onload=alert('XSS')>
+ <script>alert('Last name')</script>
+ 123123^q
+ 0
+ 0
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml
index d9d3bfe7f737c..a49a545bbe10a 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml
@@ -11,5 +11,6 @@
-
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSidebarSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSidebarSection.xml
index 0e31f0e0c7782..bed0c71ae7fad 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSidebarSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerSidebarSection.xml
@@ -10,6 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
-
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressFranceTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressFranceTest.xml
new file mode 100644
index 0000000000000..dae456c96a679
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressFranceTest.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressUKTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressUKTest.xml
new file mode 100644
index 0000000000000..7b6e695aa8dc4
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressUKTest.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyNoXssInjectionOnUpdateCustomerInformationAddAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyNoXssInjectionOnUpdateCustomerInformationAddAddressTest.xml
new file mode 100644
index 0000000000000..e11404db9a9a9
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontVerifyNoXssInjectionOnUpdateCustomerInformationAddAddressTest.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 7e17bf2ba5e5cd8716bd27f37bc8c86bf3c8c656 Mon Sep 17 00:00:00 2001
From: "rostyslav.hymon"
Date: Fri, 15 Feb 2019 09:47:29 +0200
Subject: [PATCH 084/254] MAGETWO-98087: [2.3] Customer Group Regression issues
from MAGETWO-96886
---
.../Magento/Backend/Model/Session/Quote.php | 2 +-
.../Adminhtml/Order/Create/Form/Account.php | 11 ++-
.../Order/Create/Form/AccountTest.php | 83 ++++++++++++++-----
3 files changed, 69 insertions(+), 27 deletions(-)
diff --git a/app/code/Magento/Backend/Model/Session/Quote.php b/app/code/Magento/Backend/Model/Session/Quote.php
index 11edaa26f443f..b0bdf29441225 100644
--- a/app/code/Magento/Backend/Model/Session/Quote.php
+++ b/app/code/Magento/Backend/Model/Session/Quote.php
@@ -149,7 +149,7 @@ public function getQuote()
$this->_quote = $this->quoteFactory->create();
if ($this->getStoreId()) {
if (!$this->getQuoteId()) {
- $this->_quote->setCustomerGroupId($this->groupManagement->getDefaultGroup()->getId());
+ $this->_quote->setCustomerGroupId($this->groupManagement->getDefaultGroup($this->getStoreId())->getId());
$this->_quote->setIsActive(false);
$this->_quote->setStoreId($this->getStoreId());
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
index f53fe4b4f745a..ccfa21f7b25cd 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
@@ -9,7 +9,6 @@
use Magento\Framework\Api\ExtensibleDataObjectConverter;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Pricing\PriceCurrencyInterface;
-use Magento\Store\Model\ScopeInterface;
/**
* Create order account form
@@ -133,8 +132,14 @@ protected function _prepareForm()
$this->_addAttributesToForm($attributes, $fieldset);
$this->_form->addFieldNameSuffix('order[account]');
- $storeId = (int)$this->_sessionQuote->getStoreId();
- $this->_form->setValues($this->extractValuesFromAttributes($attributes, $storeId));
+ $formValues = $this->getFormValues();
+ foreach ($attributes as $code => $attribute) {
+ $defaultValue = $attribute->getDefaultValue();
+ if (isset($defaultValue) && !isset($formValues[$code])) {
+ $formValues[$code] = $defaultValue;
+ }
+ }
+ $this->_form->setValues($formValues);
return $this;
}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php
index b289e9b94558e..b3cae0b71237e 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php
@@ -5,7 +5,6 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-
declare(strict_types=1);
namespace Magento\Sales\Block\Adminhtml\Order\Create\Form;
@@ -23,7 +22,10 @@
use PHPUnit\Framework\MockObject\MockObject;
/**
+ * Class for test Account
+ *
* @magentoAppArea adminhtml
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class AccountTest extends \PHPUnit\Framework\TestCase
{
@@ -43,23 +45,33 @@ class AccountTest extends \PHPUnit\Framework\TestCase
private $session;
/**
- * @magentoDataFixture Magento/Sales/_files/quote.php
+ * {@inheritdoc}
*/
protected function setUp()
{
$this->objectManager = Bootstrap::getObjectManager();
- $quote = $this->objectManager->create(Quote::class)->load(1);
+ parent::setUp();
+ }
+
+ /**
+ * Test for get form with existing customer
+ *
+ * @magentoDataFixture Magento/Customer/_files/customer.php
+ */
+ public function testGetFormWithCustomer()
+ {
+ $customerGroup = 2;
+ $quote = $this->objectManager->create(Quote::class);
$this->session = $this->getMockBuilder(SessionQuote::class)
->disableOriginalConstructor()
- ->setMethods(['getCustomerId', 'getStore', 'getStoreId', 'getQuote', 'getQuoteId'])
+ ->setMethods(['getCustomerId','getQuote'])
->getMock();
- $this->session->method('getCustomerId')
- ->willReturn(1);
$this->session->method('getQuote')
->willReturn($quote);
- $this->session->method('getQuoteId')
- ->willReturn($quote->getId());
+ $this->session->method('getCustomerId')
+ ->willReturn(1);
+
/** @var LayoutInterface $layout */
$layout = $this->objectManager->get(LayoutInterface::class);
$this->accountBlock = $layout->createBlock(
@@ -67,18 +79,20 @@ protected function setUp()
'address_block' . rand(),
['sessionQuote' => $this->session]
);
- parent::setUp();
- }
- /**
- * @magentoDataFixture Magento/Customer/_files/customer.php
- */
- public function testGetForm()
- {
+ $fixtureCustomerId = 1;
+ /** @var \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository */
+ $customerRepository = $this->objectManager->get(\Magento\Customer\Api\CustomerRepositoryInterface::class);
+ /** @var \Magento\Customer\Api\Data\CustomerInterface $customer */
+ $customer = $customerRepository->getById($fixtureCustomerId);
+ $customer->setGroupId($customerGroup);
+ $customerRepository->save($customer);
+
$expectedFields = ['group_id', 'email'];
$form = $this->accountBlock->getForm();
self::assertEquals(1, $form->getElements()->count(), "Form has invalid number of fieldsets");
$fieldset = $form->getElements()[0];
+ $content = $form->toHtml();
self::assertEquals(count($expectedFields), $fieldset->getElements()->count());
@@ -88,22 +102,45 @@ public function testGetForm()
sprintf('Unexpected field "%s" in form.', $element->getId())
);
}
+
+ self::assertContains(
+ '',
+ $content,
+ 'The Customer Group specified for the chosen customer should be selected.'
+ );
+
+ self::assertContains(
+ 'value="'.$customer->getEmail().'"',
+ $content,
+ 'The Customer Email specified for the chosen customer should be input '
+ );
}
/**
* Tests a case when user defined custom attribute has default value.
*
- * @magentoDataFixture Magento/Customer/_files/customer.php
- * @magentoConfigFixture current_store customer/create_account/default_group 3
+ * @magentoDataFixture Magento/Store/_files/core_second_third_fixturestore.php
+ * @magentoConfigFixture current_store customer/create_account/default_group 2
+ * @magentoConfigFixture secondstore_store customer/create_account/default_group 3
*/
public function testGetFormWithUserDefinedAttribute()
{
+ /** @var \Magento\Store\Model\StoreManagerInterface $storeManager */
+ $storeManager = Bootstrap::getObjectManager()->get(\Magento\Store\Model\StoreManagerInterface::class);
+ $secondStore = $storeManager->getStore('secondstore');
+
+ $quoteSession = $this->objectManager->get(SessionQuote::class);
+ $quoteSession->setStoreId($secondStore->getId());
+
$formFactory = $this->getFormFactoryMock();
$this->objectManager->addSharedInstance($formFactory, FormFactory::class);
/** @var LayoutInterface $layout */
$layout = $this->objectManager->get(LayoutInterface::class);
- $accountBlock = $layout->createBlock(Account::class, 'address_block' . rand());
+ $accountBlock = $layout->createBlock(
+ Account::class,
+ 'address_block' . rand()
+ );
$form = $accountBlock->getForm();
$form->setUseContainer(true);
@@ -116,7 +153,7 @@ public function testGetFormWithUserDefinedAttribute()
);
self::assertContains(
- '',
+ '',
$content,
'The Customer Group specified for the chosen store should be selected.'
);
@@ -162,13 +199,13 @@ private function createCustomerGroupAttribute(): AttributeMetadataInterface
{
/** @var Option $option1 */
$option1 = $this->objectManager->create(Option::class);
- $option1->setValue(3);
- $option1->setLabel('Customer Group 1');
+ $option1->setValue(2);
+ $option1->setLabel('Wholesale');
/** @var Option $option2 */
$option2 = $this->objectManager->create(Option::class);
- $option2->setValue(4);
- $option2->setLabel('Customer Group 2');
+ $option2->setValue(3);
+ $option2->setLabel('Retailer');
/** @var AttributeMetadataInterfaceFactory $attributeMetadataFactory */
$attributeMetadataFactory = $this->objectManager->create(AttributeMetadataInterfaceFactory::class);
From 2474891bd7927a41825d6505797647bdb843673c Mon Sep 17 00:00:00 2001
From: Serhiy Yelahin
Date: Fri, 15 Feb 2019 10:31:19 +0200
Subject: [PATCH 085/254] MAGETWO-98013: [2.3] Configurable product is
displayed as In Stock in product grid when it's set to out of stock
---
...uantityAndStockStatusFieldToCollection.php | 32 +++++
app/code/Magento/Catalog/etc/adminhtml/di.xml | 1 +
.../Product/QuantityAndStockStatusTest.php | 119 ++++++++++++++++++
3 files changed, 152 insertions(+)
create mode 100644 app/code/Magento/Catalog/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php
create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php b/app/code/Magento/Catalog/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php
new file mode 100644
index 0000000000000..cafe175a27e13
--- /dev/null
+++ b/app/code/Magento/Catalog/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php
@@ -0,0 +1,32 @@
+joinField(
+ 'quantity_and_stock_status',
+ 'cataloginventory_stock_item',
+ 'is_in_stock',
+ 'product_id=entity_id',
+ '{{table}}.stock_id=1',
+ 'left'
+ );
+ }
+}
diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml
index c04cfb2dce00a..c2028b921efb8 100644
--- a/app/code/Magento/Catalog/etc/adminhtml/di.xml
+++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml
@@ -87,6 +87,7 @@
- Magento\Catalog\Ui\DataProvider\Product\AddWebsitesFieldToCollection
+ - Magento\Catalog\Ui\DataProvider\Product\AddQuantityAndStockStatusFieldToCollection
- Magento\Catalog\Ui\DataProvider\Product\AddStoreFieldToCollection
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
new file mode 100644
index 0000000000000..150c3f64e6c1c
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
@@ -0,0 +1,119 @@
+objectManager = Bootstrap::getObjectManager();
+ $eavSetup = $this->objectManager->create(EavSetup::class);
+ $this->isUsedInGridValue = $eavSetup->getAttribute(
+ Product::ENTITY,
+ self::$quantityAndStockStatus,
+ EavAttributeInterface::IS_USED_IN_GRID
+ );
+ $eavSetup->addAttribute(
+ Product::ENTITY,
+ self::$quantityAndStockStatus,
+ [
+ EavAttributeInterface::IS_USED_IN_GRID => 1,
+ ]
+ );
+ }
+
+ /**
+ * Test product stock status in the products grid column
+ *
+ * @magentoDataFixture Magento/Checkout/_files/simple_product.php
+ */
+ public function testProductStockStatus()
+ {
+ $stockItemRepository = $this->objectManager->create(StockItemRepository::class);
+
+ /** @var StockItemCriteriaInterface $stockItemCriteria */
+ $stockItemCriteria = $this->objectManager->create(StockItemCriteriaInterface::class);
+
+ $savedStockItem = current($stockItemRepository->getList($stockItemCriteria)
+ ->getItems());
+ $savedStockItemId = $savedStockItem->getItemId();
+
+ $savedStockItem->setIsInStock(true);
+ $savedStockItem->save();
+
+ $savedStockItem->setIsInStock(false);
+ $savedStockItem->save();
+
+ $dataProvider = $this->objectManager->create(
+ ProductDataProvider::class,
+ [
+ 'name' => 'product_listing_data_source',
+ 'primaryFieldName' => 'entity_id',
+ 'requestFieldName' => 'id',
+ 'addFieldStrategies' => [
+ 'quantity_and_stock_status' =>
+ $this->objectManager->get(AddQuantityAndStockStatusFieldToCollection::class)
+ ]
+ ]
+ );
+
+ $dataProvider->addField(self::$quantityAndStockStatus);
+ $data = $dataProvider->getData();
+
+ $this->assertEquals(
+ $data['items'][0][self::$quantityAndStockStatus],
+ $savedStockItem->load($savedStockItemId)
+ ->getData('is_in_stock')
+ );
+ }
+
+ /**
+ * @inheritdoc
+ */
+ protected function tearDown()
+ {
+ $eavSetup = $this->objectManager->create(EavSetup::class);
+ $eavSetup->addAttribute(
+ Product::ENTITY,
+ self::$quantityAndStockStatus,
+ [
+ EavAttributeInterface::IS_USED_IN_GRID => $this->isUsedInGridValue,
+ ]
+ );
+ parent::tearDown();
+ }
+}
From 548dd31502ccda30a2d5b48e2b73b527bb033145 Mon Sep 17 00:00:00 2001
From: "rostyslav.hymon"
Date: Fri, 15 Feb 2019 11:17:36 +0200
Subject: [PATCH 086/254] MAGETWO-98087: [2.3] Customer Group Regression issues
from MAGETWO-96886
---
.../Adminhtml/Order/Create/Form/Account.php | 38 -------------------
1 file changed, 38 deletions(-)
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
index ccfa21f7b25cd..b2dcf949ef2d2 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
@@ -192,42 +192,4 @@ public function getFormValues()
return $data;
}
-
- /**
- * Extract the form values from attributes.
- *
- * @param array $attributes
- * @param int $storeId
- * @return array
- */
- private function extractValuesFromAttributes(array $attributes, int $storeId): array
- {
- $formValues = $this->getFormValues();
- foreach ($attributes as $code => $attribute) {
- $defaultValue = $attribute->getDefaultValue();
- if (isset($defaultValue) && !isset($formValues[$code])) {
- $formValues[$code] = $defaultValue;
- }
- if ($code === 'group_id' && empty($formValues[$code])) {
- $formValues[$code] = $this->getDefaultCustomerGroup($storeId);
- }
- }
-
- return $formValues;
- }
-
- /**
- * Gets default customer group.
- *
- * @param int $storeId
- * @return string|null
- */
- private function getDefaultCustomerGroup(int $storeId): ?string
- {
- return $this->_scopeConfig->getValue(
- 'customer/create_account/default_group',
- ScopeInterface::SCOPE_STORE,
- $storeId
- );
- }
}
From 7001229a0efc0cd916a89b56cee3f17b0774196b Mon Sep 17 00:00:00 2001
From: "rostyslav.hymon"
Date: Fri, 15 Feb 2019 13:00:55 +0200
Subject: [PATCH 087/254] MAGETWO-98087: [2.3] Customer Group Regression issues
from MAGETWO-96886
---
app/code/Magento/Backend/Model/Session/Quote.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Backend/Model/Session/Quote.php b/app/code/Magento/Backend/Model/Session/Quote.php
index b0bdf29441225..e32f1bc57596e 100644
--- a/app/code/Magento/Backend/Model/Session/Quote.php
+++ b/app/code/Magento/Backend/Model/Session/Quote.php
@@ -149,7 +149,8 @@ public function getQuote()
$this->_quote = $this->quoteFactory->create();
if ($this->getStoreId()) {
if (!$this->getQuoteId()) {
- $this->_quote->setCustomerGroupId($this->groupManagement->getDefaultGroup($this->getStoreId())->getId());
+ $customerGroupId = $this->groupManagement->getDefaultGroup($this->getStoreId())->getId();
+ $this->_quote->setCustomerGroupId($customerGroupId);
$this->_quote->setIsActive(false);
$this->_quote->setStoreId($this->getStoreId());
From 58e282ad53ec18af2a5c33d2822696b144ac5486 Mon Sep 17 00:00:00 2001
From: "rostyslav.hymon"
Date: Fri, 15 Feb 2019 14:23:30 +0200
Subject: [PATCH 088/254] MAGETWO-98087: [2.3] Customer Group Regression issues
from MAGETWO-96886
---
.../Test/Unit/Model/Session/QuoteTest.php | 5 +++-
.../Adminhtml/Order/Create/Form/Account.php | 28 ++++++++++++++-----
.../Order/Create/Form/AccountTest.php | 2 +-
3 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php b/app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php
index 869d4ba3f45b1..d159225089afc 100644
--- a/app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php
+++ b/app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php
@@ -267,7 +267,10 @@ public function testGetQuoteWithoutQuoteId()
$cartInterfaceMock->expects($this->atLeastOnce())->method('getId')->willReturn($quoteId);
$defaultGroup = $this->getMockBuilder(\Magento\Customer\Api\Data\GroupInterface::class)->getMock();
$defaultGroup->expects($this->any())->method('getId')->will($this->returnValue($customerGroupId));
- $this->groupManagementMock->expects($this->any())->method('getDefaultGroup')->willReturn($defaultGroup);
+ $this->groupManagementMock
+ ->method('getDefaultGroup')
+ ->with($storeId)
+ ->willReturn($defaultGroup);
$dataCustomerMock = $this->getMockBuilder(\Magento\Customer\Api\Data\CustomerInterface::class)
->disableOriginalConstructor()
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
index b2dcf949ef2d2..c2a0eadf7b67a 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
@@ -132,13 +132,8 @@ protected function _prepareForm()
$this->_addAttributesToForm($attributes, $fieldset);
$this->_form->addFieldNameSuffix('order[account]');
- $formValues = $this->getFormValues();
- foreach ($attributes as $code => $attribute) {
- $defaultValue = $attribute->getDefaultValue();
- if (isset($defaultValue) && !isset($formValues[$code])) {
- $formValues[$code] = $defaultValue;
- }
- }
+
+ $formValues = $this->extractValuesFromAttributes($attributes);
$this->_form->setValues($formValues);
return $this;
@@ -192,4 +187,23 @@ public function getFormValues()
return $data;
}
+
+ /**
+ * Extract the form values from attributes.
+ *
+ * @param array $attributes
+ * @return array
+ */
+ private function extractValuesFromAttributes(array $attributes): array
+ {
+ $formValues = $this->getFormValues();
+ foreach ($attributes as $code => $attribute) {
+ $defaultValue = $attribute->getDefaultValue();
+ if (isset($defaultValue) && !isset($formValues[$code])) {
+ $formValues[$code] = $defaultValue;
+ }
+ }
+
+ return $formValues;
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php
index b3cae0b71237e..b75501911be6b 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AccountTest.php
@@ -45,7 +45,7 @@ class AccountTest extends \PHPUnit\Framework\TestCase
private $session;
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
protected function setUp()
{
From 5821d6d01956b65e82d08923abb846cf4965ba2f Mon Sep 17 00:00:00 2001
From: John S
Date: Fri, 15 Feb 2019 09:56:03 -0600
Subject: [PATCH 089/254] MC-4416: Convert CreateProductAttributeEntityTest to
MFTF
- Editing selectors slightly to make them more stable.
- Adding Logout AG to the "after" block.
---
.../ActionGroup/AdminProductAttributeActionGroup.xml | 9 +++++++++
.../Section/AdminCreateProductAttributeSection.xml | 4 ++--
.../Section/AdminProductAddAttributeModalSection.xml | 6 +++---
.../Mftf/Test/CreateProductAttributeEntityTest.xml | 12 +++++++++++-
4 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
index 89321f8f6506a..c6dc796df54b3 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
@@ -19,6 +19,7 @@
+
@@ -30,6 +31,7 @@
+
@@ -40,6 +42,7 @@
+
@@ -47,6 +50,7 @@
+
@@ -61,6 +65,7 @@
+
@@ -72,12 +77,14 @@
+
+
@@ -87,6 +94,7 @@
+
@@ -99,6 +107,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
index 5f083171f97cb..6d7eb574b04d2 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminCreateProductAttributeSection.xml
@@ -31,8 +31,8 @@
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAddAttributeModalSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAddAttributeModalSection.xml
index 7962e8117a8be..a3c98e43b4510 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAddAttributeModalSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAddAttributeModalSection.xml
@@ -9,11 +9,11 @@
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
index f8f0d066f7a4e..2290f5de0069d 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
@@ -18,6 +18,7 @@
+
@@ -28,6 +29,7 @@
+
@@ -74,6 +76,7 @@
+
@@ -84,6 +87,7 @@
+
@@ -131,6 +135,7 @@
+
@@ -141,6 +146,7 @@
+
@@ -182,6 +188,7 @@
+
@@ -192,6 +199,7 @@
+
@@ -266,6 +274,7 @@
+
@@ -276,6 +285,7 @@
+
@@ -311,7 +321,6 @@
-
@@ -343,6 +352,7 @@
+
From 111dd2ceafbfc7aae5d8e6bd553117c3936515bb Mon Sep 17 00:00:00 2001
From: Dave Macaulay
Date: Fri, 15 Feb 2019 17:13:56 +0100
Subject: [PATCH 090/254] MC-14858: Failing MFTF Test:
CheckMessageDisplayedForUsedCompanyTest
- Ensure filters are cleared after executing test
---
.../Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml
index 7c24a8aba27bd..79eec02a828f6 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml
@@ -28,6 +28,7 @@
+
From d128b959538f952eedafda0fdfbad5c5479fe620 Mon Sep 17 00:00:00 2001
From: Soumya Unnikrishnan
Date: Fri, 15 Feb 2019 10:15:43 -0600
Subject: [PATCH 091/254] MC-4544: Convert PasswordAutocompleteOffTest to MFTF
Rectified StoreFront to Storefront - all files
---
...oreFrontPasswordAutocompleteOffActionGroup.xml | 2 +-
...orefrontPasswordAutocompleteOffActionGroup.xml | 14 ++++++++++++++
.../StoreFrontClickSignInButtonActionGroup.xml | 4 ++--
.../StorefrontClickSignInButtonActionGroup.xml | 15 +++++++++++++++
.../Mftf/Test/PasswordAutocompleteOffTest.xml | 5 +++--
5 files changed, 35 insertions(+), 5 deletions(-)
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontPasswordAutocompleteOffActionGroup.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickSignInButtonActionGroup.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStoreFrontPasswordAutocompleteOffActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStoreFrontPasswordAutocompleteOffActionGroup.xml
index b4c32132070d7..23a067cd94eea 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStoreFrontPasswordAutocompleteOffActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStoreFrontPasswordAutocompleteOffActionGroup.xml
@@ -7,7 +7,7 @@
-->
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontPasswordAutocompleteOffActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontPasswordAutocompleteOffActionGroup.xml
new file mode 100644
index 0000000000000..23a067cd94eea
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontPasswordAutocompleteOffActionGroup.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StoreFrontClickSignInButtonActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StoreFrontClickSignInButtonActionGroup.xml
index 01b678732caab..b12858fc1037e 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StoreFrontClickSignInButtonActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StoreFrontClickSignInButtonActionGroup.xml
@@ -8,8 +8,8 @@
-
-
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickSignInButtonActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickSignInButtonActionGroup.xml
new file mode 100644
index 0000000000000..b12858fc1037e
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontClickSignInButtonActionGroup.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
index 86485ca8e877f..1cb62b5492334 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
@@ -17,6 +17,7 @@
+
@@ -47,10 +48,10 @@
-
+
-
+
From 21f2b5cf44a8d0f501f60c66de171180190b02e9 Mon Sep 17 00:00:00 2001
From: Soumya Unnikrishnan
Date: Fri, 15 Feb 2019 11:12:12 -0600
Subject: [PATCH 092/254] MC-4544: Convert PasswordAutocompleteOffTest to MFTF
Removed group tag
---
.../Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
index 1cb62b5492334..f364d24806b9c 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/PasswordAutocompleteOffTest.xml
@@ -17,7 +17,6 @@
-
From 581434ebbfd3aea5e8b6dddf7c19524297db0a19 Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Fri, 15 Feb 2019 11:48:04 -0600
Subject: [PATCH 093/254] MC-4410: Convert
DeleteAssignedToTemplateProductAttributeTest to MFTF
- Restore change to newProductAttribute data entity that I missed during merge
---
.../Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
index f0b473c67695c..d51e9441f71ef 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
@@ -138,7 +138,7 @@
attribute
- Text Field
+ text
global
false
false
From 7d74789741c361e5e6ef9663629d42c6be3abdac Mon Sep 17 00:00:00 2001
From: Kavitha
Date: Fri, 15 Feb 2019 13:39:52 -0600
Subject: [PATCH 094/254] MC-4897: Convert CreateCategoryRewriteEntityTest to
MFTF
---
.../ActionGroup/AdminCategoryActionGroup.xml | 12 +++++
.../AdminUrlRewriteActionGroup.xml | 36 +++++++++++++
.../AdminUrlRewriteGridActionGroup.xml | 28 ++++++++++
...torefrontUrlRewriteRedirectActionGroup.xml | 21 ++++++++
.../Mftf/Page/AdminUrlRewriteEditPage.xml | 14 +++++
.../Section/AdminUrlRewriteEditSection.xml | 26 ++++++++++
.../Section/AdminUrlRewriteIndexSection.xml | 1 +
...CategoryUrlRewriteAndAddNoRedirectTest.xml | 52 +++++++++++++++++++
...yUrlRewriteAndAddPermanentRedirectTest.xml | 52 +++++++++++++++++++
...yUrlRewriteAndAddTemporaryRedirectTest.xml | 52 +++++++++++++++++++
10 files changed, 294 insertions(+)
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
index 57f91b78fcbe9..1f355e32d7577 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
@@ -263,4 +263,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml
new file mode 100644
index 0000000000000..6fe473b9a4de8
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml
new file mode 100644
index 0000000000000..4cff40befbcb0
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml
new file mode 100644
index 0000000000000..1e0ebbe3e9a44
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml
new file mode 100644
index 0000000000000..0007102d6525c
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml
new file mode 100644
index 0000000000000..233731247f502
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteEditSection.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteIndexSection.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteIndexSection.xml
index 7c21acdf943ba..4207dffa4fd43 100644
--- a/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteIndexSection.xml
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteIndexSection.xml
@@ -19,5 +19,6 @@
+
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml
new file mode 100644
index 0000000000000..a7a7c0c73d826
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddNoRedirectTest.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml
new file mode 100644
index 0000000000000..ab423e37378d3
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddPermanentRedirectTest.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml
new file mode 100644
index 0000000000000..b6f53524a14e7
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCategoryUrlRewriteAndAddTemporaryRedirectTest.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From df87bd74e8c90b82928279655e1597795d24650d Mon Sep 17 00:00:00 2001
From: Ji Lu
Date: Fri, 15 Feb 2019 14:36:28 -0600
Subject: [PATCH 095/254] MC-10916: Update Customer Password on Storefront,
Valid Current Password MC-10917: Update Customer Password on Storefront,
Invalid Current Password MC-10918: Update Customer Password on Storefront,
Invalid Confirmation Password
---
.../LoginToStorefrontActionGroup.xml | 10 ----------
...refrontWithEmailAndPasswordActionGroup.xml | 20 +++++++++++++++++++
.../StorefrontUpdateCustomerPasswordTest.xml | 2 +-
3 files changed, 21 insertions(+), 11 deletions(-)
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontWithEmailAndPasswordActionGroup.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
index 79961b2bfc297..7be36ffbd9bc4 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.xml
@@ -16,14 +16,4 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontWithEmailAndPasswordActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontWithEmailAndPasswordActionGroup.xml
new file mode 100644
index 0000000000000..33852fcf80864
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontWithEmailAndPasswordActionGroup.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml
index a168a5f380538..38ea0de6f05a1 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml
@@ -38,7 +38,7 @@
-
+
From 80cd335e35ad9827954492427db81db14b1c510f Mon Sep 17 00:00:00 2001
From: Cristian Partica
Date: Fri, 15 Feb 2019 16:30:13 -0600
Subject: [PATCH 096/254] MAGETWO-98258: Fix elacticsearch search perfomance
- reverting back fix
---
.../Product/FieldProvider/DynamicField.php | 2 +-
.../Aggregation/Builder/Term.php | 9 +--
.../SearchAdapter/Query/Builder/Match.php | 52 ++++---------
.../ValueTransformer/DateTransformer.php | 44 -----------
.../ValueTransformer/FloatTransformer.php | 24 ------
.../ValueTransformer/IntegerTransformer.php | 24 ------
.../ValueTransformer/TextTransformer.php | 65 ----------------
.../Query/ValueTransformerInterface.php | 22 ------
.../Query/ValueTransformerPool.php | 46 -----------
.../SearchAdapter/Query/Builder/MatchTest.php | 76 ++++++++++++-------
app/code/Magento/Elasticsearch/etc/di.xml | 18 -----
.../Model/ResourceModel/SynonymReader.php | 14 +---
...llback.php => text_attribute_rollback.php} | 6 +-
.../_files/product_export_data_rollback.php | 8 +-
...uct_export_data_special_chars_rollback.php | 8 +-
.../SearchAdapter/AdapterTest.php | 14 ----
.../Search/_files/filterable_attributes.php | 33 +-------
.../_files/filterable_attributes_rollback.php | 12 +--
.../Search/Model/SynonymReaderTest.php | 17 +----
19 files changed, 81 insertions(+), 413 deletions(-)
delete mode 100644 app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformer/DateTransformer.php
delete mode 100644 app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformer/FloatTransformer.php
delete mode 100644 app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformer/IntegerTransformer.php
delete mode 100644 app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformer/TextTransformer.php
delete mode 100644 app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformerInterface.php
delete mode 100644 app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformerPool.php
rename dev/tests/integration/testsuite/Magento/Catalog/_files/{product_text_attribute_rollback.php => text_attribute_rollback.php} (84%)
diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php b/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php
index 9e2659a757924..c7e2a4beabb5c 100644
--- a/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php
+++ b/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php
@@ -126,7 +126,7 @@ public function getFields(array $context = []): array
foreach ($groups as $group) {
$groupPriceKey = $this->fieldNameResolver->getFieldName(
$priceAttribute,
- array_merge($context, ['customerGroupId' => $group->getId()])
+ ['customerGroupId' => $group->getId(), 'websiteId' => $context['websiteId']]
);
$allAttributes[$groupPriceKey] = [
'type' => $this->fieldTypeConverter->convert(FieldTypeConverterInterface::INTERNAL_DATA_TYPE_FLOAT),
diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Term.php b/app/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Term.php
index eeb48f805bccf..bcfb7f5565b86 100644
--- a/app/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Term.php
+++ b/app/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Term.php
@@ -8,13 +8,10 @@
use Magento\Framework\Search\Request\BucketInterface as RequestBucketInterface;
use Magento\Framework\Search\Dynamic\DataProviderInterface;
-/**
- * Builder for term buckets.
- */
class Term implements BucketBuilderInterface
{
/**
- * @inheritdoc
+ * {@inheritdoc}
*/
public function build(
RequestBucketInterface $bucket,
@@ -22,15 +19,13 @@ public function build(
array $queryResult,
DataProviderInterface $dataProvider
) {
- $buckets = $queryResult['aggregations'][$bucket->getName()]['buckets'] ?? [];
$values = [];
- foreach ($buckets as $resultBucket) {
+ foreach ($queryResult['aggregations'][$bucket->getName()]['buckets'] as $resultBucket) {
$values[$resultBucket['key']] = [
'value' => $resultBucket['key'],
'count' => $resultBucket['doc_count'],
];
}
-
return $values;
}
}
diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php
index e83c49941bcc2..f1c3451482bab 100644
--- a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php
+++ b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php
@@ -5,16 +5,11 @@
*/
namespace Magento\Elasticsearch\SearchAdapter\Query\Builder;
-use Magento\Elasticsearch\SearchAdapter\Query\ValueTransformerPool;
-use Magento\Framework\App\ObjectManager;
use Magento\Framework\Search\Request\Query\BoolExpression;
use Magento\Framework\Search\Request\QueryInterface as RequestQueryInterface;
use Magento\Elasticsearch\Model\Adapter\FieldMapperInterface;
use Magento\Framework\Search\Adapter\Preprocessor\PreprocessorInterface;
-/**
- * Builder for match query.
- */
class Match implements QueryInterface
{
/**
@@ -28,35 +23,24 @@ class Match implements QueryInterface
private $fieldMapper;
/**
- * @deprecated
- * @see \Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\TextTransformer
* @var PreprocessorInterface[]
*/
protected $preprocessorContainer;
- /**
- * @var ValueTransformerPool
- */
- private $valueTransformerPool;
-
/**
* @param FieldMapperInterface $fieldMapper
* @param PreprocessorInterface[] $preprocessorContainer
- * @param ValueTransformerPool|null $valueTransformerPool
*/
public function __construct(
FieldMapperInterface $fieldMapper,
- array $preprocessorContainer,
- ValueTransformerPool $valueTransformerPool = null
+ array $preprocessorContainer
) {
$this->fieldMapper = $fieldMapper;
$this->preprocessorContainer = $preprocessorContainer;
- $this->valueTransformerPool = $valueTransformerPool ?? ObjectManager::getInstance()
- ->get(ValueTransformerPool::class);
}
/**
- * @inheritdoc
+ * {@inheritdoc}
*/
public function build(array $selectQuery, RequestQueryInterface $requestQuery, $conditionType)
{
@@ -77,14 +61,16 @@ public function build(array $selectQuery, RequestQueryInterface $requestQuery, $
}
/**
- * Prepare query.
- *
* @param string $queryValue
* @param string $conditionType
* @return array
*/
protected function prepareQuery($queryValue, $conditionType)
{
+ $queryValue = $this->escape($queryValue);
+ foreach ($this->preprocessorContainer as $preprocessor) {
+ $queryValue = $preprocessor->process($queryValue);
+ }
$condition = $conditionType === BoolExpression::QUERY_CONDITION_NOT ?
self::QUERY_CONDITION_MUST_NOT : $conditionType;
return [
@@ -113,34 +99,21 @@ protected function buildQueries(array $matches, array $queryValue)
// Checking for quoted phrase \"phrase test\", trim escaped surrounding quotes if found
$count = 0;
- $value = preg_replace('#^"(.*)"$#m', '$1', $queryValue['value'], -1, $count);
+ $value = preg_replace('#^\\\\"(.*)\\\\"$#m', '$1', $queryValue['value'], -1, $count);
$condition = ($count) ? 'match_phrase' : 'match';
- $attributesTypes = $this->fieldMapper->getAllAttributesTypes();
- $transformedTypes = [];
foreach ($matches as $match) {
$resolvedField = $this->fieldMapper->getFieldName(
$match['field'],
['type' => FieldMapperInterface::TYPE_QUERY]
);
- $valueTransformer = $this->valueTransformerPool->get($attributesTypes[$resolvedField]['type'] ?? 'text');
- $valueTransformerHash = \spl_object_hash($valueTransformer);
- if (!isset($transformedTypes[$valueTransformerHash])) {
- $transformedTypes[$valueTransformerHash] = $valueTransformer->transform($value);
- }
- $transformedValue = $transformedTypes[$valueTransformerHash];
- if (null === $transformedValue) {
- //Value is incompatible with this field type.
- continue;
- }
-
$conditions[] = [
'condition' => $queryValue['condition'],
'body' => [
$condition => [
$resolvedField => [
- 'query' => $transformedValue,
- 'boost' => $match['boost'] ?? 1,
+ 'query' => $value,
+ 'boost' => isset($match['boost']) ? $match['boost'] : 1,
],
],
],
@@ -151,15 +124,18 @@ protected function buildQueries(array $matches, array $queryValue)
}
/**
+ * Cut trailing plus or minus sign, and @ symbol, using of which causes InnoDB to report a syntax error.
+ * @link https://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html Fulltext-boolean search docs.
+ *
* Escape a value for special query characters such as ':', '(', ')', '*', '?', etc.
*
- * @deprecated
- * @see \Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\TextTransformer
* @param string $value
* @return string
*/
protected function escape($value)
{
+ $value = preg_replace('/@+|[@+-]+$/', '', $value);
+
$pattern = '/(\+|-|&&|\|\||!|\(|\)|\{|}|\[|]|\^|"|~|\*|\?|:|\\\)/';
$replace = '\\\$1';
diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformer/DateTransformer.php b/app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformer/DateTransformer.php
deleted file mode 100644
index 49eca6e9d82a6..0000000000000
--- a/app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformer/DateTransformer.php
+++ /dev/null
@@ -1,44 +0,0 @@
-dateFieldType = $dateFieldType;
- }
-
- /**
- * @inheritdoc
- */
- public function transform(string $value): ?string
- {
- try {
- $formattedDate = $this->dateFieldType->formatDate(null, $value);
- } catch (\Exception $e) {
- $formattedDate = null;
- }
-
- return $formattedDate;
- }
-}
diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformer/FloatTransformer.php b/app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformer/FloatTransformer.php
deleted file mode 100644
index 5e330076d3df7..0000000000000
--- a/app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformer/FloatTransformer.php
+++ /dev/null
@@ -1,24 +0,0 @@
-preprocessors = $preprocessors;
- }
-
- /**
- * @inheritdoc
- */
- public function transform(string $value): string
- {
- $value = $this->escape($value);
- foreach ($this->preprocessors as $preprocessor) {
- $value = $preprocessor->process($value);
- }
-
- return $value;
- }
-
- /**
- * Escape a value for special query characters such as ':', '(', ')', '*', '?', etc.
- *
- * @param string $value
- * @return string
- */
- private function escape(string $value): string
- {
- $pattern = '/(\+|-|&&|\|\||!|\(|\)|\{|}|\[|]|\^|"|~|\*|\?|:|\\\)/';
- $replace = '\\\$1';
-
- return preg_replace($pattern, $replace, $value);
- }
-}
diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformerInterface.php b/app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformerInterface.php
deleted file mode 100644
index c84ddc69cc7a8..0000000000000
--- a/app/code/Magento/Elasticsearch/SearchAdapter/Query/ValueTransformerInterface.php
+++ /dev/null
@@ -1,22 +0,0 @@
-transformers = $valueTransformers;
- }
-
- /**
- * Get value transformer related to field type.
- *
- * @param string $fieldType
- * @return ValueTransformerInterface
- */
- public function get(string $fieldType): ValueTransformerInterface
- {
- return $this->transformers[$fieldType] ?? $this->transformers['default'];
- }
-}
diff --git a/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php b/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php
index c8aa3db39bd5e..8114feb09d35d 100644
--- a/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php
+++ b/app/code/Magento/Elasticsearch/Test/Unit/SearchAdapter/Query/Builder/MatchTest.php
@@ -7,8 +7,6 @@
use Magento\Elasticsearch\Model\Adapter\FieldMapperInterface;
use Magento\Elasticsearch\SearchAdapter\Query\Builder\Match as MatchQueryBuilder;
-use Magento\Elasticsearch\SearchAdapter\Query\ValueTransformerInterface;
-use Magento\Elasticsearch\SearchAdapter\Query\ValueTransformerPool;
use Magento\Framework\Search\Request\Query\Match as MatchRequestQuery;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
@@ -25,48 +23,46 @@ class MatchTest extends \PHPUnit\Framework\TestCase
*/
protected function setUp()
{
- $valueTransformerPoolMock = $this->createMock(ValueTransformerPool::class);
- $valueTransformerMock = $this->createMock(ValueTransformerInterface::class);
- $valueTransformerPoolMock->method('get')
- ->willReturn($valueTransformerMock);
- $valueTransformerMock->method('transform')
- ->willReturnArgument(0);
-
$this->matchQueryBuilder = (new ObjectManager($this))->getObject(
MatchQueryBuilder::class,
[
'fieldMapper' => $this->getFieldMapper(),
'preprocessorContainer' => [],
- 'valueTransformerPool' => $valueTransformerPoolMock,
]
);
}
/**
* Tests that method constructs a correct select query.
- *
* @see MatchQueryBuilder::build
+ *
+ * @dataProvider queryValuesInvariantsProvider
+ *
+ * @param string $rawQueryValue
+ * @param string $errorMessage
*/
- public function testBuild()
+ public function testBuild($rawQueryValue, $errorMessage)
{
- $rawQueryValue = 'query_value';
- $selectQuery = $this->matchQueryBuilder->build([], $this->getMatchRequestQuery($rawQueryValue), 'not');
+ $this->assertSelectQuery(
+ $this->matchQueryBuilder->build([], $this->getMatchRequestQuery($rawQueryValue), 'not'),
+ $errorMessage
+ );
+ }
- $expectedSelectQuery = [
- 'bool' => [
- 'must_not' => [
- [
- 'match' => [
- 'some_field' => [
- 'query' => $rawQueryValue,
- 'boost' => 43,
- ],
- ],
- ],
- ],
- ],
+ /**
+ * @link https://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html Fulltext-boolean search docs.
+ *
+ * @return array
+ */
+ public function queryValuesInvariantsProvider()
+ {
+ return [
+ ['query_value', 'Select query field must match simple raw query value.'],
+ ['query_value+', 'Specifying a trailing plus sign causes InnoDB to report a syntax error.'],
+ ['query_value-', 'Specifying a trailing minus sign causes InnoDB to report a syntax error.'],
+ ['query_@value', 'The @ symbol is reserved for use by the @distance proximity search operator.'],
+ ['query_value+@', 'The @ symbol is reserved for use by the @distance proximity search operator.'],
];
- $this->assertEquals($expectedSelectQuery, $selectQuery);
}
/**
@@ -115,6 +111,30 @@ public function matchProvider()
];
}
+ /**
+ * @param array $selectQuery
+ * @param string $errorMessage
+ */
+ private function assertSelectQuery($selectQuery, $errorMessage)
+ {
+ $expectedSelectQuery = [
+ 'bool' => [
+ 'must_not' => [
+ [
+ 'match' => [
+ 'some_field' => [
+ 'query' => 'query_value',
+ 'boost' => 43,
+ ],
+ ],
+ ],
+ ],
+ ],
+ ];
+
+ $this->assertEquals($expectedSelectQuery, $selectQuery, $errorMessage);
+ }
+
/**
* Gets fieldMapper mock object.
*
diff --git a/app/code/Magento/Elasticsearch/etc/di.xml b/app/code/Magento/Elasticsearch/etc/di.xml
index 05a67605ba0e6..7e219bb2f918f 100644
--- a/app/code/Magento/Elasticsearch/etc/di.xml
+++ b/app/code/Magento/Elasticsearch/etc/di.xml
@@ -421,22 +421,4 @@
-
-
-
- - Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\TextTransformer
- - Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\DateTransformer
- - Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\FloatTransformer
- - Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\IntegerTransformer
-
-
-
-
-
-
- - Magento\Elasticsearch\SearchAdapter\Query\Preprocessor\Stopwords
- - Magento\Search\Adapter\Query\Preprocessor\Synonyms
-
-
-
diff --git a/app/code/Magento/Search/Model/ResourceModel/SynonymReader.php b/app/code/Magento/Search/Model/ResourceModel/SynonymReader.php
index 45eee0a4001d1..46e794a1954cf 100644
--- a/app/code/Magento/Search/Model/ResourceModel/SynonymReader.php
+++ b/app/code/Magento/Search/Model/ResourceModel/SynonymReader.php
@@ -87,7 +87,7 @@ private function queryByPhrase($phrase)
{
$matchQuery = $this->fullTextSelect->getMatchQuery(
['synonyms' => 'synonyms'],
- $this->escapePhrase($phrase),
+ $phrase,
Fulltext::FULLTEXT_MODE_BOOLEAN
);
$query = $this->getConnection()->select()->from(
@@ -97,18 +97,6 @@ private function queryByPhrase($phrase)
return $this->getConnection()->fetchAll($query);
}
- /**
- * Cut trailing plus or minus sign, and @ symbol, using of which causes InnoDB to report a syntax error.
- *
- * @see https://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html
- * @param string $phrase
- * @return string
- */
- private function escapePhrase(string $phrase): string
- {
- return preg_replace('/@+|[@+-]+$/', '', $phrase);
- }
-
/**
* A private helper function to retrieve matching synonym groups per scope
*
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_text_attribute_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/text_attribute_rollback.php
similarity index 84%
rename from dev/tests/integration/testsuite/Magento/Catalog/_files/product_text_attribute_rollback.php
rename to dev/tests/integration/testsuite/Magento/Catalog/_files/text_attribute_rollback.php
index a9ab0e11312b2..cbc0476efd1b5 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_text_attribute_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/text_attribute_rollback.php
@@ -3,15 +3,13 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-
/* Delete attribute with text_attribute code */
-$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class);
+$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\Registry');
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', true);
-
/** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */
$attribute = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
- \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class
+ 'Magento\Catalog\Model\ResourceModel\Eav\Attribute'
);
$attribute->load('text_attribute', 'attribute_code');
$attribute->delete();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/product_export_data_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/product_export_data_rollback.php
index c57c7c3fd6a92..168073bc6ab74 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/product_export_data_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/product_export_data_rollback.php
@@ -5,10 +5,10 @@
*/
/** Delete all products */
-include dirname(dirname(__DIR__)) . '/Catalog/_files/products_with_multiselect_attribute_rollback.php';
+require dirname(dirname(__DIR__)) . '/Catalog/_files/products_with_multiselect_attribute_rollback.php';
/** Delete text attribute */
-include dirname(dirname(__DIR__)) . '/Catalog/_files/product_text_attribute_rollback.php';
+require dirname(dirname(__DIR__)) . '/Catalog/_files/text_attribute_rollback.php';
-include dirname(dirname(__DIR__)) . '/Store/_files/second_store_rollback.php';
+require dirname(dirname(__DIR__)) . '/Store/_files/second_store_rollback.php';
-include dirname(dirname(__DIR__)) . '/Catalog/_files/category_rollback.php';
+require dirname(dirname(__DIR__)) . '/Catalog/_files/category_rollback.php';
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/product_export_data_special_chars_rollback.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/product_export_data_special_chars_rollback.php
index c57c7c3fd6a92..168073bc6ab74 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/product_export_data_special_chars_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/_files/product_export_data_special_chars_rollback.php
@@ -5,10 +5,10 @@
*/
/** Delete all products */
-include dirname(dirname(__DIR__)) . '/Catalog/_files/products_with_multiselect_attribute_rollback.php';
+require dirname(dirname(__DIR__)) . '/Catalog/_files/products_with_multiselect_attribute_rollback.php';
/** Delete text attribute */
-include dirname(dirname(__DIR__)) . '/Catalog/_files/product_text_attribute_rollback.php';
+require dirname(dirname(__DIR__)) . '/Catalog/_files/text_attribute_rollback.php';
-include dirname(dirname(__DIR__)) . '/Store/_files/second_store_rollback.php';
+require dirname(dirname(__DIR__)) . '/Store/_files/second_store_rollback.php';
-include dirname(dirname(__DIR__)) . '/Catalog/_files/category_rollback.php';
+require dirname(dirname(__DIR__)) . '/Catalog/_files/category_rollback.php';
diff --git a/dev/tests/integration/testsuite/Magento/Elasticsearch/SearchAdapter/AdapterTest.php b/dev/tests/integration/testsuite/Magento/Elasticsearch/SearchAdapter/AdapterTest.php
index 8d80fd8533d6f..dc288a18fadb7 100644
--- a/dev/tests/integration/testsuite/Magento/Elasticsearch/SearchAdapter/AdapterTest.php
+++ b/dev/tests/integration/testsuite/Magento/Elasticsearch/SearchAdapter/AdapterTest.php
@@ -369,18 +369,4 @@ public function dateDataProvider()
[['from' => '2000-02-01T00:00:00Z', 'to' => ''], 0],
];
}
-
- public function filterByAttributeValuesDataProvider()
- {
- $variations = parent::filterByAttributeValuesDataProvider();
-
- $variations['quick search by date'] = [
- 'quick_search_container',
- [
- 'search_term' => '2000-10-30',
- ],
- ];
-
- return $variations;
- }
}
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes.php b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes.php
index f4f3337a253c0..b09af48b5f943 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes.php
+++ b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes.php
@@ -20,10 +20,6 @@
CategorySetup::class,
['resourceName' => 'catalog_setup']
);
-$productEntityTypeId = $installer->getEntityTypeId(
- \Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE
-);
-
$selectOptions = [];
$selectAttributes = [];
foreach (range(1, 2) as $index) {
@@ -34,7 +30,7 @@
$selectAttribute->setData(
[
'attribute_code' => 'select_attribute_' . $index,
- 'entity_type_id' => $productEntityTypeId,
+ 'entity_type_id' => $installer->getEntityTypeId('catalog_product'),
'is_global' => 1,
'is_user_defined' => 1,
'frontend_input' => 'select',
@@ -60,8 +56,7 @@
);
$selectAttribute->save();
/* Assign attribute to attribute set */
- $installer->addAttributeToGroup($productEntityTypeId, 'Default', 'General', $selectAttribute->getId());
-
+ $installer->addAttributeToGroup('catalog_product', 'Default', 'General', $selectAttribute->getId());
/** @var $selectOptions Collection */
$selectOption = Bootstrap::getObjectManager()->create(
Collection::class
@@ -70,26 +65,6 @@
$selectAttributes[$index] = $selectAttribute;
$selectOptions[$index] = $selectOption;
}
-
-$dateAttribute = Bootstrap::getObjectManager()->create(Attribute::class);
-$dateAttribute->setData(
- [
- 'attribute_code' => 'date_attribute',
- 'entity_type_id' => $productEntityTypeId,
- 'is_global' => 1,
- 'is_filterable' => 1,
- 'backend_type' => 'datetime',
- 'frontend_input' => 'date',
- 'frontend_label' => 'Test Date',
- 'is_searchable' => 1,
- 'is_filterable_in_search' => 1,
- ]
-);
-$dateAttribute->save();
-/* Assign attribute to attribute set */
-$installer->addAttributeToGroup($productEntityTypeId, 'Default', 'General', $dateAttribute->getId());
-
-$productAttributeSetId = $installer->getAttributeSetId($productEntityTypeId, 'Default');
/* Create simple products per each first attribute option */
foreach ($selectOptions[1] as $option) {
/** @var $product Product */
@@ -99,7 +74,7 @@
$product->setTypeId(
Type::TYPE_SIMPLE
)->setAttributeSetId(
- $productAttributeSetId
+ $installer->getAttributeSetId('catalog_product', 'Default')
)->setWebsiteIds(
[1]
)->setName(
@@ -117,7 +92,6 @@
)->setStockData(
['use_config_manage_stock' => 1, 'qty' => 5, 'is_in_stock' => 1]
)->save();
-
Bootstrap::getObjectManager()->get(
Action::class
)->updateAttributes(
@@ -125,7 +99,6 @@
[
$selectAttributes[1]->getAttributeCode() => $option->getId(),
$selectAttributes[2]->getAttributeCode() => $selectOptions[2]->getLastItem()->getId(),
- $dateAttribute->getAttributeCode() => '10/30/2000',
],
$product->getStoreId()
);
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes_rollback.php b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes_rollback.php
index fd413726b2637..18a5372d06d98 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Framework/Search/_files/filterable_attributes_rollback.php
@@ -13,7 +13,6 @@
$registry = Bootstrap::getObjectManager()->get(Registry::class);
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', true);
-
/** @var $productCollection \Magento\Catalog\Model\ResourceModel\Product\Collection */
$productCollection = Bootstrap::getObjectManager()
->create(Product::class)
@@ -21,26 +20,17 @@
foreach ($productCollection as $product) {
$product->delete();
}
-
/** @var $attribute Attribute */
$attribute = Bootstrap::getObjectManager()->create(
Attribute::class
);
/** @var $installer CategorySetup */
$installer = Bootstrap::getObjectManager()->create(CategorySetup::class);
-$productEntityTypeId = $installer->getEntityTypeId(
- \Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE
-);
foreach (range(1, 2) as $index) {
- $attribute->loadByCode($productEntityTypeId, 'select_attribute_' . $index);
+ $attribute->loadByCode($installer->getEntityTypeId('catalog_product'), 'select_attribute_' . $index);
if ($attribute->getId()) {
$attribute->delete();
}
}
-$attribute->loadByCode($productEntityTypeId, 'date_attribute');
-if ($attribute->getId()) {
- $attribute->delete();
-}
-
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Search/Model/SynonymReaderTest.php b/dev/tests/integration/testsuite/Magento/Search/Model/SynonymReaderTest.php
index 2d0020ba22680..b9ba89ba53144 100644
--- a/dev/tests/integration/testsuite/Magento/Search/Model/SynonymReaderTest.php
+++ b/dev/tests/integration/testsuite/Magento/Search/Model/SynonymReaderTest.php
@@ -48,22 +48,7 @@ public static function loadByPhraseDataProvider()
['synonyms' => 'queen,monarch', 'store_id' => 1, 'website_id' => 0],
['synonyms' => 'british,english', 'store_id' => 1, 'website_id' => 0]
]
- ],
- [
- 'query_value', []
- ],
- [
- 'query_value+', []
- ],
- [
- 'query_value-', []
- ],
- [
- 'query_@value', []
- ],
- [
- 'query_value+@', []
- ],
+ ]
];
}
From e7e2f96b74675b0440bf1ee8d70160acb818f520 Mon Sep 17 00:00:00 2001
From: Valerii Naida
Date: Fri, 15 Feb 2019 16:40:00 -0600
Subject: [PATCH 097/254] ENGCOM-4289: GraphQL 2.3.1 release fixes
---
.../Model/Cart/AddSimpleProductToCart.php | 11 +-
.../Cart/Address/AddressDataProvider.php | 94 -----
.../Address/BillingAddressDataProvider.php | 72 ----
.../Address/ShippingAddressesDataProvider.php | 76 ----
...Address.php => ExtractDataFromAddress.php} | 32 +-
.../Model/Cart/ExtractDataFromCart.php | 18 +
.../Model/Cart/GetCustomerAddress.php | 65 ++++
.../Model/Cart/SetBillingAddressOnCart.php | 28 +-
.../Model/Cart/SetShippingAddressOnCart.php | 29 +-
.../Model/Resolver/BillingAddress.php | 24 +-
.../Model/Resolver/CartAddresses.php | 48 ---
.../Resolver/SetShippingAddressesOnCart.php | 13 +-
.../Model/Resolver/ShippingAddresses.php | 26 +-
.../Magento/QuoteGraphQl/etc/schema.graphqls | 31 +-
.../Quote/AddSimpleProductToCartTest.php | 86 +++++
.../Magento/GraphQl/Quote/GetCartTest.php | 10 +-
.../Quote/SetBillingAddressOnCartTest.php | 244 ++++++++----
.../Quote/SetShippingAddressOnCartTest.php | 357 ++++++++++--------
.../Quote/SetShippingMethodOnCartTest.php | 252 -------------
19 files changed, 662 insertions(+), 854 deletions(-)
delete mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/Address/AddressDataProvider.php
delete mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/Address/BillingAddressDataProvider.php
delete mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/Address/ShippingAddressesDataProvider.php
rename app/code/Magento/QuoteGraphQl/Model/Cart/{Address/Mapper/Address.php => ExtractDataFromAddress.php} (64%)
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Cart/GetCustomerAddress.php
delete mode 100644 app/code/Magento/QuoteGraphQl/Model/Resolver/CartAddresses.php
create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductToCartTest.php
delete mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingMethodOnCartTest.php
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/AddSimpleProductToCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/AddSimpleProductToCart.php
index 2303d2aa14f03..1b32866ed883c 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Cart/AddSimpleProductToCart.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/AddSimpleProductToCart.php
@@ -75,7 +75,16 @@ public function execute(Quote $cart, array $cartItemData): void
throw new GraphQlNoSuchEntityException(__('Could not find a product with SKU "%sku"', ['sku' => $sku]));
}
- $result = $cart->addProduct($product, $this->createBuyRequest($qty, $customizableOptions));
+ try {
+ $result = $cart->addProduct($product, $this->createBuyRequest($qty, $customizableOptions));
+ } catch (\Exception $e) {
+ throw new GraphQlInputException(
+ __(
+ 'Could not add the product with SKU %sku to the shopping cart: %message',
+ ['sku' => $sku, 'message' => $e->getMessage()]
+ )
+ );
+ }
if (is_string($result)) {
throw new GraphQlInputException(__($result));
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/Address/AddressDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Cart/Address/AddressDataProvider.php
deleted file mode 100644
index fb742477ec99b..0000000000000
--- a/app/code/Magento/QuoteGraphQl/Model/Cart/Address/AddressDataProvider.php
+++ /dev/null
@@ -1,94 +0,0 @@
-dataObjectConverter = $dataObjectConverter;
- }
-
- /**
- * Collect and return information about shipping and billing addresses
- *
- * @param CartInterface $cart
- * @return array
- */
- public function getCartAddresses(CartInterface $cart): array
- {
- $addressData = [];
- $shippingAddress = $cart->getShippingAddress();
- $billingAddress = $cart->getBillingAddress();
-
- if ($shippingAddress) {
- $shippingData = $this->dataObjectConverter->toFlatArray($shippingAddress, [], AddressInterface::class);
- $shippingData['address_type'] = 'SHIPPING';
- $addressData[] = array_merge($shippingData, $this->extractAddressData($shippingAddress));
- }
-
- if ($billingAddress) {
- $billingData = $this->dataObjectConverter->toFlatArray($billingAddress, [], AddressInterface::class);
- $billingData['address_type'] = 'BILLING';
- $addressData[] = array_merge($billingData, $this->extractAddressData($billingAddress));
- }
-
- return $addressData;
- }
-
- /**
- * Extract the necessary address fields from address model
- *
- * @param QuoteAddress $address
- * @return array
- */
- private function extractAddressData(QuoteAddress $address): array
- {
- $addressData = [
- 'country' => [
- 'code' => $address->getCountryId(),
- 'label' => $address->getCountry()
- ],
- 'region' => [
- 'code' => $address->getRegionCode(),
- 'label' => $address->getRegion()
- ],
- 'street' => $address->getStreet(),
- 'selected_shipping_method' => [
- 'code' => $address->getShippingMethod(),
- 'label' => $address->getShippingDescription(),
- 'free_shipping' => $address->getFreeShipping(),
- ],
- 'items_weight' => $address->getWeight(),
- 'customer_notes' => $address->getCustomerNotes()
- ];
-
- return $addressData;
- }
-}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/Address/BillingAddressDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Cart/Address/BillingAddressDataProvider.php
deleted file mode 100644
index bcd781025a6d6..0000000000000
--- a/app/code/Magento/QuoteGraphQl/Model/Cart/Address/BillingAddressDataProvider.php
+++ /dev/null
@@ -1,72 +0,0 @@
-cartRepository = $cartRepository;
- $this->addressMapper = $addressMapper;
- $this->dataObjectConverter = $dataObjectConverter;
- }
-
- /**
- * Collect and return information about a billing addresses
- *
- * @param CartInterface $cart
- * @return null|array
- */
- public function getCartAddresses(CartInterface $cart): ?array
- {
- $cart = $this->cartRepository->get($cart->getId());
- $billingAddress = $cart->getBillingAddress();
-
- if (!$billingAddress) {
- return null;
- }
- $billingData = $this->dataObjectConverter->toFlatArray($billingAddress, [], AddressInterface::class);
- $addressData = array_merge($billingData, $this->addressMapper->toNestedArray($billingAddress));
-
- return $addressData;
- }
-}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/Address/ShippingAddressesDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Cart/Address/ShippingAddressesDataProvider.php
deleted file mode 100644
index eb9d760809594..0000000000000
--- a/app/code/Magento/QuoteGraphQl/Model/Cart/Address/ShippingAddressesDataProvider.php
+++ /dev/null
@@ -1,76 +0,0 @@
-dataObjectConverter = $dataObjectConverter;
- $this->cartRepository = $cartRepository;
- $this->addressMapper = $addressMapper;
- }
-
- /**
- * Collect and return information about shipping addresses
- *
- * @param CartInterface $cart
- * @return array
- */
- public function getCartAddresses(CartInterface $cart): array
- {
- $cart = $this->cartRepository->get($cart->getId());
- $addressData = [];
- $shippingAddresses = $cart->getAllShippingAddresses();
-
- if ($shippingAddresses) {
- foreach ($shippingAddresses as $shippingAddress) {
- $shippingData = $this->dataObjectConverter->toFlatArray($shippingAddress, [], AddressInterface::class);
- $addressData[] = array_merge($shippingData, $this->addressMapper->toNestedArray($shippingAddress));
- }
- }
-
- return $addressData;
- }
-}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/Address/Mapper/Address.php b/app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromAddress.php
similarity index 64%
rename from app/code/Magento/QuoteGraphQl/Model/Cart/Address/Mapper/Address.php
rename to app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromAddress.php
index 64ac407e2692a..b0e5070315d87 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Cart/Address/Mapper/Address.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromAddress.php
@@ -5,26 +5,42 @@
*/
declare(strict_types=1);
-namespace Magento\QuoteGraphQl\Model\Cart\Address\Mapper;
+namespace Magento\QuoteGraphQl\Model\Cart;
+use Magento\Framework\Api\ExtensibleDataObjectConverter;
+use Magento\Quote\Api\Data\AddressInterface;
use Magento\Quote\Model\Quote\Address as QuoteAddress;
/**
- * Class Address
- *
* Extract the necessary address fields from an Address model
*/
-class Address
+class ExtractDataFromAddress
{
/**
- * Converts Address model data to nested array
+ * @var ExtensibleDataObjectConverter
+ */
+ private $dataObjectConverter;
+
+ /**
+ * @param ExtensibleDataObjectConverter $dataObjectConverter
+ */
+ public function __construct(ExtensibleDataObjectConverter $dataObjectConverter)
+ {
+ $this->dataObjectConverter = $dataObjectConverter;
+ }
+
+ /**
+ * Converts Address model to flat array
*
* @param QuoteAddress $address
* @return array
*/
- public function toNestedArray(QuoteAddress $address): array
+ public function execute(QuoteAddress $address): array
{
- $addressData = [
+ $addressData = $this->dataObjectConverter->toFlatArray($address, [], AddressInterface::class);
+ $addressData['model'] = $address;
+
+ $addressData = array_merge($addressData, [
'country' => [
'code' => $address->getCountryId(),
'label' => $address->getCountry()
@@ -41,7 +57,7 @@ public function toNestedArray(QuoteAddress $address): array
],
'items_weight' => $address->getWeight(),
'customer_notes' => $address->getCustomerNotes()
- ];
+ ]);
if (!$address->hasItems()) {
return $addressData;
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromCart.php
index 438f28980918d..62ffdbd4b194f 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromCart.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromCart.php
@@ -7,19 +7,36 @@
namespace Magento\QuoteGraphQl\Model\Cart;
+use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Quote\Model\Quote;
use Magento\Quote\Model\Quote\Item as QuoteItem;
+use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
/**
* Extract data from cart
*/
class ExtractDataFromCart
{
+ /**
+ * @var QuoteIdToMaskedQuoteIdInterface
+ */
+ private $quoteIdToMaskedQuoteId;
+
+ /**
+ * @param QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId
+ */
+ public function __construct(
+ QuoteIdToMaskedQuoteIdInterface $quoteIdToMaskedQuoteId
+ ) {
+ $this->quoteIdToMaskedQuoteId = $quoteIdToMaskedQuoteId;
+ }
+
/**
* Extract data from cart
*
* @param Quote $cart
* @return array
+ * @throws NoSuchEntityException
*/
public function execute(Quote $cart): array
{
@@ -43,6 +60,7 @@ public function execute(Quote $cart): array
$appliedCoupon = $cart->getCouponCode();
return [
+ 'cart_id' => $this->quoteIdToMaskedQuoteId->execute((int)$cart->getId()),
'items' => $items,
'applied_coupon' => $appliedCoupon ? ['code' => $appliedCoupon] : null
];
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/GetCustomerAddress.php b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCustomerAddress.php
new file mode 100644
index 0000000000000..d3de86702b96c
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/GetCustomerAddress.php
@@ -0,0 +1,65 @@
+addressRepository = $addressRepository;
+ }
+
+ /**
+ * Get customer address. Throws exception if customer is not owner of address
+ *
+ * @param int $addressId
+ * @param int $customerId
+ * @return AddressInterface
+ * @throws GraphQlAuthorizationException
+ * @throws GraphQlNoSuchEntityException
+ * @throws LocalizedException
+ */
+ public function execute(int $addressId, int $customerId): AddressInterface
+ {
+ try {
+ $customerAddress = $this->addressRepository->getById($addressId);
+ } catch (NoSuchEntityException $e) {
+ throw new GraphQlNoSuchEntityException(
+ __('Could not find a address with ID "%address_id"', ['address_id' => $addressId])
+ );
+ }
+
+ if ((int)$customerAddress->getCustomerId() !== $customerId) {
+ throw new GraphQlAuthorizationException(
+ __(
+ 'The current user cannot use address with ID "%address_id"',
+ ['address_id' => $addressId]
+ )
+ );
+ }
+ return $customerAddress;
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php
index 97b1ed09decc4..5d3125ae13ef8 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetBillingAddressOnCart.php
@@ -7,7 +7,6 @@
namespace Magento\QuoteGraphQl\Model\Cart;
-use Magento\Customer\Api\Data\AddressInterface;
use Magento\CustomerGraphQl\Model\Customer\CheckCustomerAccount;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
@@ -26,11 +25,6 @@ class SetBillingAddressOnCart
*/
private $billingAddressManagement;
- /**
- * @var AddressRepositoryInterface
- */
- private $addressRepository;
-
/**
* @var Address
*/
@@ -41,26 +35,40 @@ class SetBillingAddressOnCart
*/
private $checkCustomerAccount;
+ /**
+ * @var GetCustomerAddress
+ */
+ private $getCustomerAddress;
+
/**
* @param BillingAddressManagementInterface $billingAddressManagement
* @param AddressRepositoryInterface $addressRepository
* @param Address $addressModel
* @param CheckCustomerAccount $checkCustomerAccount
+ * @param GetCustomerAddress $getCustomerAddress
*/
public function __construct(
BillingAddressManagementInterface $billingAddressManagement,
AddressRepositoryInterface $addressRepository,
Address $addressModel,
- CheckCustomerAccount $checkCustomerAccount
+ CheckCustomerAccount $checkCustomerAccount,
+ GetCustomerAddress $getCustomerAddress
) {
$this->billingAddressManagement = $billingAddressManagement;
$this->addressRepository = $addressRepository;
$this->addressModel = $addressModel;
$this->checkCustomerAccount = $checkCustomerAccount;
+ $this->getCustomerAddress = $getCustomerAddress;
}
/**
- * @inheritdoc
+ * Set billing address for a specified shopping cart
+ *
+ * @param ContextInterface $context
+ * @param CartInterface $cart
+ * @param array $billingAddress
+ * @return void
+ * @throws GraphQlInputException
*/
public function execute(ContextInterface $context, CartInterface $cart, array $billingAddress): void
{
@@ -88,9 +96,7 @@ public function execute(ContextInterface $context, CartInterface $cart, array $b
$billingAddress = $this->addressModel->addData($addressInput);
} else {
$this->checkCustomerAccount->execute($context->getUserId(), $context->getUserType());
-
- /** @var AddressInterface $customerAddress */
- $customerAddress = $this->addressRepository->getById($customerAddressId);
+ $customerAddress = $this->getCustomerAddress->execute((int)$customerAddressId, (int)$context->getUserId());
$billingAddress = $this->addressModel->importCustomerAddressData($customerAddress);
}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressOnCart.php
index b9fd5c7807d2f..e6b18fc88a27a 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressOnCart.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressOnCart.php
@@ -7,14 +7,12 @@
namespace Magento\QuoteGraphQl\Model\Cart;
-use Magento\Customer\Api\Data\AddressInterface;
use Magento\CustomerGraphQl\Model\Customer\CheckCustomerAccount;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
use Magento\Quote\Api\Data\CartInterface;
use Magento\Quote\Model\Quote\Address;
use Magento\Quote\Model\ShippingAddressManagementInterface;
-use Magento\Customer\Api\AddressRepositoryInterface;
/**
* Set single shipping address for a specified shopping cart
@@ -26,11 +24,6 @@ class SetShippingAddressOnCart implements SetShippingAddressesOnCartInterface
*/
private $shippingAddressManagement;
- /**
- * @var AddressRepositoryInterface
- */
- private $addressRepository;
-
/**
* @var Address
*/
@@ -41,26 +34,36 @@ class SetShippingAddressOnCart implements SetShippingAddressesOnCartInterface
*/
private $checkCustomerAccount;
+ /**
+ * @var GetCustomerAddress
+ */
+ private $getCustomerAddress;
+
/**
* @param ShippingAddressManagementInterface $shippingAddressManagement
- * @param AddressRepositoryInterface $addressRepository
* @param Address $addressModel
* @param CheckCustomerAccount $checkCustomerAccount
+ * @param GetCustomerAddress $getCustomerAddress
*/
public function __construct(
ShippingAddressManagementInterface $shippingAddressManagement,
- AddressRepositoryInterface $addressRepository,
Address $addressModel,
- CheckCustomerAccount $checkCustomerAccount
+ CheckCustomerAccount $checkCustomerAccount,
+ GetCustomerAddress $getCustomerAddress
) {
$this->shippingAddressManagement = $shippingAddressManagement;
- $this->addressRepository = $addressRepository;
$this->addressModel = $addressModel;
$this->checkCustomerAccount = $checkCustomerAccount;
+ $this->getCustomerAddress = $getCustomerAddress;
}
/**
* @inheritdoc
+ *
+ * @param ContextInterface $context
+ * @param CartInterface $cart
+ * @param array $shippingAddresses
+ * @throws GraphQlInputException
*/
public function execute(ContextInterface $context, CartInterface $cart, array $shippingAddresses): void
{
@@ -87,9 +90,7 @@ public function execute(ContextInterface $context, CartInterface $cart, array $s
$shippingAddress = $this->addressModel->addData($addressInput);
} else {
$this->checkCustomerAccount->execute($context->getUserId(), $context->getUserType());
-
- /** @var AddressInterface $customerAddress */
- $customerAddress = $this->addressRepository->getById($customerAddressId);
+ $customerAddress = $this->getCustomerAddress->execute((int)$customerAddressId, (int)$context->getUserId());
$shippingAddress = $this->addressModel->importCustomerAddressData($customerAddress);
}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/BillingAddress.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/BillingAddress.php
index 7de5a4ac05c24..a03533ecefffa 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Resolver/BillingAddress.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/BillingAddress.php
@@ -11,7 +11,7 @@
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
-use Magento\QuoteGraphQl\Model\Cart\Address\BillingAddressDataProvider;
+use Magento\QuoteGraphQl\Model\Cart\ExtractDataFromAddress;
/**
* @inheritdoc
@@ -19,17 +19,16 @@
class BillingAddress implements ResolverInterface
{
/**
- * @var BillingAddressDataProvider
+ * @var ExtractDataFromAddress
*/
- private $addressDataProvider;
+ private $extractDataFromAddress;
/**
- * @param BillingAddressDataProvider $addressDataProvider
+ * @param ExtractDataFromAddress $extractDataFromAddress
*/
- public function __construct(
- BillingAddressDataProvider $addressDataProvider
- ) {
- $this->addressDataProvider = $addressDataProvider;
+ public function __construct(ExtractDataFromAddress $extractDataFromAddress)
+ {
+ $this->extractDataFromAddress = $extractDataFromAddress;
}
/**
@@ -40,9 +39,14 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
if (!isset($value['model'])) {
throw new LocalizedException(__('"model" value should be specified'));
}
-
$cart = $value['model'];
- return $this->addressDataProvider->getCartAddresses($cart);
+ $billingAddress = $cart->getBillingAddress();
+ if (null === $billingAddress) {
+ return null;
+ }
+
+ $addressData = $this->extractDataFromAddress->execute($billingAddress);
+ return $addressData;
}
}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartAddresses.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartAddresses.php
deleted file mode 100644
index 69544672bf12e..0000000000000
--- a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartAddresses.php
+++ /dev/null
@@ -1,48 +0,0 @@
-addressDataProvider = $addressDataProvider;
- }
-
- /**
- * @inheritdoc
- */
- public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
- {
- if (!isset($value['model'])) {
- throw new LocalizedException(__('"model" value should be specified'));
- }
-
- $cart = $value['model'];
-
- return $this->addressDataProvider->getCartAddresses($cart);
- }
-}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingAddressesOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingAddressesOnCart.php
index b024e7b77af40..ec50bd6ab6ea4 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingAddressesOnCart.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingAddressesOnCart.php
@@ -12,7 +12,6 @@
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Magento\Framework\Stdlib\ArrayManager;
-use Magento\Quote\Model\MaskedQuoteIdToQuoteIdInterface;
use Magento\Quote\Model\ShippingAddressManagementInterface;
use Magento\QuoteGraphQl\Model\Cart\GetCartForUser;
use Magento\QuoteGraphQl\Model\Cart\SetShippingAddressesOnCartInterface;
@@ -24,11 +23,6 @@
*/
class SetShippingAddressesOnCart implements ResolverInterface
{
- /**
- * @var MaskedQuoteIdToQuoteIdInterface
- */
- private $maskedQuoteIdToQuoteId;
-
/**
* @var ShippingAddressManagementInterface
*/
@@ -50,20 +44,17 @@ class SetShippingAddressesOnCart implements ResolverInterface
private $setShippingAddressesOnCart;
/**
- * @param MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId
* @param ShippingAddressManagementInterface $shippingAddressManagement
* @param GetCartForUser $getCartForUser
* @param ArrayManager $arrayManager
* @param SetShippingAddressesOnCartInterface $setShippingAddressesOnCart
*/
public function __construct(
- MaskedQuoteIdToQuoteIdInterface $maskedQuoteIdToQuoteId,
ShippingAddressManagementInterface $shippingAddressManagement,
GetCartForUser $getCartForUser,
ArrayManager $arrayManager,
SetShippingAddressesOnCartInterface $setShippingAddressesOnCart
) {
- $this->maskedQuoteIdToQuoteId = $maskedQuoteIdToQuoteId;
$this->shippingAddressManagement = $shippingAddressManagement;
$this->getCartForUser = $getCartForUser;
$this->arrayManager = $arrayManager;
@@ -76,16 +67,16 @@ public function __construct(
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
{
$shippingAddresses = $this->arrayManager->get('input/shipping_addresses', $args);
- $maskedCartId = $this->arrayManager->get('input/cart_id', $args);
+ $maskedCartId = (string) $this->arrayManager->get('input/cart_id', $args);
if (!$maskedCartId) {
throw new GraphQlInputException(__('Required parameter "cart_id" is missing'));
}
+
if (!$shippingAddresses) {
throw new GraphQlInputException(__('Required parameter "shipping_addresses" is missing'));
}
- $maskedCartId = $args['input']['cart_id'];
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId());
$this->setShippingAddressesOnCart->execute($context, $cart, $shippingAddresses);
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddresses.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddresses.php
index caa0eee22d702..3a55ef9ae25a8 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddresses.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddresses.php
@@ -11,7 +11,7 @@
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
-use Magento\QuoteGraphQl\Model\Cart\Address\ShippingAddressesDataProvider;
+use Magento\QuoteGraphQl\Model\Cart\ExtractDataFromAddress;
/**
* @inheritdoc
@@ -19,17 +19,16 @@
class ShippingAddresses implements ResolverInterface
{
/**
- * @var ShippingAddressesDataProvider
+ * @var ExtractDataFromAddress
*/
- private $addressDataProvider;
+ private $extractDataFromAddress;
/**
- * @param ShippingAddressesDataProvider $addressDataProvider
+ * @param ExtractDataFromAddress $extractDataFromAddress
*/
- public function __construct(
- ShippingAddressesDataProvider $addressDataProvider
- ) {
- $this->addressDataProvider = $addressDataProvider;
+ public function __construct(ExtractDataFromAddress $extractDataFromAddress)
+ {
+ $this->extractDataFromAddress = $extractDataFromAddress;
}
/**
@@ -40,9 +39,16 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
if (!isset($value['model'])) {
throw new LocalizedException(__('"model" value should be specified'));
}
-
$cart = $value['model'];
- return $this->addressDataProvider->getCartAddresses($cart);
+ $addressesData = [];
+ $shippingAddresses = $cart->getAllShippingAddresses();
+
+ if (count($shippingAddresses)) {
+ foreach ($shippingAddresses as $shippingAddress) {
+ $addressesData[] = $this->extractDataFromAddress->execute($shippingAddress);
+ }
+ }
+ return $addressesData;
}
}
diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
index 3448d640618d4..17dd1141a0368 100644
--- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
@@ -2,7 +2,7 @@
# See COPYING.txt for license details.
type Query {
- Cart(cart_id: String!): Cart @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Cart") @doc(description:"Returns information about shopping cart")
+ cart(cart_id: String!): Cart @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Cart") @doc(description:"Returns information about shopping cart")
}
type Mutation {
@@ -64,8 +64,8 @@ input SetShippingMethodsOnCartInput {
input ShippingMethodForAddressInput {
cart_address_id: Int!
- shipping_carrier_code: String!
- shipping_method_code: String!
+ carrier_code: String!
+ method_code: String!
}
type SetBillingAddressOnCartOutput {
@@ -116,8 +116,6 @@ type CartAddress {
country: CartAddressCountry
telephone: String
address_type: AdressTypeEnum
- selected_shipping_method: CheckoutShippingMethod
- available_shipping_methods: [CheckoutShippingMethod]
items_weight: Float
customer_notes: String
cart_items: [CartItemQuantity]
@@ -138,12 +136,20 @@ type CartAddressCountry {
label: String
}
-type CheckoutShippingMethod {
- code: String
- label: String
- free_shipping: Boolean!
+type SelectedShippingMethod {
+ amount: Float!
+}
+
+type AvailableShippingMethod {
+ carrier_code: String!
+ carrier_title: String!
+ method_code: String!
+ method_title: String!
error_message: String
- # TODO: Add more complex structure for shipping rates
+ amount: Float!
+ base_amount: Float!
+ price_excl_tax: Float!
+ price_incl_tax: Float!
}
enum AdressTypeEnum {
@@ -219,8 +225,3 @@ type CartItemSelectedOptionValuePrice {
units: String!
type: PriceTypeEnum!
}
-
-input CartItemDetailsInput {
- sku: String!
- qty: Float!
-}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductToCartTest.php
new file mode 100644
index 0000000000000..4cbc614e1b8dc
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductToCartTest.php
@@ -0,0 +1,86 @@
+quoteResource = $objectManager->get(QuoteResource::class);
+ $this->quote = $objectManager->create(Quote::class);
+ $this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Catalog/_files/products.php
+ * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
+ * @expectedException \Exception
+ * @expectedExceptionMessage The requested qty is not available
+ */
+ public function testAddProductIfQuantityIsNotAvailable()
+ {
+ $sku = 'simple';
+ $qty = 200;
+
+ $this->quoteResource->load(
+ $this->quote,
+ 'test_order_1',
+ 'reserved_order_id'
+ );
+ $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+
+ $query = <<graphQlQuery($query);
+ }
+}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
index f0038351bcdcf..44cd2ef526bd5 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
@@ -68,9 +68,9 @@ public function testGetOwnCartForRegisteredCustomer()
$response = $this->sendRequestWithToken($query);
- self::assertArrayHasKey('Cart', $response);
- self::assertNotEmpty($response['Cart']['items']);
- self::assertNotEmpty($response['Cart']['shipping_addresses']);
+ self::assertArrayHasKey('cart', $response);
+ self::assertNotEmpty($response['cart']['items']);
+ self::assertNotEmpty($response['cart']['shipping_addresses']);
}
/**
@@ -110,7 +110,7 @@ public function testGetCartForGuest()
$response = $this->graphQlQuery($query);
- self::assertArrayHasKey('Cart', $response);
+ self::assertArrayHasKey('cart', $response);
}
public function testGetNonExistentCart()
@@ -134,7 +134,7 @@ private function prepareGetCartQuery(
) : string {
return <<quoteResource = $objectManager->create(QuoteResource::class);
- $this->quote = $objectManager->create(Quote::class);
- $this->quoteIdToMaskedId = $objectManager->create(QuoteIdToMaskedQuoteIdInterface::class);
+ $this->quoteResource = $objectManager->get(QuoteResource::class);
+ $this->quoteFactory = $objectManager->get(QuoteFactory::class);
+ $this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class);
+ $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
}
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
*/
- public function testSetNewGuestBillingAddressOnCart()
+ public function testSetNewBillingAddressByGuest()
{
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_with_simple_product_without_address');
$query = <<quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_with_simple_product_without_address');
$query = <<quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_with_simple_product_without_address');
$query = <<graphQlQuery($query);
}
@@ -214,23 +200,9 @@ public function testSetSavedBillingAddressOnCartByGuest()
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
* @magentoApiDataFixture Magento/Customer/_files/customer.php
*/
- public function testSetNewRegisteredCustomerBillingAddressOnCart()
+ public function testSetNewBillingAddressByRegisteredCustomer()
{
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $this->quote->setCustomerId(1);
- $this->quoteResource->save($this->quote);
-
- $headerMap = $this->getHeaderMap();
+ $maskedQuoteId = $this->assignQuoteToCustomer();
$query = <<graphQlQuery($query, [], '', $headerMap);
+ $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
self::assertArrayHasKey('cart', $response['setBillingAddressOnCart']);
$cartResponse = $response['setBillingAddressOnCart']['cart'];
@@ -281,23 +253,9 @@ public function testSetNewRegisteredCustomerBillingAddressOnCart()
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php
*/
- public function testSetSavedRegisteredCustomerBillingAddressOnCart()
+ public function testSetBillingAddressFromAddressBookByRegisteredCustomer()
{
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $this->quote->setCustomerId(1);
- $this->quoteResource->save($this->quote);
-
- $headerMap = $this->getHeaderMap();
+ $maskedQuoteId = $this->assignQuoteToCustomer();
$query = <<graphQlQuery($query, [], '', $headerMap);
+ $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
self::assertArrayHasKey('cart', $response['setBillingAddressOnCart']);
$cartResponse = $response['setBillingAddressOnCart']['cart'];
@@ -332,6 +290,115 @@ public function testSetSavedRegisteredCustomerBillingAddressOnCart()
$this->assertSavedBillingAddressFields($billingAddressResponse);
}
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @expectedException \Exception
+ * @expectedExceptionMessage Could not find a address with ID "100"
+ */
+ public function testSetNotExistedBillingAddressFromAddressBook()
+ {
+ $maskedQuoteId = $this->assignQuoteToCustomer();
+
+ $query = <<graphQlQuery($query, [], '', $this->getHeaderMap());
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php
+ */
+ public function testSetNewBillingAddressAndFromAddressBookAtSameTime()
+ {
+ $maskedQuoteId = $this->assignQuoteToCustomer();
+
+ $query = <<graphQlQuery($query, [], '', $this->getHeaderMap());
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Customer/_files/three_customers.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer_address.php
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
+ * @expectedException \Exception
+ * @expectedExceptionMessage The current user cannot use address with ID "1"
+ */
+ public function testSetBillingAddressIfCustomerIsNotOwnerOfAddress()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_with_simple_product_without_address');
+
+ $query = <<graphQlQuery($query, [], '', $this->getHeaderMap('customer2@search.example.com'));
+ }
+
/**
* Verify the all the whitelisted fields for a New Address Object
*
@@ -374,19 +441,48 @@ private function assertSavedBillingAddressFields(array $billingAddressResponse):
/**
* @param string $username
+ * @param string $password
* @return array
+ * @throws \Magento\Framework\Exception\AuthenticationException
*/
- private function getHeaderMap(string $username = 'customer@example.com'): array
+ private function getHeaderMap(string $username = 'customer@example.com', string $password = 'password'): array
{
- $password = 'password';
- /** @var CustomerTokenServiceInterface $customerTokenService */
- $customerTokenService = ObjectManager::getInstance()
- ->get(CustomerTokenServiceInterface::class);
- $customerToken = $customerTokenService->createCustomerAccessToken($username, $password);
+ $customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password);
$headerMap = ['Authorization' => 'Bearer ' . $customerToken];
return $headerMap;
}
+ /**
+ * @param string $reversedQuoteId
+ * @return string
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ private function getMaskedQuoteIdByReversedQuoteId(string $reversedQuoteId): string
+ {
+ $quote = $this->quoteFactory->create();
+ $this->quoteResource->load($quote, $reversedQuoteId, 'reserved_order_id');
+
+ return $this->quoteIdToMaskedId->execute((int)$quote->getId());
+ }
+
+ /**
+ * @param string $reversedQuoteId
+ * @param int $customerId
+ * @return string
+ * @throws \Magento\Framework\Exception\AlreadyExistsException
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ private function assignQuoteToCustomer(
+ string $reversedQuoteId = 'test_order_with_simple_product_without_address',
+ int $customerId = 1
+ ): string {
+ $quote = $this->quoteFactory->create();
+ $this->quoteResource->load($quote, $reversedQuoteId, 'reserved_order_id');
+ $quote->setCustomerId($customerId);
+ $this->quoteResource->save($quote);
+ return $this->quoteIdToMaskedId->execute((int)$quote->getId());
+ }
+
public function tearDown()
{
/** @var \Magento\Config\Model\ResourceModel\Config $config */
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php
index d60876e7c0be4..11fd37b94d535 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php
@@ -10,7 +10,7 @@
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Integration\Api\CustomerTokenServiceInterface;
use Magento\Multishipping\Helper\Data;
-use Magento\Quote\Model\Quote;
+use Magento\Quote\Model\QuoteFactory;
use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
use Magento\TestFramework\Helper\Bootstrap;
@@ -28,34 +28,35 @@ class SetShippingAddressOnCartTest extends GraphQlAbstract
private $quoteResource;
/**
- * @var Quote
+ * @var QuoteFactory
*/
- private $quote;
+ private $quoteFactory;
/**
* @var QuoteIdToMaskedQuoteIdInterface
*/
private $quoteIdToMaskedId;
+ /**
+ * @var CustomerTokenServiceInterface
+ */
+ private $customerTokenService;
+
protected function setUp()
{
$objectManager = Bootstrap::getObjectManager();
- $this->quoteResource = $objectManager->create(QuoteResource::class);
- $this->quote = $objectManager->create(Quote::class);
- $this->quoteIdToMaskedId = $objectManager->create(QuoteIdToMaskedQuoteIdInterface::class);
+ $this->quoteResource = $objectManager->get(QuoteResource::class);
+ $this->quoteFactory = $objectManager->get(QuoteFactory::class);
+ $this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class);
+ $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
}
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
*/
- public function testSetNewGuestShippingAddressOnCart()
+ public function testSetNewShippingAddressByGuest()
{
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_with_simple_product_without_address');
$query = <<quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_with_simple_product_without_address');
$query = <<graphQlQuery($query);
}
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
*/
- public function testSetMultipleShippingAddressesOnCartByGuest()
+ public function testSetNewShippingAddressByRegisteredCustomer()
{
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+ $maskedQuoteId = $this->assignQuoteToCustomer();
$query = <<get(\Magento\Config\Model\ResourceModel\Config::class);
- $config->saveConfig(
- Data::XML_PATH_CHECKOUT_MULTIPLE_AVAILABLE,
- null,
- ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
- 0
- );
- /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */
- $config = ObjectManager::getInstance()->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class);
- $config->reinit();
+ $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
- self::expectExceptionMessage('You cannot specify multiple shipping addresses.');
- $this->graphQlQuery($query);
+ self::assertArrayHasKey('cart', $response['setShippingAddressesOnCart']);
+ $cartResponse = $response['setShippingAddressesOnCart']['cart'];
+ self::assertArrayHasKey('shipping_addresses', $cartResponse);
+ $shippingAddressResponse = current($cartResponse['shipping_addresses']);
+ $this->assertNewShippingAddressFields($shippingAddressResponse);
}
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php
*/
- public function testSetSavedAndNewShippingAddressOnCartAtTheSameTime()
+ public function testSetShippingAddressFromAddressBookByRegisteredCustomer()
{
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+ $maskedQuoteId = $this->assignQuoteToCustomer();
$query = <<graphQlQuery($query);
+ $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
+
+ self::assertArrayHasKey('cart', $response['setShippingAddressesOnCart']);
+ $cartResponse = $response['setShippingAddressesOnCart']['cart'];
+ self::assertArrayHasKey('shipping_addresses', $cartResponse);
+ $shippingAddressResponse = current($cartResponse['shipping_addresses']);
+ $this->assertSavedShippingAddressFields($shippingAddressResponse);
}
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @expectedException \Exception
+ * @expectedExceptionMessage Could not find a address with ID "100"
*/
- public function testSetShippingAddressOnCartWithNoAddresses()
+ public function testSetNotExistedShippingAddressFromAddressBook()
{
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+ $maskedQuoteId = $this->assignQuoteToCustomer();
+
+ $query = <<graphQlQuery($query, [], '', $this->getHeaderMap());
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
+ * @expectedException \Exception
+ * @expectedExceptionMessage The shipping address must contain either "customer_address_id" or "address".
+ */
+ public function testSetShippingAddressWithoutAddresses()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_with_simple_product_without_address');
$query = <<graphQlQuery($query);
}
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
* @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php
*/
- public function testSetNewRegisteredCustomerShippingAddressOnCart()
+ public function testSetNewShippingAddressAndFromAddressBookAtSameTime()
{
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
+ $maskedQuoteId = $this->assignQuoteToCustomer();
+
+ $query = <<quote->setCustomerId(1);
- $this->quoteResource->save($this->quote);
+ $this->graphQlQuery($query, [], '', $this->getHeaderMap());
+ }
- $headerMap = $this->getHeaderMap();
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
+ * @expectedException \Exception
+ * @expectedExceptionMessage You cannot specify multiple shipping addresses.
+ */
+ public function testSetMultipleNewShippingAddresses()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_with_simple_product_without_address');
$query = <<graphQlQuery($query, [], '', $headerMap);
+ /** @var \Magento\Config\Model\ResourceModel\Config $config */
+ $config = ObjectManager::getInstance()->get(\Magento\Config\Model\ResourceModel\Config::class);
+ $config->saveConfig(
+ Data::XML_PATH_CHECKOUT_MULTIPLE_AVAILABLE,
+ null,
+ ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
+ 0
+ );
+ /** @var \Magento\Framework\App\Config\ReinitableConfigInterface $config */
+ $config = ObjectManager::getInstance()->get(\Magento\Framework\App\Config\ReinitableConfigInterface::class);
+ $config->reinit();
- self::assertArrayHasKey('cart', $response['setShippingAddressesOnCart']);
- $cartResponse = $response['setShippingAddressesOnCart']['cart'];
- self::assertArrayHasKey('shipping_addresses', $cartResponse);
- $shippingAddressResponse = current($cartResponse['shipping_addresses']);
- $this->assertNewShippingAddressFields($shippingAddressResponse);
+ $this->graphQlQuery($query);
}
/**
+ * @magentoApiDataFixture Magento/Customer/_files/three_customers.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer_address.php
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_simple_product_saved.php
- * @magentoApiDataFixture Magento/Customer/_files/customer.php
- * @magentoApiDataFixture Magento/Customer/_files/customer_two_addresses.php
+ * @expectedException \Exception
+ * @expectedExceptionMessage The current user cannot use address with ID "1"
*/
- public function testSetSavedRegisteredCustomerShippingAddressOnCart()
+ public function testSetShippingAddressIfCustomerIsNotOwnerOfAddress()
{
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
- $this->quoteResource->load(
- $this->quote,
- 'test_order_with_simple_product_without_address',
- 'reserved_order_id'
- );
- $this->quote->setCustomerId(1);
- $this->quoteResource->save($this->quote);
-
- $headerMap = $this->getHeaderMap();
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_with_simple_product_without_address');
$query = <<graphQlQuery($query, [], '', $headerMap);
- self::assertArrayHasKey('cart', $response['setShippingAddressesOnCart']);
- $cartResponse = $response['setShippingAddressesOnCart']['cart'];
- self::assertArrayHasKey('shipping_addresses', $cartResponse);
- $shippingAddressResponse = current($cartResponse['shipping_addresses']);
- $this->assertSavedShippingAddressFields($shippingAddressResponse);
+ $this->graphQlQuery($query, [], '', $this->getHeaderMap('customer2@search.example.com'));
}
/**
@@ -468,19 +490,48 @@ private function assertSavedShippingAddressFields(array $shippingAddressResponse
/**
* @param string $username
+ * @param string $password
* @return array
+ * @throws \Magento\Framework\Exception\AuthenticationException
*/
- private function getHeaderMap(string $username = 'customer@example.com'): array
+ private function getHeaderMap(string $username = 'customer@example.com', string $password = 'password'): array
{
- $password = 'password';
- /** @var CustomerTokenServiceInterface $customerTokenService */
- $customerTokenService = ObjectManager::getInstance()
- ->get(CustomerTokenServiceInterface::class);
- $customerToken = $customerTokenService->createCustomerAccessToken($username, $password);
+ $customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password);
$headerMap = ['Authorization' => 'Bearer ' . $customerToken];
return $headerMap;
}
+ /**
+ * @param string $reversedQuoteId
+ * @return string
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ private function getMaskedQuoteIdByReversedQuoteId(string $reversedQuoteId): string
+ {
+ $quote = $this->quoteFactory->create();
+ $this->quoteResource->load($quote, $reversedQuoteId, 'reserved_order_id');
+
+ return $this->quoteIdToMaskedId->execute((int)$quote->getId());
+ }
+
+ /**
+ * @param string $reversedQuoteId
+ * @param int $customerId
+ * @return string
+ * @throws \Magento\Framework\Exception\AlreadyExistsException
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ private function assignQuoteToCustomer(
+ string $reversedQuoteId = 'test_order_with_simple_product_without_address',
+ int $customerId = 1
+ ): string {
+ $quote = $this->quoteFactory->create();
+ $this->quoteResource->load($quote, $reversedQuoteId, 'reserved_order_id');
+ $quote->setCustomerId($customerId);
+ $this->quoteResource->save($quote);
+ return $this->quoteIdToMaskedId->execute((int)$quote->getId());
+ }
+
public function tearDown()
{
/** @var \Magento\Config\Model\ResourceModel\Config $config */
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingMethodOnCartTest.php
deleted file mode 100644
index 1c6679ee30f29..0000000000000
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingMethodOnCartTest.php
+++ /dev/null
@@ -1,252 +0,0 @@
-quoteResource = $objectManager->create(QuoteResource::class);
- $this->quote = $objectManager->create(Quote::class);
- $this->quoteIdToMaskedId = $objectManager->create(QuoteIdToMaskedQuoteIdInterface::class);
- $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
- }
-
- /**
- * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
- */
- public function testSetShippingMethodOnCart()
- {
- $shippingCarrierCode = 'flatrate';
- $shippingMethodCode = 'flatrate';
- $this->quoteResource->load(
- $this->quote,
- 'test_order_1',
- 'reserved_order_id'
- );
- $shippingAddress = $this->quote->getShippingAddress();
- $shippingAddressId = $shippingAddress->getId();
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
-
- $query = $this->prepareMutationQuery(
- $maskedQuoteId,
- $shippingMethodCode,
- $shippingCarrierCode,
- $shippingAddressId
- );
-
- $response = $this->sendRequestWithToken($query);
-
- self::assertArrayHasKey('setShippingMethodsOnCart', $response);
- self::assertArrayHasKey('cart', $response['setShippingMethodsOnCart']);
- self::assertEquals($maskedQuoteId, $response['setShippingMethodsOnCart']['cart']['cart_id']);
- $addressesInformation = $response['setShippingMethodsOnCart']['cart']['shipping_addresses'];
- self::assertCount(1, $addressesInformation);
- self::assertEquals(
- $addressesInformation[0]['selected_shipping_method']['code'],
- $shippingCarrierCode . '_' . $shippingMethodCode
- );
- }
-
- /**
- * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
- */
- public function testSetShippingMethodWithWrongCartId()
- {
- $shippingCarrierCode = 'flatrate';
- $shippingMethodCode = 'flatrate';
- $shippingAddressId = '1';
- $maskedQuoteId = 'invalid';
-
- $query = $this->prepareMutationQuery(
- $maskedQuoteId,
- $shippingMethodCode,
- $shippingCarrierCode,
- $shippingAddressId
- );
-
- self::expectExceptionMessage("Could not find a cart with ID \"$maskedQuoteId\"");
- $this->sendRequestWithToken($query);
- }
-
- /**
- * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
- */
- public function testSetNonExistingShippingMethod()
- {
- $shippingCarrierCode = 'non';
- $shippingMethodCode = 'existing';
- $this->quoteResource->load(
- $this->quote,
- 'test_order_1',
- 'reserved_order_id'
- );
- $shippingAddress = $this->quote->getShippingAddress();
- $shippingAddressId = $shippingAddress->getId();
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
-
- $query = $this->prepareMutationQuery(
- $maskedQuoteId,
- $shippingMethodCode,
- $shippingCarrierCode,
- $shippingAddressId
- );
-
- self::expectExceptionMessage("Carrier with such method not found: $shippingCarrierCode, $shippingMethodCode");
- $this->sendRequestWithToken($query);
- }
-
- /**
- * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
- */
- public function testSetShippingMethodWithNonExistingAddress()
- {
- $shippingCarrierCode = 'flatrate';
- $shippingMethodCode = 'flatrate';
- $this->quoteResource->load(
- $this->quote,
- 'test_order_1',
- 'reserved_order_id'
- );
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
- $shippingAddressId = '-20';
-
- $query = $this->prepareMutationQuery(
- $maskedQuoteId,
- $shippingMethodCode,
- $shippingCarrierCode,
- $shippingAddressId
- );
-
- self::expectExceptionMessage('The shipping address is missing. Set the address and try again.');
- $this->sendRequestWithToken($query);
- }
-
- /**
- * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
- */
- public function testSetShippingMethodByGuestToCustomerCart()
- {
- $shippingCarrierCode = 'flatrate';
- $shippingMethodCode = 'flatrate';
- $this->quoteResource->load(
- $this->quote,
- 'test_order_1',
- 'reserved_order_id'
- );
- $shippingAddress = $this->quote->getShippingAddress();
- $shippingAddressId = $shippingAddress->getId();
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
-
- $query = $this->prepareMutationQuery(
- $maskedQuoteId,
- $shippingMethodCode,
- $shippingCarrierCode,
- $shippingAddressId
- );
-
- self::expectExceptionMessage(
- "The current user cannot perform operations on cart \"$maskedQuoteId\""
- );
-
- $this->graphQlQuery($query);
- }
-
- /**
- * Generates query for setting the specified shipping method on cart
- *
- * @param string $maskedQuoteId
- * @param string $shippingMethodCode
- * @param string $shippingCarrierCode
- * @param string $shippingAddressId
- * @return string
- */
- private function prepareMutationQuery(
- string $maskedQuoteId,
- string $shippingMethodCode,
- string $shippingCarrierCode,
- string $shippingAddressId
- ) : string {
- return <<customerTokenService->createCustomerAccessToken('customer@example.com', 'password');
- $headerMap = ['Authorization' => 'Bearer ' . $customerToken];
-
- return $this->graphQlQuery($query, [], '', $headerMap);
- }
-}
From 6478f84571442e0509de48b8599b52a6efcb3fa7 Mon Sep 17 00:00:00 2001
From: Valerii Naida
Date: Fri, 15 Feb 2019 18:49:26 -0600
Subject: [PATCH 098/254] ENGCOM-4289: GraphQL 2.3.1 release fixes
---
app/code/Magento/QuoteGraphQl/etc/schema.graphqls | 5 +++++
.../Magento/GraphQl/Quote/SetBillingAddressOnCartTest.php | 4 ----
.../Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php | 4 ----
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
index 17dd1141a0368..a76f7d59c3f77 100644
--- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
@@ -225,3 +225,8 @@ type CartItemSelectedOptionValuePrice {
units: String!
type: PriceTypeEnum!
}
+
+input CartItemDetailsInput {
+ sku: String!
+ qty: Float!
+}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetBillingAddressOnCartTest.php
index 74f53d4241496..bfe57109d107d 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetBillingAddressOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetBillingAddressOnCartTest.php
@@ -443,7 +443,6 @@ private function assertSavedBillingAddressFields(array $billingAddressResponse):
* @param string $username
* @param string $password
* @return array
- * @throws \Magento\Framework\Exception\AuthenticationException
*/
private function getHeaderMap(string $username = 'customer@example.com', string $password = 'password'): array
{
@@ -455,7 +454,6 @@ private function getHeaderMap(string $username = 'customer@example.com', string
/**
* @param string $reversedQuoteId
* @return string
- * @throws \Magento\Framework\Exception\NoSuchEntityException
*/
private function getMaskedQuoteIdByReversedQuoteId(string $reversedQuoteId): string
{
@@ -469,8 +467,6 @@ private function getMaskedQuoteIdByReversedQuoteId(string $reversedQuoteId): str
* @param string $reversedQuoteId
* @param int $customerId
* @return string
- * @throws \Magento\Framework\Exception\AlreadyExistsException
- * @throws \Magento\Framework\Exception\NoSuchEntityException
*/
private function assignQuoteToCustomer(
string $reversedQuoteId = 'test_order_with_simple_product_without_address',
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php
index 11fd37b94d535..c3685c88ae487 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetShippingAddressOnCartTest.php
@@ -492,7 +492,6 @@ private function assertSavedShippingAddressFields(array $shippingAddressResponse
* @param string $username
* @param string $password
* @return array
- * @throws \Magento\Framework\Exception\AuthenticationException
*/
private function getHeaderMap(string $username = 'customer@example.com', string $password = 'password'): array
{
@@ -504,7 +503,6 @@ private function getHeaderMap(string $username = 'customer@example.com', string
/**
* @param string $reversedQuoteId
* @return string
- * @throws \Magento\Framework\Exception\NoSuchEntityException
*/
private function getMaskedQuoteIdByReversedQuoteId(string $reversedQuoteId): string
{
@@ -518,8 +516,6 @@ private function getMaskedQuoteIdByReversedQuoteId(string $reversedQuoteId): str
* @param string $reversedQuoteId
* @param int $customerId
* @return string
- * @throws \Magento\Framework\Exception\AlreadyExistsException
- * @throws \Magento\Framework\Exception\NoSuchEntityException
*/
private function assignQuoteToCustomer(
string $reversedQuoteId = 'test_order_with_simple_product_without_address',
From f665ccaca268aab903bf37787fb0ccde1bae91c7 Mon Sep 17 00:00:00 2001
From: Serhiy Yelahin
Date: Mon, 18 Feb 2019 10:45:50 +0200
Subject: [PATCH 099/254] MAGETWO-98013: [2.3] Configurable product is
displayed as In Stock in product grid when it's set to out of stock
---
app/code/Magento/Catalog/etc/adminhtml/di.xml | 1 -
.../AddIsInStockFieldToCollection.php} | 6 +-
.../CatalogInventory/etc/adminhtml/di.xml | 1 +
.../Product/QuantityAndStockStatusTest.php | 74 ++++---------------
...nd_stock_status_attribute_used_in_grid.php | 18 +++++
...status_attribute_used_in_grid_rollback.php | 18 +++++
6 files changed, 56 insertions(+), 62 deletions(-)
rename app/code/Magento/{Catalog/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php => CatalogInventory/Ui/DataProvider/Product/AddIsInStockFieldToCollection.php} (75%)
create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/quantity_and_stock_status_attribute_used_in_grid.php
create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/quantity_and_stock_status_attribute_used_in_grid_rollback.php
diff --git a/app/code/Magento/Catalog/etc/adminhtml/di.xml b/app/code/Magento/Catalog/etc/adminhtml/di.xml
index c2028b921efb8..c04cfb2dce00a 100644
--- a/app/code/Magento/Catalog/etc/adminhtml/di.xml
+++ b/app/code/Magento/Catalog/etc/adminhtml/di.xml
@@ -87,7 +87,6 @@
- Magento\Catalog\Ui\DataProvider\Product\AddWebsitesFieldToCollection
- - Magento\Catalog\Ui\DataProvider\Product\AddQuantityAndStockStatusFieldToCollection
- Magento\Catalog\Ui\DataProvider\Product\AddStoreFieldToCollection
diff --git a/app/code/Magento/Catalog/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php b/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddIsInStockFieldToCollection.php
similarity index 75%
rename from app/code/Magento/Catalog/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php
rename to app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddIsInStockFieldToCollection.php
index cafe175a27e13..5be5409c90033 100644
--- a/app/code/Magento/Catalog/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php
+++ b/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddIsInStockFieldToCollection.php
@@ -5,15 +5,15 @@
*/
declare(strict_types=1);
-namespace Magento\Catalog\Ui\DataProvider\Product;
+namespace Magento\CatalogInventory\Ui\DataProvider\Product;
use Magento\Framework\Data\Collection;
use Magento\Ui\DataProvider\AddFieldToCollectionInterface;
/**
- * Class AddQuantityAndStockStatusFieldToCollection
+ * Add is_in_stock field to collection
*/
-class AddQuantityAndStockStatusFieldToCollection implements AddFieldToCollectionInterface
+class AddIsInStockFieldToCollection implements AddFieldToCollectionInterface
{
/**
* @inheritdoc
diff --git a/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml b/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml
index 3397ef25918cd..c2acd1ce1f945 100644
--- a/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml
+++ b/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml
@@ -23,6 +23,7 @@
- Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityFieldToCollection
+ - Magento\CatalogInventory\Ui\DataProvider\Product\AddIsInStockFieldToCollection
- Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityFilterToCollection
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
index 150c3f64e6c1c..98c5bbbd43d75 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
@@ -7,16 +7,13 @@
namespace Magento\Catalog\Ui\DataProvider\Product;
-use Magento\Eav\Setup\EavSetup;
+use Magento\CatalogInventory\Model\Stock\StockItemRepository;
+use Magento\CatalogInventory\Ui\DataProvider\Product\AddIsInStockFieldToCollection;
use PHPUnit\Framework\TestCase;
use Magento\TestFramework\Helper\Bootstrap;
-use Magento\Catalog\Model\Product;
-use Magento\CatalogInventory\Model\Stock\StockItemRepository;
-use Magento\CatalogInventory\Api\StockItemCriteriaInterface;
-use Magento\Catalog\Api\Data\EavAttributeInterface;
/**
- * Class QuantityAndStockStatusTest
+ * Quantity and stock status test
*/
class QuantityAndStockStatusTest extends TestCase
{
@@ -30,53 +27,33 @@ class QuantityAndStockStatusTest extends TestCase
*/
private $objectManager;
- /**
- * @var int
- */
- private $isUsedInGridValue;
-
/**
* @inheritdoc
*/
protected function setUp()
{
$this->objectManager = Bootstrap::getObjectManager();
- $eavSetup = $this->objectManager->create(EavSetup::class);
- $this->isUsedInGridValue = $eavSetup->getAttribute(
- Product::ENTITY,
- self::$quantityAndStockStatus,
- EavAttributeInterface::IS_USED_IN_GRID
- );
- $eavSetup->addAttribute(
- Product::ENTITY,
- self::$quantityAndStockStatus,
- [
- EavAttributeInterface::IS_USED_IN_GRID => 1,
- ]
- );
}
/**
* Test product stock status in the products grid column
*
+ * @magentoDataFixture Magento/Catalog/_files/quantity_and_stock_status_attribute_used_in_grid.php
* @magentoDataFixture Magento/Checkout/_files/simple_product.php
*/
public function testProductStockStatus()
{
- $stockItemRepository = $this->objectManager->create(StockItemRepository::class);
-
- /** @var StockItemCriteriaInterface $stockItemCriteria */
- $stockItemCriteria = $this->objectManager->create(StockItemCriteriaInterface::class);
-
- $savedStockItem = current($stockItemRepository->getList($stockItemCriteria)
- ->getItems());
- $savedStockItemId = $savedStockItem->getItemId();
+ $productId = 1;
- $savedStockItem->setIsInStock(true);
- $savedStockItem->save();
+ /** @var StockItemRepository $stockItemRepository */
+ $stockItemRepository = $this->objectManager
+ ->create(StockItemRepository::class);
+ $stockItem = $stockItemRepository->get($productId);
+ $stockItem->setIsInStock(false);
+ $stockItemRepository->save($stockItem);
- $savedStockItem->setIsInStock(false);
- $savedStockItem->save();
+ $savedStockItem = $stockItemRepository->get($productId);
+ $savedStockStatus = $savedStockItem->getData('is_in_stock');
$dataProvider = $this->objectManager->create(
ProductDataProvider::class,
@@ -86,34 +63,15 @@ public function testProductStockStatus()
'requestFieldName' => 'id',
'addFieldStrategies' => [
'quantity_and_stock_status' =>
- $this->objectManager->get(AddQuantityAndStockStatusFieldToCollection::class)
+ $this->objectManager->get(AddIsInStockFieldToCollection::class)
]
]
);
$dataProvider->addField(self::$quantityAndStockStatus);
$data = $dataProvider->getData();
+ $dataProviderStockStatus = $data['items'][0][self::$quantityAndStockStatus];
- $this->assertEquals(
- $data['items'][0][self::$quantityAndStockStatus],
- $savedStockItem->load($savedStockItemId)
- ->getData('is_in_stock')
- );
- }
-
- /**
- * @inheritdoc
- */
- protected function tearDown()
- {
- $eavSetup = $this->objectManager->create(EavSetup::class);
- $eavSetup->addAttribute(
- Product::ENTITY,
- self::$quantityAndStockStatus,
- [
- EavAttributeInterface::IS_USED_IN_GRID => $this->isUsedInGridValue,
- ]
- );
- parent::tearDown();
+ $this->assertEquals($dataProviderStockStatus, $savedStockStatus);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/quantity_and_stock_status_attribute_used_in_grid.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/quantity_and_stock_status_attribute_used_in_grid.php
new file mode 100644
index 0000000000000..1870eaba566d8
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/quantity_and_stock_status_attribute_used_in_grid.php
@@ -0,0 +1,18 @@
+create(\Magento\Eav\Setup\EavSetupFactory::class);
+/** @var \Magento\Eav\Setup\EavSetup $eavSetup */
+$eavSetup = $eavSetupFactory->create();
+$eavSetup->updateAttribute(
+ \Magento\Catalog\Model\Product::ENTITY,
+ 'quantity_and_stock_status',
+ [
+ 'is_used_in_grid' => 1,
+ ]
+);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/quantity_and_stock_status_attribute_used_in_grid_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/quantity_and_stock_status_attribute_used_in_grid_rollback.php
new file mode 100644
index 0000000000000..fba12f19fdca8
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/quantity_and_stock_status_attribute_used_in_grid_rollback.php
@@ -0,0 +1,18 @@
+create(\Magento\Eav\Setup\EavSetupFactory::class);
+/** @var \Magento\Eav\Setup\EavSetup $eavSetup */
+$eavSetup = $eavSetupFactory->create();
+$eavSetup->updateAttribute(
+ \Magento\Catalog\Model\Product::ENTITY,
+ 'quantity_and_stock_status',
+ [
+ 'is_used_in_grid' => 0,
+ ]
+);
From 8d209466411884902a7f5d7804a1e55703f25462 Mon Sep 17 00:00:00 2001
From: Serhiy Yelahin
Date: Mon, 18 Feb 2019 13:52:39 +0200
Subject: [PATCH 100/254] MAGETWO-98013: [2.3] Configurable product is
displayed as In Stock in product grid when it's set to out of stock
---
.../Product/QuantityAndStockStatusTest.php | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
index 98c5bbbd43d75..7f70b99cc002b 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
@@ -7,6 +7,7 @@
namespace Magento\Catalog\Ui\DataProvider\Product;
+use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\CatalogInventory\Model\Stock\StockItemRepository;
use Magento\CatalogInventory\Ui\DataProvider\Product\AddIsInStockFieldToCollection;
use PHPUnit\Framework\TestCase;
@@ -39,19 +40,21 @@ protected function setUp()
* Test product stock status in the products grid column
*
* @magentoDataFixture Magento/Catalog/_files/quantity_and_stock_status_attribute_used_in_grid.php
- * @magentoDataFixture Magento/Checkout/_files/simple_product.php
+ * @magentoDataFixture Magento/Catalog/_files/products.php
*/
public function testProductStockStatus()
{
- $productId = 1;
+ /** @var ProductRepositoryInterface $productRepository */
+ $productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
+ $product = $productRepository->get('simple');
+ $productId = $product->getId();
/** @var StockItemRepository $stockItemRepository */
- $stockItemRepository = $this->objectManager
- ->create(StockItemRepository::class);
+ $stockItemRepository = $this->objectManager->create(StockItemRepository::class);
+
$stockItem = $stockItemRepository->get($productId);
$stockItem->setIsInStock(false);
$stockItemRepository->save($stockItem);
-
$savedStockItem = $stockItemRepository->get($productId);
$savedStockStatus = $savedStockItem->getData('is_in_stock');
From 96793feaf7d4e8b3524ae859cae55fec880e41ff Mon Sep 17 00:00:00 2001
From: Wojtek Naruniec
Date: Mon, 18 Feb 2019 13:16:20 +0100
Subject: [PATCH 101/254] Skip cart validation if empty cart action is executed
---
.../view/frontend/web/js/action/update-shopping-cart.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/action/update-shopping-cart.js b/app/code/Magento/Checkout/view/frontend/web/js/action/update-shopping-cart.js
index ce1527b3d72d6..9d79e34b10f17 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/action/update-shopping-cart.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/action/update-shopping-cart.js
@@ -35,6 +35,11 @@ define([
return true;
}
+ var action = this.element.find('#update_cart_action_container').val();
+ if (action === 'empty_cart') {
+ return true;
+ }
+
if (this.isValid()) {
event.preventDefault();
this.validateItems(this.options.validationURL, this.element.serialize());
From 9d4f13cc80d711fd9ac279f18cc6aa5b3576b178 Mon Sep 17 00:00:00 2001
From: Pratik Oza
Date: Mon, 18 Feb 2019 18:27:14 +0530
Subject: [PATCH 102/254] Fixed pagination drop-down size
---
.../backend/web/css/source/actions/_actions-dropdown.less | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-dropdown.less b/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-dropdown.less
index cd089232412dc..d1fe33c4fe77d 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-dropdown.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/actions/_actions-dropdown.less
@@ -234,6 +234,7 @@
border: 0;
display: inline;
margin: 0;
+ width: 6rem;
body._keyfocus &:focus {
box-shadow: none;
From 1845bcf1710ec364f7da2215c80ee91abf2eb1d6 Mon Sep 17 00:00:00 2001
From: Serhiy Yelahin
Date: Mon, 18 Feb 2019 16:29:22 +0200
Subject: [PATCH 103/254] MAGETWO-98013: [2.3] Configurable product is
displayed as In Stock in product grid when it's set to out of stock
---
...antityAndStockStatusFieldToCollection.php} | 4 ++--
.../CatalogInventory/etc/adminhtml/di.xml | 2 +-
.../Product/QuantityAndStockStatusTest.php | 19 +++++++++----------
3 files changed, 12 insertions(+), 13 deletions(-)
rename app/code/Magento/CatalogInventory/Ui/DataProvider/Product/{AddIsInStockFieldToCollection.php => AddQuantityAndStockStatusFieldToCollection.php} (82%)
diff --git a/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddIsInStockFieldToCollection.php b/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php
similarity index 82%
rename from app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddIsInStockFieldToCollection.php
rename to app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php
index 5be5409c90033..d66a783c6720d 100644
--- a/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddIsInStockFieldToCollection.php
+++ b/app/code/Magento/CatalogInventory/Ui/DataProvider/Product/AddQuantityAndStockStatusFieldToCollection.php
@@ -11,9 +11,9 @@
use Magento\Ui\DataProvider\AddFieldToCollectionInterface;
/**
- * Add is_in_stock field to collection
+ * Add quantity_and_stock_status field to collection
*/
-class AddIsInStockFieldToCollection implements AddFieldToCollectionInterface
+class AddQuantityAndStockStatusFieldToCollection implements AddFieldToCollectionInterface
{
/**
* @inheritdoc
diff --git a/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml b/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml
index c2acd1ce1f945..28035de29bc2e 100644
--- a/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml
+++ b/app/code/Magento/CatalogInventory/etc/adminhtml/di.xml
@@ -23,7 +23,7 @@
- Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityFieldToCollection
- - Magento\CatalogInventory\Ui\DataProvider\Product\AddIsInStockFieldToCollection
+ - Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityAndStockStatusFieldToCollection
- Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityFilterToCollection
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
index 7f70b99cc002b..c09d68a66ee8e 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/Ui/DataProvider/Product/QuantityAndStockStatusTest.php
@@ -9,9 +9,11 @@
use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\CatalogInventory\Model\Stock\StockItemRepository;
-use Magento\CatalogInventory\Ui\DataProvider\Product\AddIsInStockFieldToCollection;
+use Magento\CatalogInventory\Ui\DataProvider\Product\AddQuantityAndStockStatusFieldToCollection;
use PHPUnit\Framework\TestCase;
use Magento\TestFramework\Helper\Bootstrap;
+use Magento\CatalogInventory\Api\StockItemCriteriaInterface;
+use Magento\CatalogInventory\Api\StockRegistryInterface;
/**
* Quantity and stock status test
@@ -44,19 +46,16 @@ protected function setUp()
*/
public function testProductStockStatus()
{
- /** @var ProductRepositoryInterface $productRepository */
- $productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
- $product = $productRepository->get('simple');
- $productId = $product->getId();
-
/** @var StockItemRepository $stockItemRepository */
$stockItemRepository = $this->objectManager->create(StockItemRepository::class);
- $stockItem = $stockItemRepository->get($productId);
+ /** @var StockRegistryInterface $stockRegistry */
+ $stockRegistry = $this->objectManager->create(StockRegistryInterface::class);
+
+ $stockItem = $stockRegistry->getStockItemBySku('simple');
$stockItem->setIsInStock(false);
$stockItemRepository->save($stockItem);
- $savedStockItem = $stockItemRepository->get($productId);
- $savedStockStatus = $savedStockItem->getData('is_in_stock');
+ $savedStockStatus = (int)$stockItem->getIsInStock();
$dataProvider = $this->objectManager->create(
ProductDataProvider::class,
@@ -66,7 +65,7 @@ public function testProductStockStatus()
'requestFieldName' => 'id',
'addFieldStrategies' => [
'quantity_and_stock_status' =>
- $this->objectManager->get(AddIsInStockFieldToCollection::class)
+ $this->objectManager->get(AddQuantityAndStockStatusFieldToCollection::class)
]
]
);
From 27fb560b4cb1198fe01453e359cf839c0300c771 Mon Sep 17 00:00:00 2001
From: Ilan Parmentier
Date: Mon, 18 Feb 2019 15:37:52 +0100
Subject: [PATCH 104/254] Misconfigured aria-labelledby for product tabs
Good afternoon,
I find out attribute aria-labelledby is misconfigured.
It must be declared for the content of the tab and not the title, in particular, for a parent tag.
Ilan PARMENTIER
Source :
https://www.w3.org/TR/wai-aria-practices/examples/tabs/tabs-1/tabs.html#sc1_label
---
.../view/frontend/templates/product/view/details.phtml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml
index af664051b1431..39603a5223406 100644
--- a/app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml
+++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml
@@ -22,7 +22,6 @@
$label = $block->getChildData($alias, 'title');
?>
-
+
= /* @escapeNotVerified */ $html ?>
From 009af396d851db41b6a9678c0942c71e103e9b76 Mon Sep 17 00:00:00 2001
From: Serhiy Yelahin
Date: Tue, 19 Feb 2019 10:53:45 +0200
Subject: [PATCH 105/254] MAGETWO-97968: Minicart isn't updated for disabled
products
---
app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js b/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
index 27d38697afe39..81659e23c463b 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
@@ -8,5 +8,8 @@ define([
], function (customerData) {
'use strict';
- customerData.reload(['cart'], false);
+ var cartData = customerData.get('cart');
+ if (cartData()['items'] && cartData()['items'].length !== 0) {
+ customerData.reload(['cart'], false);
+ }
});
From ae27fa1c757969902f605cb75b76be9206bee12e Mon Sep 17 00:00:00 2001
From: Serhiy Yelahin
Date: Tue, 19 Feb 2019 12:17:26 +0200
Subject: [PATCH 106/254] MAGETWO-97968: Minicart isn't updated for disabled
products
---
.../Test/StorefrontGuestCheckoutDisabledProductTest.xml | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml
index 29715d073d01b..4ec608a18a686 100644
--- a/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml
+++ b/app/code/Magento/Quote/Test/Mftf/Test/StorefrontGuestCheckoutDisabledProductTest.xml
@@ -75,8 +75,6 @@
-
-
@@ -84,6 +82,8 @@
+
+
@@ -108,8 +108,7 @@
-
-
+
From b179e544a9c05eb0d5347028d4095755d019e304 Mon Sep 17 00:00:00 2001
From: Milind Singh
Date: Tue, 19 Feb 2019 15:53:22 +0530
Subject: [PATCH 107/254] Issue Fixed #21322 : Declarative schema: Omitting
indexType throws exception
---
.../Framework/Setup/Declaration/Schema/Dto/Factories/Index.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Index.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Index.php
index 715f98c4177c0..211d3885297ba 100644
--- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Index.php
+++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Index.php
@@ -19,7 +19,7 @@ class Index implements FactoryInterface
/**
* Default index type.
*/
- const DEFAULT_INDEX_TYPE = "BTREE";
+ const DEFAULT_INDEX_TYPE = "btree";
/**
* @var ObjectManagerInterface
From a19d50c9fd8f00156cca4936472b98df70ddc1a9 Mon Sep 17 00:00:00 2001
From: Daniel Ruf
Date: Tue, 19 Feb 2019 11:53:23 +0100
Subject: [PATCH 108/254] Change comment to "database"
---
setup/src/Magento/Setup/Validator/DbValidator.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/setup/src/Magento/Setup/Validator/DbValidator.php b/setup/src/Magento/Setup/Validator/DbValidator.php
index 1eae39160ff8e..95a1fef395b13 100644
--- a/setup/src/Magento/Setup/Validator/DbValidator.php
+++ b/setup/src/Magento/Setup/Validator/DbValidator.php
@@ -166,7 +166,7 @@ private function checkDatabasePrivileges(\Magento\Framework\DB\Adapter\AdapterIn
return true;
}
- // check table privileges
+ // check database privileges
$schemaPrivilegesQuery = "SELECT PRIVILEGE_TYPE FROM SCHEMA_PRIVILEGES " .
"WHERE '$dbName' LIKE TABLE_SCHEMA AND REPLACE(GRANTEE, '\'', '') = current_user()";
$grantInfo = $connection->query($schemaPrivilegesQuery)->fetchAll(\PDO::FETCH_NUM);
@@ -175,7 +175,7 @@ private function checkDatabasePrivileges(\Magento\Framework\DB\Adapter\AdapterIn
}
$errorMessage = 'Database user does not have enough privileges. Please make sure '
- . implode(', ', $requiredPrivileges) . " privileges are granted to table '{$dbName}'.";
+ . implode(', ', $requiredPrivileges) . " privileges are granted to database '{$dbName}'.";
throw new \Magento\Setup\Exception($errorMessage);
}
From 43d82d0c1beb89aa12a782c89b0e2e79dc282dba Mon Sep 17 00:00:00 2001
From: Serhiy Yelahin
Date: Tue, 19 Feb 2019 13:43:15 +0200
Subject: [PATCH 109/254] MAGETWO-97968: Minicart isn't updated for disabled
products
---
app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js b/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
index 81659e23c463b..33c453b063ff6 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
@@ -9,6 +9,7 @@ define([
'use strict';
var cartData = customerData.get('cart');
+
if (cartData()['items'] && cartData()['items'].length !== 0) {
customerData.reload(['cart'], false);
}
From 5c67e67a796861e37d6abe07dc42ca1ea8763202 Mon Sep 17 00:00:00 2001
From: nmalevanec
Date: Tue, 19 Feb 2019 13:46:50 +0200
Subject: [PATCH 110/254] Fix static test.
---
.../module/checkout/_order-summary.less | 34 +++++++++----------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less
index ae21a3877c350..beb8fc8d4c3b9 100644
--- a/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less
+++ b/app/design/frontend/Magento/luma/Magento_Checkout/web/css/source/module/checkout/_order-summary.less
@@ -233,21 +233,21 @@
// _____________________________________________
@media only screen and (max-width: @screen__m) {
- .opc-block-summary {
- .product-item {
- .product-item-inner {
- display: block;
- }
-
- .product-item-name-block {
- display: block;
- text-align: left;
- }
-
- .subtotal {
- display: block;
- text-align: left;
- }
+ .opc-block-summary {
+ .product-item {
+ .product-item-inner {
+ display: block;
+ }
+
+ .product-item-name-block {
+ display: block;
+ text-align: left;
+ }
+
+ .subtotal {
+ display: block;
+ text-align: left;
+ }
+ }
}
- }
-}
\ No newline at end of file
+}
From 7b9e807c8966308d173216d62f7ab40b11725353 Mon Sep 17 00:00:00 2001
From: Graham Wharton
Date: Fri, 25 Jan 2019 13:22:21 +0000
Subject: [PATCH 111/254] Changed references to "Store" to "Scope" in framework
components.
---
.../Sales/Model/Order/Email/SenderBuilder.php | 2 +-
.../Model/Order/Email/SenderBuilderTest.php | 8 +++---
.../Mail/Template/TransportBuilder.php | 26 ++++++++++++++-----
.../Unit/Template/TransportBuilderTest.php | 8 +++---
4 files changed, 29 insertions(+), 15 deletions(-)
diff --git a/app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php b/app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php
index a7d749ec04c7d..ed9e38822245f 100644
--- a/app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php
+++ b/app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php
@@ -106,7 +106,7 @@ protected function configureEmailTemplate()
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
- $this->transportBuilder->setFromByStore(
+ $this->transportBuilder->setFromByScope(
$this->identityContainer->getEmailIdentity(),
$this->identityContainer->getStore()->getId()
);
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/SenderBuilderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/SenderBuilderTest.php
index 759d60d9e6613..24cd54e3a46b3 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/SenderBuilderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/SenderBuilderTest.php
@@ -76,7 +76,7 @@ protected function setUp()
'setTemplateIdentifier',
'setTemplateOptions',
'setTemplateVars',
- 'setFromByStore',
+ 'setFromByScope',
]
);
@@ -103,7 +103,7 @@ protected function setUp()
->method('getEmailIdentity')
->will($this->returnValue($emailIdentity));
$this->transportBuilder->expects($this->once())
- ->method('setFromByStore')
+ ->method('setFromByScope')
->with($this->equalTo($emailIdentity), 1);
$this->identityContainerMock->expects($this->once())
@@ -146,7 +146,7 @@ public function testSend()
->method('getId')
->willReturn(1);
$this->transportBuilder->expects($this->once())
- ->method('setFromByStore')
+ ->method('setFromByScope')
->with($identity, 1);
$this->transportBuilder->expects($this->once())
->method('addTo')
@@ -176,7 +176,7 @@ public function testSendCopyTo()
->method('addTo')
->with($this->equalTo('example@mail.com'));
$this->transportBuilder->expects($this->once())
- ->method('setFromByStore')
+ ->method('setFromByScope')
->with($identity, 1);
$this->identityContainerMock->expects($this->once())
->method('getStore')
diff --git a/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php b/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
index a7bb96122a84d..0d69b3d96cebf 100644
--- a/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
+++ b/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
@@ -177,29 +177,43 @@ public function setReplyTo($email, $name = null)
/**
* Set mail from address
*
- * @deprecated This function sets the from address for the first store only.
- * new function setFromByStore introduced to allow setting of from address
- * based on store.
- * @see setFromByStore()
+ * @deprecated This function sets the from address but does not provide
+ * a way of setting the correct from addresses based on the scope.
+ * @see setFromByScope()
*
* @param string|array $from
* @return $this
*/
public function setFrom($from)
{
- return $this->setFromByStore($from, null);
+ return $this->setFromByScope($from, null);
}
/**
* Set mail from address by store
*
+ * @deprecated Use setFromByScope
+ * @see setFromByScope()
+ *
* @param string|array $from
* @param string|int $store
* @return $this
*/
public function setFromByStore($from, $store = null)
{
- $result = $this->_senderResolver->resolve($from, $store);
+ return $this->setFromByScope($from, $store);
+ }
+
+ /**
+ * Set mail from address by scopeId
+ *
+ * @param string|array $from
+ * @param string|int $scopeId
+ * @return $this
+ */
+ public function setFromByScope($from, $scopeId = null)
+ {
+ $result = $this->_senderResolver->resolve($from, $scopeId);
$this->message->setFromAddress($result['email'], $result['name']);
return $this;
}
diff --git a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php
index b476eecd7f59f..5e3309af6497b 100644
--- a/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php
+++ b/lib/internal/Magento/Framework/Mail/Test/Unit/Template/TransportBuilderTest.php
@@ -167,20 +167,20 @@ public function getTransportDataProvider()
/**
* @return void
*/
- public function testSetFromByStore()
+ public function testSetFromByScope()
{
$sender = ['email' => 'from@example.com', 'name' => 'name'];
- $store = 1;
+ $scopeId = 1;
$this->senderResolverMock->expects($this->once())
->method('resolve')
- ->with($sender, $store)
+ ->with($sender, $scopeId)
->willReturn($sender);
$this->messageMock->expects($this->once())
->method('setFromAddress')
->with($sender['email'], $sender['name'])
->willReturnSelf();
- $this->builder->setFromByStore($sender, $store);
+ $this->builder->setFromByScope($sender, $scopeId);
}
/**
From f98c124e547f528e99e6a14e650c5c171ef963e6 Mon Sep 17 00:00:00 2001
From: Serhiy Yelahin
Date: Tue, 19 Feb 2019 14:48:20 +0200
Subject: [PATCH 112/254] MAGETWO-97968: Minicart isn't updated for disabled
products
---
app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js b/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
index 33c453b063ff6..4b30ad8075274 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js
@@ -10,7 +10,7 @@ define([
var cartData = customerData.get('cart');
- if (cartData()['items'] && cartData()['items'].length !== 0) {
+ if (cartData().items && cartData().items.length !== 0) {
customerData.reload(['cart'], false);
}
});
From 3e832846dac8640fed86f8e0f0984f027c2f8b04 Mon Sep 17 00:00:00 2001
From: Shikha Mishra
Date: Tue, 19 Feb 2019 20:00:48 +0530
Subject: [PATCH 113/254] Fixed #15059 Cannot reorder from the first try
---
app/code/Magento/Sales/Model/AdminOrder/Create.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php
index 088ad5a61f6c3..1ba5984799414 100644
--- a/app/code/Magento/Sales/Model/AdminOrder/Create.php
+++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php
@@ -582,6 +582,7 @@ public function initFromOrder(\Magento\Sales\Model\Order $order)
}
$quote->getShippingAddress()->unsCachedItemsAll();
+ $quote->getBillingAddress()->unsCachedItemsAll();
$quote->setTotalsCollectedFlag(false);
$this->quoteRepository->save($quote);
From 2d4f079ecfefc9e1775239539ad5d9408bc9868e Mon Sep 17 00:00:00 2001
From: Cristian Partica
Date: Tue, 19 Feb 2019 10:38:25 -0600
Subject: [PATCH 114/254] MAGETWO-98258: Fix elacticsearch search perfomance
- fix static
---
.../SearchAdapter/Aggregation/Builder/Term.php | 5 ++++-
.../SearchAdapter/Query/Builder/Match.php | 11 ++++++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Term.php b/app/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Term.php
index bcfb7f5565b86..0c03a9df18dc8 100644
--- a/app/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Term.php
+++ b/app/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Term.php
@@ -8,10 +8,13 @@
use Magento\Framework\Search\Request\BucketInterface as RequestBucketInterface;
use Magento\Framework\Search\Dynamic\DataProviderInterface;
+/**
+ * Builder for term buckets.
+ */
class Term implements BucketBuilderInterface
{
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function build(
RequestBucketInterface $bucket,
diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php
index f1c3451482bab..149405aff3e78 100644
--- a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php
+++ b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php
@@ -10,6 +10,9 @@
use Magento\Elasticsearch\Model\Adapter\FieldMapperInterface;
use Magento\Framework\Search\Adapter\Preprocessor\PreprocessorInterface;
+/**
+ * Builder for match query.
+ */
class Match implements QueryInterface
{
/**
@@ -40,7 +43,7 @@ public function __construct(
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function build(array $selectQuery, RequestQueryInterface $requestQuery, $conditionType)
{
@@ -61,6 +64,8 @@ public function build(array $selectQuery, RequestQueryInterface $requestQuery, $
}
/**
+ * Prepare query.
+ *
* @param string $queryValue
* @param string $conditionType
* @return array
@@ -124,11 +129,11 @@ protected function buildQueries(array $matches, array $queryValue)
}
/**
+ * Escape a value for special query characters such as ':', '(', ')', '*', '?', etc.
+ *
* Cut trailing plus or minus sign, and @ symbol, using of which causes InnoDB to report a syntax error.
* @link https://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html Fulltext-boolean search docs.
*
- * Escape a value for special query characters such as ':', '(', ')', '*', '?', etc.
- *
* @param string $value
* @return string
*/
From 2a884e574241b4ab1d8093e1421cf980283383c7 Mon Sep 17 00:00:00 2001
From: Sergii Ivashchenko
Date: Tue, 19 Feb 2019 16:44:12 +0000
Subject: [PATCH 115/254] magento/magento2#20621: Removed deprecated method
---
.../Mail/Template/TransportBuilder.php | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git a/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php b/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
index 0d69b3d96cebf..b9271c0209fd3 100644
--- a/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
+++ b/lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
@@ -183,33 +183,20 @@ public function setReplyTo($email, $name = null)
*
* @param string|array $from
* @return $this
+ * @throws \Magento\Framework\Exception\MailException
*/
public function setFrom($from)
{
return $this->setFromByScope($from, null);
}
- /**
- * Set mail from address by store
- *
- * @deprecated Use setFromByScope
- * @see setFromByScope()
- *
- * @param string|array $from
- * @param string|int $store
- * @return $this
- */
- public function setFromByStore($from, $store = null)
- {
- return $this->setFromByScope($from, $store);
- }
-
/**
* Set mail from address by scopeId
*
* @param string|array $from
* @param string|int $scopeId
* @return $this
+ * @throws \Magento\Framework\Exception\MailException
*/
public function setFromByScope($from, $scopeId = null)
{
@@ -270,6 +257,7 @@ public function setTemplateOptions($templateOptions)
* Get mail transport
*
* @return \Magento\Framework\Mail\TransportInterface
+ * @throws LocalizedException
*/
public function getTransport()
{
From d6a4106edf3b73781dc73716c046d2f414bf6472 Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Tue, 19 Feb 2019 11:03:19 -0600
Subject: [PATCH 116/254] MC-4408: Convert UpdateSimpleProductEntityTest to
MFTF
- Use action group to filter product grid
---
...VerifyDataOverridingOnStoreViewLevelTest.xml | 11 ++++++-----
...VerifyDataOverridingOnStoreViewLevelTest.xml | 12 +++++++-----
.../AdminUpdateSimpleProductTieredPriceTest.xml | 11 ++++++-----
...thRegularPriceInStockDisabledProductTest.xml | 10 +++++-----
...ctWithRegularPriceInStockEnabledFlatTest.xml | 10 +++++-----
...arPriceInStockNotVisibleIndividuallyTest.xml | 10 +++++-----
...ularPriceInStockUnassignFromCategoryTest.xml | 10 +++++-----
...riceInStockVisibleInCatalogAndSearchTest.xml | 10 +++++-----
...ularPriceInStockVisibleInCatalogOnlyTest.xml | 10 +++++-----
...gularPriceInStockVisibleInSearchOnlyTest.xml | 10 +++++-----
...RegularPriceInStockWithCustomOptionsTest.xml | 17 ++++++++++-------
...pleProductWithRegularPriceOutOfStockTest.xml | 10 +++++-----
12 files changed, 69 insertions(+), 62 deletions(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml
index a5c2e1aa3a6de..18e4ff9ee2c99 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductNameToVerifyDataOverridingOnStoreViewLevelTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -44,10 +44,9 @@
-
-
-
-
+
+
+
@@ -57,10 +56,12 @@
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml
index cd18110368919..d5fc981b5b2e6 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductPriceToVerifyDataOverridingOnStoreViewLevelTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -44,21 +44,23 @@
-
-
-
-
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml
index e63b1fdfe31bc..2c3aa5db75171 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductTieredPriceTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -38,10 +38,9 @@
-
-
-
-
+
+
+
@@ -49,6 +48,7 @@
+
@@ -74,6 +74,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml
index 7c2f8b4c458cc..6e8f1ba6f12a6 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockDisabledProductTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -36,10 +36,9 @@
-
-
-
-
+
+
+
@@ -56,6 +55,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml
index 8f032b93c37b5..a042c4d60ae4f 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockEnabledFlatTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -40,10 +40,9 @@
-
-
-
-
+
+
+
@@ -73,6 +72,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml
index c163e7bfa7ab9..d08ef9c93999c 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockNotVisibleIndividuallyTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -38,10 +38,9 @@
-
-
-
-
+
+
+
@@ -64,6 +63,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml
index 8476afe5263e6..3433a09117322 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockUnassignFromCategoryTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -36,10 +36,9 @@
-
-
-
-
+
+
+
@@ -51,6 +50,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml
index a7c7b66171983..a695982921cfd 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogAndSearchTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -38,10 +38,9 @@
-
-
-
-
+
+
+
@@ -64,6 +63,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml
index 675206283a4ef..ba52c6d2bc261 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInCatalogOnlyTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -38,10 +38,9 @@
-
-
-
-
+
+
+
@@ -64,6 +63,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml
index 4b54b0e7c6fcf..cb5c24839e387 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockVisibleInSearchOnlyTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -38,10 +38,9 @@
-
-
-
-
+
+
+
@@ -64,6 +63,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml
index 2ee993d2af696..c9a37ec40e8fa 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -38,10 +38,9 @@
-
-
-
-
+
+
+
@@ -61,6 +60,7 @@
+
@@ -76,10 +76,11 @@
-
+
+
-
+
@@ -103,6 +104,7 @@
+
@@ -134,6 +136,7 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml
index ea575bdb2771e..54ed753b80a1c 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceOutOfStockTest.xml
@@ -19,7 +19,7 @@
-
+
@@ -38,10 +38,9 @@
-
-
-
-
+
+
+
@@ -63,6 +62,7 @@
+
From 168f916d35011d5147a1b7c7218cd122724b91f4 Mon Sep 17 00:00:00 2001
From: Cristian Partica
Date: Tue, 19 Feb 2019 11:30:20 -0600
Subject: [PATCH 117/254] MAGETWO-98258: Fix elacticsearch search perfomance
- fix static
---
.../Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php
index 149405aff3e78..aaa9d8a88382f 100644
--- a/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php
+++ b/app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php
@@ -132,7 +132,7 @@ protected function buildQueries(array $matches, array $queryValue)
* Escape a value for special query characters such as ':', '(', ')', '*', '?', etc.
*
* Cut trailing plus or minus sign, and @ symbol, using of which causes InnoDB to report a syntax error.
- * @link https://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html Fulltext-boolean search docs.
+ * https://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html Fulltext-boolean search docs.
*
* @param string $value
* @return string
From fb18e4fc67782af1f9379bf5f1eeb8d4dd58c67b Mon Sep 17 00:00:00 2001
From: Valerii Naida
Date: Tue, 19 Feb 2019 12:22:14 -0600
Subject: [PATCH 118/254] GraphQL-363: Always return cart id null after add
product
---
.../Resolver/AddSimpleProductsToCart.php | 1 -
.../QuoteGraphQl/Model/Resolver/Cart.php | 10 +-
.../Magento/GraphQl/Quote/GetCartTest.php | 124 ++++++++----------
3 files changed, 57 insertions(+), 78 deletions(-)
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php
index ff0298416cdf8..f4335b262c854 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/AddSimpleProductsToCart.php
@@ -81,7 +81,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
$this->addProductsToCart->execute($cart, $cartItems);
$cartData = $this->extractDataFromCart->execute($cart);
- $cartData["cart_id"] = $cartHash;
return [
'cart' => $cartData,
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/Cart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/Cart.php
index 5023c186f1e6c..1849ba0803868 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Resolver/Cart.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/Cart.php
@@ -54,14 +54,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
$currentUserId = $context->getUserId();
$cart = $this->getCartForUser->execute($maskedCartId, $currentUserId);
- $data = array_merge(
- [
- 'cart_id' => $maskedCartId,
- 'model' => $cart
- ],
- $this->extractDataFromCart->execute($cart)
- );
-
+ $data = $this->extractDataFromCart->execute($cart);
+ $data['model'] = $cart;
return $data;
}
}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
index 44cd2ef526bd5..6c5add7df6b0f 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
@@ -8,7 +8,7 @@
namespace Magento\GraphQl\Quote;
use Magento\Integration\Api\CustomerTokenServiceInterface;
-use Magento\Quote\Model\Quote;
+use Magento\Quote\Model\QuoteFactory;
use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
use Magento\TestFramework\Helper\Bootstrap;
@@ -19,20 +19,15 @@
*/
class GetCartTest extends GraphQlAbstract
{
- /**
- * @var CustomerTokenServiceInterface
- */
- private $customerTokenService;
-
/**
* @var QuoteResource
*/
private $quoteResource;
/**
- * @var Quote
+ * @var QuoteFactory
*/
- private $quote;
+ private $quoteFactory;
/**
* @var QuoteIdToMaskedQuoteIdInterface
@@ -40,103 +35,87 @@ class GetCartTest extends GraphQlAbstract
private $quoteIdToMaskedId;
/**
- * @inheritdoc
+ * @var CustomerTokenServiceInterface
*/
+ private $customerTokenService;
+
protected function setUp()
{
$objectManager = Bootstrap::getObjectManager();
- $this->quoteResource = $objectManager->create(QuoteResource::class);
- $this->quote = $objectManager->create(Quote::class);
- $this->quoteIdToMaskedId = $objectManager->create(QuoteIdToMaskedQuoteIdInterface::class);
+ $this->quoteResource = $objectManager->get(QuoteResource::class);
+ $this->quoteFactory = $objectManager->get(QuoteFactory::class);
+ $this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class);
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
}
/**
- * @magentoApiDataFixture Magento/Checkout/_files/quote_with_items_saved.php
+ * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
*/
- public function testGetOwnCartForRegisteredCustomer()
+ public function testGetCartForGuest()
{
- $reservedOrderId = 'test_order_item_with_items';
- $this->quoteResource->load(
- $this->quote,
- $reservedOrderId,
- 'reserved_order_id'
- );
-
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
- $query = $this->prepareGetCartQuery($maskedQuoteId);
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_1');
+ $query = $this->getCartQuery($maskedQuoteId);
- $response = $this->sendRequestWithToken($query);
+ $response = $this->graphQlQuery($query);
self::assertArrayHasKey('cart', $response);
- self::assertNotEmpty($response['cart']['items']);
- self::assertNotEmpty($response['cart']['shipping_addresses']);
+ self::assertEquals($maskedQuoteId, $response['cart']['cart_id']);
}
/**
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_items_saved.php
*/
- public function testGetCartFromAnotherCustomer()
+ public function testGetCartByRegisteredCustomer()
{
- $reservedOrderId = 'test_order_item_with_items';
- $this->quoteResource->load(
- $this->quote,
- $reservedOrderId,
- 'reserved_order_id'
- );
-
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
- $query = $this->prepareGetCartQuery($maskedQuoteId);
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_item_with_items');
+ $query = $this->getCartQuery($maskedQuoteId);
- self::expectExceptionMessage("The current user cannot perform operations on cart \"$maskedQuoteId\"");
+ $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
- $this->graphQlQuery($query);
+ self::assertArrayHasKey('cart', $response);
+ self::assertEquals($maskedQuoteId, $response['cart']['cart_id']);
+ self::assertNotEmpty($response['cart']['items']);
}
/**
- * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_items_saved.php
*/
- public function testGetCartForGuest()
+ public function testGetCartOfAnotherCustomerByGuest()
{
- $reservedOrderId = 'test_order_1';
- $this->quoteResource->load(
- $this->quote,
- $reservedOrderId,
- 'reserved_order_id'
- );
-
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
- $query = $this->prepareGetCartQuery($maskedQuoteId);
+ $maskedQuoteId = $this->getMaskedQuoteIdByReversedQuoteId('test_order_item_with_items');
+ $query = $this->getCartQuery($maskedQuoteId);
- $response = $this->graphQlQuery($query);
-
- self::assertArrayHasKey('cart', $response);
+ self:$this->expectExceptionMessage(
+ "The current user cannot perform operations on cart \"{$maskedQuoteId}\""
+ );
+ $this->graphQlQuery($query);
}
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
+ */
public function testGetNonExistentCart()
{
$maskedQuoteId = 'non_existent_masked_id';
- $query = $this->prepareGetCartQuery($maskedQuoteId);
-
- self::expectExceptionMessage("Could not find a cart with ID \"$maskedQuoteId\"");
+ $query = $this->getCartQuery($maskedQuoteId);
$this->graphQlQuery($query);
}
/**
- * Generates query for setting the specified shipping method on cart
- *
* @param string $maskedQuoteId
* @return string
*/
- private function prepareGetCartQuery(
+ private function getCartQuery(
string $maskedQuoteId
) : string {
return <<quoteFactory->create();
+ $this->quoteResource->load($quote, $reversedQuoteId, 'reserved_order_id');
- $customerToken = $this->customerTokenService->createCustomerAccessToken('customer@example.com', 'password');
- $headerMap = ['Authorization' => 'Bearer ' . $customerToken];
+ return $this->quoteIdToMaskedId->execute((int)$quote->getId());
+ }
- return $this->graphQlQuery($query, [], '', $headerMap);
+ /**
+ * @param string $username
+ * @param string $password
+ * @return array
+ */
+ private function getHeaderMap(string $username = 'customer@example.com', string $password = 'password'): array
+ {
+ $customerToken = $this->customerTokenService->createCustomerAccessToken($username, $password);
+ $headerMap = ['Authorization' => 'Bearer ' . $customerToken];
+ return $headerMap;
}
}
From c84054f3a05b404d7ac7a1fd410f3cf39363b112 Mon Sep 17 00:00:00 2001
From: John S
Date: Tue, 19 Feb 2019 13:02:56 -0600
Subject: [PATCH 119/254] MC-4409: Convert UpdateProductAttributeEntityTest to
MFTF
- Adding "waitForPageLoad" action to the Action Group.
- Adding clean up steps to the "after" block of the Test.
- Fixing the name of the "createData" reference. There is a camel-casing issue with the original name.
---
.../AdminProductAttributeSetActionGroup.xml | 1 +
...sibleInStorefrontAdvancedSearchFormTest.xml | 16 ++++++++++++++++
...sibleInStorefrontAdvancedSearchFormTest.xml | 18 +++++++++++++++++-
3 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
index 458fb9a509559..8a450a4733600 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
@@ -62,5 +62,6 @@
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
index c0d334861642d..19553f6893fcb 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
@@ -5,6 +5,7 @@
* See COPYING.txt for license details.
*/
-->
+
@@ -17,6 +18,7 @@
+
@@ -26,17 +28,24 @@
+
+
+
+
+
+
+
@@ -44,26 +53,33 @@
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
index b7fdb7bd67941..de373f246fa76 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
@@ -5,6 +5,7 @@
* See COPYING.txt for license details.
*/
-->
+
@@ -17,26 +18,34 @@
+
-
+
+
+
+
+
+
+
+
@@ -44,26 +53,33 @@
+
+
+
+
+
+
+
From bce29bd32b411f8bae26032e2f4f8e1ea15bbfe1 Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Tue, 19 Feb 2019 13:14:04 -0600
Subject: [PATCH 120/254] MC-4527: Convert
VerifyConfigurableProductEntityPriceTest to MFTF
- Make use of extends
---
...oductPriceWithDisabledChildProductTest.xml | 26 +++-
...uctPriceWithOutOfStockChildProductTest.xml | 142 +-----------------
2 files changed, 30 insertions(+), 138 deletions(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml
index 0d83d59b4ce32..86978a4121a43 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithDisabledChildProductTest.xml
@@ -20,8 +20,10 @@
+
+
@@ -33,44 +35,53 @@
+
+
+
+
+
+
10.00
+
20.00
+
-
+
30.00
+
@@ -79,16 +90,19 @@
+
+
+
@@ -105,17 +119,21 @@
+
+
+
+
@@ -123,6 +141,7 @@
+
@@ -131,22 +150,27 @@
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml
index f5650feeff71b..8d41b276334a6 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCheckConfigurableProductPriceWithOutOfStockChildProductTest.xml
@@ -8,7 +8,7 @@
-
+
@@ -17,141 +17,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 10.00
-
-
-
-
-
- 20.00
-
-
-
-
-
- 30.00
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
From 6b0fc4791e49014386b2ea69f152cfe9cf93ec70 Mon Sep 17 00:00:00 2001
From: Joan He
Date: Tue, 19 Feb 2019 12:48:28 -0600
Subject: [PATCH 121/254] MC-14951: Create backup not working
---
app/code/Magento/Backup/Controller/Adminhtml/Index.php | 3 +--
.../Magento/Backup/Controller/Adminhtml/Index/Create.php | 7 +++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index.php b/app/code/Magento/Backup/Controller/Adminhtml/Index.php
index 0edeb5565f288..b62963947d7bf 100644
--- a/app/code/Magento/Backup/Controller/Adminhtml/Index.php
+++ b/app/code/Magento/Backup/Controller/Adminhtml/Index.php
@@ -6,7 +6,6 @@
namespace Magento\Backup\Controller\Adminhtml;
use Magento\Backend\App\Action;
-use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Backup\Helper\Data as Helper;
use Magento\Framework\App\ObjectManager;
@@ -18,7 +17,7 @@
* @since 100.0.2
* @SuppressWarnings(PHPMD.AllPurposeAction)
*/
-abstract class Index extends Action implements HttpGetActionInterface
+abstract class Index extends Action
{
/**
* Authorization level of a basic admin session
diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php b/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php
index 53f45aff50cbc..99c48b727521a 100644
--- a/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php
+++ b/app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php
@@ -1,15 +1,18 @@
Date: Tue, 19 Feb 2019 14:15:24 -0600
Subject: [PATCH 122/254] MC-14957: Authorize.net trying to load non-existent
Accept.min.js in production configurations
- Changed how require loads accept.js library to work within all constraints
---
.../view/base/requirejs-config.js | 14 ++++----------
.../base/web/js/view/payment/acceptjs-factory.js | 13 +++++++++++--
2 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/app/code/Magento/AuthorizenetAcceptjs/view/base/requirejs-config.js b/app/code/Magento/AuthorizenetAcceptjs/view/base/requirejs-config.js
index 83ddd1094ea1a..cbe0a6c30e699 100644
--- a/app/code/Magento/AuthorizenetAcceptjs/view/base/requirejs-config.js
+++ b/app/code/Magento/AuthorizenetAcceptjs/view/base/requirejs-config.js
@@ -4,16 +4,10 @@
*/
var config = {
- shim: {
- acceptjs: {
- exports: 'Accept'
- },
- acceptjssandbox: {
- exports: 'Accept'
+ map: {
+ '*': {
+ acceptjssandbox: 'https://jstest.authorize.net/v1/Accept.js',
+ acceptjs: 'https://js.authorize.net/v1/Accept.js'
}
- },
- paths: {
- acceptjssandbox: 'https://jstest.authorize.net/v1/Accept',
- acceptjs: 'https://js.authorize.net/v1/Accept'
}
};
diff --git a/app/code/Magento/AuthorizenetAcceptjs/view/base/web/js/view/payment/acceptjs-factory.js b/app/code/Magento/AuthorizenetAcceptjs/view/base/web/js/view/payment/acceptjs-factory.js
index e98a204e36cee..c8813c17c70c7 100644
--- a/app/code/Magento/AuthorizenetAcceptjs/view/base/web/js/view/payment/acceptjs-factory.js
+++ b/app/code/Magento/AuthorizenetAcceptjs/view/base/web/js/view/payment/acceptjs-factory.js
@@ -16,7 +16,7 @@ define([
dependency = 'acceptjssandbox';
}
- require([dependency], function (accept) {
+ require([dependency], function () {
var $body = $('body');
/*
@@ -26,7 +26,16 @@ define([
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
*/
$body.on('handshake.acceptjs', function () {
- deferred.resolve(accept);
+ /*
+ * Accept.js doesn't return the library when loading
+ * and requirejs "shim" can't be used because it only works with the "paths" config option
+ * and we can't use "paths" because require will try to load ".min.js" in production
+ * and that doesn't work because it doesn't exist
+ * and we can't add a query string to force a URL because accept.js will reject it
+ * and we can't include it locally because they check in the script before loading more scripts
+ * So, we use the global version as "shim" would
+ */
+ deferred.resolve(window.Accept);
$body.off('handshake.acceptjs');
});
},
From 55b8bf813f4e398a6c81e0725a8c16302612f745 Mon Sep 17 00:00:00 2001
From: Iryna Lagno
Date: Wed, 13 Feb 2019 14:41:53 -0600
Subject: [PATCH 123/254] MC-14849:
\Magento\Paypal\Model\Api\Nvp::callSetExpressCheckout returns empty response
---
lib/internal/Magento/Framework/HTTP/Adapter/Curl.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php
index 0e51c64661a4b..bc833bf3bb2d4 100644
--- a/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php
+++ b/lib/internal/Magento/Framework/HTTP/Adapter/Curl.php
@@ -170,7 +170,6 @@ public function write($method, $url, $http_ver = '1.1', $headers = [], $body = '
// set url to post to
curl_setopt($this->_getResource(), CURLOPT_URL, $url);
- curl_setopt($this->_getResource(), CURLOPT_HTTP_VERSION, $http_ver);
curl_setopt($this->_getResource(), CURLOPT_RETURNTRANSFER, true);
if ($method == \Zend_Http_Client::POST) {
curl_setopt($this->_getResource(), CURLOPT_POST, true);
From f1877658834be6afecc8c47f9b567d6c91d0b651 Mon Sep 17 00:00:00 2001
From: John S
Date: Tue, 19 Feb 2019 15:05:22 -0600
Subject: [PATCH 124/254] MC-4409: Convert UpdateProductAttributeEntityTest to
MFTF
- Adding "waitForPageLoad" timeout value to the Action Group.
- Replacing "waitForElementVisible" with "waitForPageLoad" action.
---
...ductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml | 4 ++--
...ductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml | 4 ++--
.../Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
index 19553f6893fcb..1bc69be642a37 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateDropdownProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
@@ -66,11 +66,11 @@
-
+
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
index de373f246fa76..1f558568e9248 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateMultipleSelectProductAttributeVisibleInStorefrontAdvancedSearchFormTest.xml
@@ -66,11 +66,11 @@
-
+
-
+
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml
index 387a7547f4daf..6b913e5b458e6 100644
--- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml
@@ -48,7 +48,7 @@
-
+
From eee25c633bd0eeac03f06f736fc27c8fd442fe87 Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Tue, 19 Feb 2019 15:25:24 -0600
Subject: [PATCH 125/254] MC-4416: Convert CreateProductAttributeEntityTest to
MFTF
- Revert change to existing element name
---
.../Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml | 2 +-
.../Test/Mftf/Section/AdminProductAttributeGridSection.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
index 770efaf2fd9e0..46329dde278bc 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
@@ -169,7 +169,7 @@
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml
index 41a6f005de4dd..12cc788ae06ae 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml
@@ -10,7 +10,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
-
+
From 8b09a6ff2e3b681cb92af8558ebbfdf6718bc576 Mon Sep 17 00:00:00 2001
From: Oleksandr Iegorov
Date: Tue, 19 Feb 2019 15:41:29 -0600
Subject: [PATCH 126/254] MAGETWO-98328: Update FedEx Shipping Dates behavior
in Tracking Popup
---
.../DataProviders/Tracking/ChangeTitle.php | 32 +++++++++++
.../Block/Tracking/PopupDeliveryDate.php | 55 +++++++++++++++++++
app/code/Magento/Fedex/etc/di.xml | 6 ++
.../Tracking/DeliveryDateTitle.php | 25 +++++++++
.../layout/shipping_tracking_popup.xml | 6 +-
.../frontend/templates/tracking/details.phtml | 2 +-
6 files changed, 124 insertions(+), 2 deletions(-)
create mode 100644 app/code/Magento/Fedex/Plugin/Block/DataProviders/Tracking/ChangeTitle.php
create mode 100644 app/code/Magento/Fedex/Plugin/Block/Tracking/PopupDeliveryDate.php
create mode 100644 app/code/Magento/Shipping/Block/DataProviders/Tracking/DeliveryDateTitle.php
diff --git a/app/code/Magento/Fedex/Plugin/Block/DataProviders/Tracking/ChangeTitle.php b/app/code/Magento/Fedex/Plugin/Block/DataProviders/Tracking/ChangeTitle.php
new file mode 100644
index 0000000000000..d148b91aa3e7a
--- /dev/null
+++ b/app/code/Magento/Fedex/Plugin/Block/DataProviders/Tracking/ChangeTitle.php
@@ -0,0 +1,32 @@
+getCarrier() === Carrier::CODE) {
+ $result = __('Expected Delivery:');
+ }
+ return $result;
+ }
+}
diff --git a/app/code/Magento/Fedex/Plugin/Block/Tracking/PopupDeliveryDate.php b/app/code/Magento/Fedex/Plugin/Block/Tracking/PopupDeliveryDate.php
new file mode 100644
index 0000000000000..942d21dfa5e47
--- /dev/null
+++ b/app/code/Magento/Fedex/Plugin/Block/Tracking/PopupDeliveryDate.php
@@ -0,0 +1,55 @@
+getCarrier($subject) === Carrier::CODE) {
+ $result = $subject->formatDeliveryDate($date);
+ }
+ return $result;
+ }
+
+ /**
+ * Retrieve carrier name from tracking info
+ *
+ * @param Popup $subject
+ * @return string
+ */
+ private function getCarrier(Popup $subject): string
+ {
+ foreach ($subject->getTrackingInfo() as $trackingData) {
+ foreach ($trackingData as $trackingInfo) {
+ if ($trackingInfo instanceof Status) {
+ $carrier = $trackingInfo->getCarrier();
+ return $carrier;
+ }
+ }
+ }
+ return '';
+ }
+}
diff --git a/app/code/Magento/Fedex/etc/di.xml b/app/code/Magento/Fedex/etc/di.xml
index f17f8f2afe663..c542b1f04d1eb 100644
--- a/app/code/Magento/Fedex/etc/di.xml
+++ b/app/code/Magento/Fedex/etc/di.xml
@@ -22,4 +22,10 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Shipping/Block/DataProviders/Tracking/DeliveryDateTitle.php b/app/code/Magento/Shipping/Block/DataProviders/Tracking/DeliveryDateTitle.php
new file mode 100644
index 0000000000000..dc66c4f0bd018
--- /dev/null
+++ b/app/code/Magento/Shipping/Block/DataProviders/Tracking/DeliveryDateTitle.php
@@ -0,0 +1,25 @@
+getCarrier() ? __('Delivered on:') : '';
+ }
+}
diff --git a/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml b/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml
index 1f5b0ae4630ad..67d03da2599bf 100644
--- a/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml
+++ b/app/code/Magento/Shipping/view/frontend/layout/shipping_tracking_popup.xml
@@ -8,7 +8,11 @@
-
+
diff --git a/app/code/Magento/Shipping/view/frontend/templates/tracking/details.phtml b/app/code/Magento/Shipping/view/frontend/templates/tracking/details.phtml
index 9253b47f82f5d..e8584d8f6ad51 100644
--- a/app/code/Magento/Shipping/view/frontend/templates/tracking/details.phtml
+++ b/app/code/Magento/Shipping/view/frontend/templates/tracking/details.phtml
@@ -77,7 +77,7 @@ $number = is_object($track) ? $track->getTracking() : $track['number'];
getDeliverydate()): ?>
- = $block->escapeHtml(__('Delivered on:')) ?> |
+ = $block->escapeHtml($parentBlock->getDeliveryDateTitle()->getTitle($track)) ?> |
= /* @noEscape */ $parentBlock->formatDeliveryDateTime($track->getDeliverydate(), $track->getDeliverytime()) ?>
|
From dab868344118dfb1ad355e3b6f3ea9355f445f0f Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Tue, 19 Feb 2019 15:49:16 -0600
Subject: [PATCH 127/254] MC-4416: Convert CreateProductAttributeEntityTest to
MFTF
- Add missing mtf_migrated group
---
.../Test/Mftf/Test/CreateProductAttributeEntityTest.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
index 2290f5de0069d..52022f32fd8ec 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/CreateProductAttributeEntityTest.xml
@@ -17,6 +17,7 @@
+
@@ -75,6 +76,7 @@
+
@@ -134,6 +136,7 @@
+
@@ -187,6 +190,7 @@
+
@@ -273,6 +277,7 @@
+
@@ -341,6 +346,7 @@
+
From 763b52757deda085249070f69d59ac6be89c83b5 Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Tue, 19 Feb 2019 16:23:36 -0600
Subject: [PATCH 128/254] MQE-1453: Deliver weekly PR
- Add mtf_migrated tags to MTF tests
---
...SubcategoryNotIncludeInNavigationMenuTest.xml | 4 ++++
.../Product/UpdateSimpleProductEntityTest.xml | 16 ++++++++++++++--
.../CreateProductAttributeEntityTest.xml | 5 ++++-
...eteAssignedToTemplateProductAttributeTest.xml | 2 ++
.../UpdateProductAttributeEntityTest.xml | 2 ++
.../VerifyConfigurableProductEntityPriceTest.xml | 2 ++
6 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/SubcategoryNotIncludeInNavigationMenuTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/SubcategoryNotIncludeInNavigationMenuTest.xml
index 94d99dd6b7b24..53a7debffa438 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/SubcategoryNotIncludeInNavigationMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/SubcategoryNotIncludeInNavigationMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
two_nested_categories
2
Yes
@@ -16,6 +17,7 @@
+ mftf_migrated:yes
two_nested_categories
2
Yes
@@ -24,6 +26,7 @@
+ mftf_migrated:yes
two_nested_categories
2
No
@@ -32,6 +35,7 @@
+ mftf_migrated:yes
two_nested_categories
2
No
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml
index 2a46abdc2fd15..ce99a61c33bac 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
Update visibility to Catalog, Search
product_with_category
Test simple product %isolation%
@@ -24,6 +25,7 @@
+ mftf_migrated:yes
Update visibility to Not Visible Individually
product_with_category
Test simple product %isolation%
@@ -38,6 +40,7 @@
+ mftf_migrated:yes
Update visibility to Catalog
product_with_category
Test simple product %isolation%
@@ -55,6 +58,7 @@
+ mftf_migrated:yes
Update visibility to Search
product_with_category
Test simple product %isolation%
@@ -72,6 +76,7 @@
+ mftf_migrated:yes
Update stock to Out of Stock
product_with_category
Test simple product %isolation%
@@ -89,6 +94,7 @@
+ mftf_migrated:yes
Update product status to offline
product_with_category
Test simple product %isolation%
@@ -103,6 +109,7 @@
+ mftf_migrated:yes
Update category
product_with_category
default
@@ -118,6 +125,7 @@
+ mftf_migrated:yes
product_with_category
default
Test simple product %isolation%
@@ -128,13 +136,14 @@
- test_type:acceptance_test, test_type:extended_acceptance_test
+ test_type:acceptance_test, test_type:extended_acceptance_test, mftf_migrated:yes
product_with_category
-
+ mftf_migrated:yes
product_flat
simple_10_dollar
Simple Product %isolation%
@@ -146,6 +155,7 @@
+ mftf_migrated:yes
product_with_category
Test simple product %isolation%
test_simple_product_%isolation%
@@ -160,6 +170,7 @@
+ mftf_migrated:yes
product_with_category
custom
No
@@ -168,7 +179,7 @@
- test_type:acceptance_test, test_type:extended_acceptance_test
+ test_type:acceptance_test, test_type:extended_acceptance_test, mftf_migrated:yes
price_scope_website
product_with_category
custom
@@ -178,6 +189,7 @@
+ mftf_migrated:yes
simple_with_hight_tier_price
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml
index aae9ec6039f56..2287546aed102 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml
@@ -20,6 +20,7 @@
+ mftf_migrated:yes
custom_attribute_set
Text_Field_Admin_%isolation%
Text Area
@@ -115,7 +116,7 @@
- test_type:extended_acceptance_test
+ test_type:extended_acceptance_test, mftf_migrated:yes
custom_attribute_set
Dropdown_Admin_%isolation%
Dropdown
@@ -154,6 +155,7 @@
+ mftf_migrated:yes
custom_attribute_set
Price_Admin_%isolation%
Price
@@ -209,6 +211,7 @@
+ mftf_migrated:yes
custom_attribute_set
Dropdown_Admin_%isolation%
Dropdown
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml
index b12f4f1ad7d94..d674535b54abb 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/DeleteAssignedToTemplateProductAttributeTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
custom_attribute_set
attribute_type_dropdown
@@ -16,6 +17,7 @@
+ mftf_migrated:yes
default
attribute_type_text_field
Product name
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml
index b051d50b4acb6..40cf8e40ae33f 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/UpdateProductAttributeEntityTest.xml
@@ -67,6 +67,7 @@
+ mftf_migrated:yes
custom_attribute_set
attribute_type_dropdown
Dropdown
@@ -76,6 +77,7 @@
+ mftf_migrated:yes
custom_attribute_set
attribute_type_multiple_select
Dropdown_%isolation%
diff --git a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/VerifyConfigurableProductEntityPriceTest.xml b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/VerifyConfigurableProductEntityPriceTest.xml
index 6d22cea4689a8..d576e760179ed 100644
--- a/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/VerifyConfigurableProductEntityPriceTest.xml
+++ b/dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/TestCase/VerifyConfigurableProductEntityPriceTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
configurableProduct::product_with_color
-
@@ -19,6 +20,7 @@
+ mftf_migrated:yes
configurableProduct::product_with_color
-
From 40890490c1a2430c3882ed9c721e4cd1e55a3879 Mon Sep 17 00:00:00 2001
From: Iryna Lagno
Date: Tue, 19 Feb 2019 10:42:11 -0600
Subject: [PATCH 129/254] MC-14953: Not clickable link
---
.../Magento_Rma/web/css/source/_module.less | 14 +++++++++++---
.../Magento/Test/Legacy/_files/words_ce.xml | 4 ++++
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/app/design/adminhtml/Magento/backend/Magento_Rma/web/css/source/_module.less b/app/design/adminhtml/Magento/backend/Magento_Rma/web/css/source/_module.less
index c405707ee7bbe..16c84047b529d 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Rma/web/css/source/_module.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Rma/web/css/source/_module.less
@@ -7,13 +7,21 @@
.rma-request-details,
.rma-wrapper .order-shipping-address {
float: left;
- #mix-grid .width(6,12);
+ /**
+ * @codingStandardsIgnoreStart
+ */
+ #mix-grid .width(6, 12);
+ //@codingStandardsIgnoreEnd
}
.rma-confirmation,
- .rma-wrapper .order-return-address {
+ .rma-wrapper .order-return-address, .rma-wrapper .order-shipping-method {
float: right;
- #mix-grid .width(6,12);
+ /**
+ * @codingStandardsIgnoreStart
+ */
+ #mix-grid .width(6, 12);
+ //@codingStandardsIgnoreEnd
}
}
diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml
index 9bb00533a5da5..92e7b15efed29 100644
--- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml
+++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/words_ce.xml
@@ -69,5 +69,9 @@
-
dev/build/publication/sanity/ce.xml
+ -
+ app/design/adminhtml/Magento/backend/Magento_Rma/web/css/source/_module.less
+ rma
+
From 3c8ac9b608a98420f7ea271cbca7e84b2a70f509 Mon Sep 17 00:00:00 2001
From: Valerii Naida
Date: Tue, 19 Feb 2019 17:03:50 -0600
Subject: [PATCH 130/254] GraphQL-292: [Payment methods] Get list of available
payment methods for current cart
---
.../AvailablePaymentMethods.php} | 35 ++++++++++----
.../AvailablePaymentMethodsResolver.php | 48 -------------------
.../Magento/QuoteGraphQl/etc/schema.graphqls | 2 +-
3 files changed, 26 insertions(+), 59 deletions(-)
rename app/code/Magento/QuoteGraphQl/Model/{Cart/PaymentMethod/AvailablePaymentMethodsDataProvider.php => Resolver/AvailablePaymentMethods.php} (52%)
delete mode 100644 app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethodsResolver.php
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/PaymentMethod/AvailablePaymentMethodsDataProvider.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethods.php
similarity index 52%
rename from app/code/Magento/QuoteGraphQl/Model/Cart/PaymentMethod/AvailablePaymentMethodsDataProvider.php
rename to app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethods.php
index daa51d8729995..907d778550593 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Cart/PaymentMethod/AvailablePaymentMethodsDataProvider.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethods.php
@@ -5,15 +5,19 @@
*/
declare(strict_types=1);
-namespace Magento\QuoteGraphQl\Model\Cart\PaymentMethod;
+namespace Magento\QuoteGraphQl\Model\Resolver;
use Magento\Checkout\Api\PaymentInformationManagementInterface;
+use Magento\Framework\Exception\LocalizedException;
+use Magento\Framework\GraphQl\Config\Element\Field;
+use Magento\Framework\GraphQl\Query\ResolverInterface;
+use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Magento\Quote\Api\Data\CartInterface;
/**
- * Get array of available payment methods.
+ * Get list of active payment methods resolver.
*/
-class AvailablePaymentMethodsDataProvider
+class AvailablePaymentMethods implements ResolverInterface
{
/**
* @var PaymentInformationManagementInterface
@@ -21,7 +25,6 @@ class AvailablePaymentMethodsDataProvider
private $informationManagement;
/**
- * AvailablePaymentMethodsDataProvider constructor.
* @param PaymentInformationManagementInterface $informationManagement
*/
public function __construct(PaymentInformationManagementInterface $informationManagement)
@@ -29,25 +32,37 @@ public function __construct(PaymentInformationManagementInterface $informationMa
$this->informationManagement = $informationManagement;
}
+ /**
+ * @inheritdoc
+ */
+ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
+ {
+ if (!isset($value['model'])) {
+ throw new LocalizedException(__('"model" value should be specified'));
+ }
+
+ $cart = $value['model'];
+ return $this->getPaymentMethodsData($cart);
+ }
+
/**
* Collect and return information about available payment methods
*
* @param CartInterface $cart
* @return array
*/
- public function getPaymentMethods(CartInterface $cart): array
+ private function getPaymentMethodsData(CartInterface $cart): array
{
$paymentInformation = $this->informationManagement->getPaymentInformation($cart->getId());
$paymentMethods = $paymentInformation->getPaymentMethods();
- $paymentMethodsNested = [];
+ $paymentMethodsData = [];
foreach ($paymentMethods as $paymentMethod) {
- $paymentMethodsNested[] = [
+ $paymentMethodsData[] = [
'title' => $paymentMethod->getTitle(),
- 'code' => $paymentMethod->getCode()
+ 'code' => $paymentMethod->getCode(),
];
}
-
- return $paymentMethodsNested;
+ return $paymentMethodsData;
}
}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethodsResolver.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethodsResolver.php
deleted file mode 100644
index 17747ec11b25a..0000000000000
--- a/app/code/Magento/QuoteGraphQl/Model/Resolver/AvailablePaymentMethodsResolver.php
+++ /dev/null
@@ -1,48 +0,0 @@
-addressDataProvider = $addressDataProvider;
- }
-
- /**
- * @inheritdoc
- */
- public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
- {
- if (!isset($value['model'])) {
- throw new LocalizedException(__('"model" value should be specified'));
- }
-
- $cart = $value['model'];
-
- return $this->addressDataProvider->getPaymentMethods($cart);
- }
-}
diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
index a505b87ccbae9..bab85f26b8b1e 100644
--- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
@@ -104,7 +104,7 @@ type Cart {
applied_coupon: AppliedCoupon
shipping_addresses: [CartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses")
billing_address: CartAddress! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress")
- available_payment_methods : [CheckoutPaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethodsResolver") @doc(description: "Available payment methods")
+ available_payment_methods : [CheckoutPaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "Available payment methods")
}
type CartAddress {
From fd114ecfbee9900e9abf8d6dfd8b14137c1ccad9 Mon Sep 17 00:00:00 2001
From: Valerii Naida
Date: Tue, 19 Feb 2019 17:06:20 -0600
Subject: [PATCH 131/254] GraphQL-292: [Payment methods] Get list of available
payment methods for current cart
---
app/code/Magento/QuoteGraphQl/etc/schema.graphqls | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
index bab85f26b8b1e..5749f830c1edc 100644
--- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
@@ -104,7 +104,7 @@ type Cart {
applied_coupon: AppliedCoupon
shipping_addresses: [CartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses")
billing_address: CartAddress! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress")
- available_payment_methods : [CheckoutPaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "Available payment methods")
+ available_payment_methods : [PaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "Available payment methods")
}
type CartAddress {
@@ -156,9 +156,9 @@ type AvailableShippingMethod {
price_incl_tax: Float!
}
-type CheckoutPaymentMethod @doc(description: "The type contains list of active payment methods") {
- code : String @doc(description: "The payment method code")
- title : String @doc(description: "The payment method title.")
+type PaymentMethod {
+ code: String @doc(description: "The payment method code")
+ title: String @doc(description: "The payment method title.")
}
enum AdressTypeEnum {
From 974152f8ab4a7b7f381e9c28e37ac3c7adaf08c5 Mon Sep 17 00:00:00 2001
From: Yogesh Suhagiya
Date: Wed, 20 Feb 2019 10:34:11 +0530
Subject: [PATCH 132/254] Applied some code format rules
---
app/code/Magento/Marketplace/Block/Partners.php | 2 +-
app/code/Magento/PageCache/Model/Cache/Server.php | 3 +--
.../PageCache/Model/System/Config/Backend/AccessList.php | 2 +-
app/code/Magento/PageCache/Model/Varnish/VclGenerator.php | 4 ++--
4 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/app/code/Magento/Marketplace/Block/Partners.php b/app/code/Magento/Marketplace/Block/Partners.php
index 4f8ca798f1756..a3ed88f4fc3b4 100644
--- a/app/code/Magento/Marketplace/Block/Partners.php
+++ b/app/code/Magento/Marketplace/Block/Partners.php
@@ -39,7 +39,7 @@ public function __construct(
/**
* Gets partners
*
- * @return bool|string
+ * @return array
*/
public function getPartners()
{
diff --git a/app/code/Magento/PageCache/Model/Cache/Server.php b/app/code/Magento/PageCache/Model/Cache/Server.php
index 349e9faffa673..06118446c21bc 100644
--- a/app/code/Magento/PageCache/Model/Cache/Server.php
+++ b/app/code/Magento/PageCache/Model/Cache/Server.php
@@ -62,8 +62,7 @@ public function getUris()
foreach ($configuredHosts as $host) {
$servers[] = UriFactory::factory('')
->setHost($host['host'])
- ->setPort(isset($host['port']) ? $host['port'] : self::DEFAULT_PORT)
- ;
+ ->setPort(isset($host['port']) ? $host['port'] : self::DEFAULT_PORT);
}
} elseif ($this->request->getHttpHost()) {
$servers[] = UriFactory::factory('')->setHost($this->request->getHttpHost())->setPort(self::DEFAULT_PORT);
diff --git a/app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php b/app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php
index e16584b0b17f8..7c9391ba22182 100644
--- a/app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php
+++ b/app/code/Magento/PageCache/Model/System/Config/Backend/AccessList.php
@@ -28,7 +28,7 @@ public function beforeSave()
throw new LocalizedException(
new Phrase(
'Access List value "%1" is not valid. '
- .'Please use only IP addresses and host names.',
+ . 'Please use only IP addresses and host names.',
[$value]
)
);
diff --git a/app/code/Magento/PageCache/Model/Varnish/VclGenerator.php b/app/code/Magento/PageCache/Model/Varnish/VclGenerator.php
index cf5a703142c84..5a7c3a2d2f6d1 100644
--- a/app/code/Magento/PageCache/Model/Varnish/VclGenerator.php
+++ b/app/code/Magento/PageCache/Model/Varnish/VclGenerator.php
@@ -119,7 +119,7 @@ private function getReplacements()
private function getRegexForDesignExceptions()
{
$result = '';
- $tpl = "%s (req.http.user-agent ~ \"%s\") {\n"." hash_data(\"%s\");\n"." }";
+ $tpl = "%s (req.http.user-agent ~ \"%s\") {\n" . " hash_data(\"%s\");\n" . " }";
$expressions = $this->getDesignExceptions();
@@ -157,7 +157,7 @@ private function getTransformedAccessList()
$result = array_reduce(
$this->getAccessList(),
function ($ips, $ip) use ($tpl) {
- return $ips.sprintf($tpl, trim($ip)) . "\n";
+ return $ips . sprintf($tpl, trim($ip)) . "\n";
},
''
);
From fbb5eacbf10e4b51c07c4f2e70f4c3a9d9cc10a1 Mon Sep 17 00:00:00 2001
From: Mila Lesechko
Date: Tue, 19 Feb 2019 23:34:14 -0600
Subject: [PATCH 133/254] Convert EditShippingAddressOnePageCheckoutTest to
MFTF
---
.../Catalog/Test/Mftf/Data/ProductData.xml | 17 ++++
.../FillShippingZipFormActionGroup.xml | 23 ++++++
.../StorefrontProductCartActionGroup.xml | 10 +++
.../Mftf/Section/CheckoutShippingSection.xml | 1 +
...ngAddressOnePageCheckoutTestVariation1.xml | 80 +++++++++++++++++++
...EditShippingAddressOnePageCheckoutTest.xml | 1 +
6 files changed, 132 insertions(+)
create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTestVariation1.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
index d136661e917cb..94c526de38605 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
@@ -729,4 +729,21 @@
13
0
+
+ sku_simple_product_
+ simple
+ 4
+ 4
+ Simple Product
+ 560
+ simple-product-
+ 1
+ 25
+ 1
+ 1
+ 1
+ 2
+ EavStockItem
+ CustomAttributeCategoryIds
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillShippingZipFormActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillShippingZipFormActionGroup.xml
index f12bf4344ab12..1278ba3afb85b 100644
--- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillShippingZipFormActionGroup.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/FillShippingZipFormActionGroup.xml
@@ -20,4 +20,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml
index 24ed05583b6fb..fbba37c22c8af 100644
--- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml
@@ -112,4 +112,14 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml
index a182a3357a9ce..d825e10395145 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingSection.xml
@@ -27,6 +27,7 @@
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTestVariation1.xml b/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTestVariation1.xml
new file mode 100644
index 0000000000000..d1eb09af976c5
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/EditShippingAddressOnePageCheckoutTestVariation1.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/EditShippingAddressOnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/EditShippingAddressOnePageCheckoutTest.xml
index 3c88d9193db28..51bcad08ce349 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/EditShippingAddressOnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/EditShippingAddressOnePageCheckoutTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
severity:S1
johndoe_with_addresses
UK_address_without_email
From f78a3e1b3c6130b8890f1952c38d430b3be04171 Mon Sep 17 00:00:00 2001
From: "rostyslav.hymon"
Date: Wed, 20 Feb 2019 08:27:57 +0200
Subject: [PATCH 134/254] MAGETWO-98087: [2.3] Customer Group Regression issues
from MAGETWO-96886
---
app/code/Magento/Backend/Model/Session/Quote.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/code/Magento/Backend/Model/Session/Quote.php b/app/code/Magento/Backend/Model/Session/Quote.php
index e32f1bc57596e..ed0312874565c 100644
--- a/app/code/Magento/Backend/Model/Session/Quote.php
+++ b/app/code/Magento/Backend/Model/Session/Quote.php
@@ -24,6 +24,7 @@
* @method Quote setOrderId($orderId)
* @method int getOrderId()
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @since 100.0.2
*/
class Quote extends \Magento\Framework\Session\SessionManager
From a29ecf4196e83723a39127202aa893b51cedb346 Mon Sep 17 00:00:00 2001
From: Vitaliy Boyko
Date: Wed, 20 Feb 2019 10:31:30 +0200
Subject: [PATCH 135/254] graphQl-352: removed redundant dataprovider
---
.../Customer/IsEmailAvailableDataProvider.php | 40 -------------------
.../Model/Resolver/IsEmailAvailable.php | 14 +++----
2 files changed, 7 insertions(+), 47 deletions(-)
delete mode 100644 app/code/Magento/CustomerGraphQl/Model/Customer/IsEmailAvailableDataProvider.php
diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/IsEmailAvailableDataProvider.php b/app/code/Magento/CustomerGraphQl/Model/Customer/IsEmailAvailableDataProvider.php
deleted file mode 100644
index 9ec4ab9377ead..0000000000000
--- a/app/code/Magento/CustomerGraphQl/Model/Customer/IsEmailAvailableDataProvider.php
+++ /dev/null
@@ -1,40 +0,0 @@
-accountManagement = $accountManagement;
- }
-
- /**
- * Check is Email available
- *
- * @param string $email
- * @return bool
- */
- public function execute(string $email): bool
- {
- return $this->accountManagement->isEmailAvailable($email);
- }
-}
diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/IsEmailAvailable.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/IsEmailAvailable.php
index a5edb78e67bfd..11ad0f77f8949 100644
--- a/app/code/Magento/CustomerGraphQl/Model/Resolver/IsEmailAvailable.php
+++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/IsEmailAvailable.php
@@ -7,7 +7,7 @@
namespace Magento\CustomerGraphQl\Model\Resolver;
-use Magento\CustomerGraphQl\Model\Customer\IsEmailAvailableDataProvider;
+use Magento\Customer\Api\AccountManagementInterface;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
use Magento\Framework\GraphQl\Query\ResolverInterface;
@@ -19,17 +19,17 @@
class IsEmailAvailable implements ResolverInterface
{
/**
- * @var IsEmailAvailableDataProvider
+ * @var AccountManagementInterface
*/
- private $isEmailAvailableDataProvider;
+ private $accountManagement;
/**
- * @param IsEmailAvailableDataProvider $isEmailAvailableDataProvider
+ * @param AccountManagementInterface $accountManagement
*/
public function __construct(
- IsEmailAvailableDataProvider $isEmailAvailableDataProvider
+ AccountManagementInterface $accountManagement
) {
- $this->isEmailAvailableDataProvider = $isEmailAvailableDataProvider;
+ $this->accountManagement = $accountManagement;
}
/**
@@ -46,7 +46,7 @@ public function resolve(
if (!$email) {
throw new GraphQlInputException(__('"Email should be specified'));
}
- $isEmailAvailable = $this->isEmailAvailableDataProvider->execute($email);
+ $isEmailAvailable = $this->accountManagement->isEmailAvailable($email);
return [
'is_email_available' => $isEmailAvailable
From 7c42d2afd9ca4d182d473b95dd2b4afe1c0152cc Mon Sep 17 00:00:00 2001
From: Vitaliy Boyko
Date: Wed, 20 Feb 2019 11:09:27 +0200
Subject: [PATCH 136/254] graphQl-292: added test coverage for payment methods
---
.../Quote/GetAvailablePaymentMethodsTest.php | 152 ++++++++++++++++++
1 file changed, 152 insertions(+)
create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetAvailablePaymentMethodsTest.php
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetAvailablePaymentMethodsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetAvailablePaymentMethodsTest.php
new file mode 100644
index 0000000000000..d6eff6816b342
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetAvailablePaymentMethodsTest.php
@@ -0,0 +1,152 @@
+quoteResource = $objectManager->create(QuoteResource::class);
+ $this->quote = $objectManager->create(Quote::class);
+ $this->quoteIdToMaskedId = $objectManager->create(QuoteIdToMaskedQuoteIdInterface::class);
+ $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_items_saved.php
+ */
+ public function testGetCartWithPaymentMethodsForRegisteredCustomer()
+ {
+ $reservedOrderId = 'test_order_item_with_items';
+ $this->quoteResource->load(
+ $this->quote,
+ $reservedOrderId,
+ 'reserved_order_id'
+ );
+
+ $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+ $query = $this->prepareGetCartQuery($maskedQuoteId);
+
+ $response = $this->sendRequestWithToken($query);
+
+ self::assertArrayHasKey('cart', $response);
+ self::assertNotEmpty($response['cart']['items']);
+ self::assertNotEmpty($response['cart']['available_payment_methods']);
+ self::assertCount(1, $response['cart']['available_payment_methods']);
+ self::assertEquals('checkmo', $response['cart']['available_payment_methods'][0]['code']);
+ self::assertEquals('Check / Money order', $response['cart']['available_payment_methods'][0]['title']);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
+ */
+ public function testGetCartWithPaymentMethodsForGuest()
+ {
+ $reservedOrderId = 'test_order_1';
+ $this->quoteResource->load(
+ $this->quote,
+ $reservedOrderId,
+ 'reserved_order_id'
+ );
+
+ $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
+ $query = $this->prepareGetCartQuery($maskedQuoteId);
+
+ $response = $this->graphQlQuery($query);
+
+ self::assertArrayHasKey('cart', $response);
+
+ self::assertNotEmpty($response['cart']['available_payment_methods']);
+ self::assertCount(2, $response['cart']['available_payment_methods']);
+ self::assertEquals('checkmo', $response['cart']['available_payment_methods'][0]['code']);
+ self::assertEquals('Check / Money order', $response['cart']['available_payment_methods'][0]['title']);
+ self::assertEquals('free', $response['cart']['available_payment_methods'][1]['code']);
+ self::assertEquals(
+ 'No Payment Information Required',
+ $response['cart']['available_payment_methods'][1]['title']
+ );
+ }
+
+ /**
+ * Generates query for setting the specified shipping method on cart
+ *
+ * @param string $maskedQuoteId
+ * @return string
+ */
+ private function prepareGetCartQuery(
+ string $maskedQuoteId
+ ) : string {
+ return <<customerTokenService->createCustomerAccessToken('customer@example.com', 'password');
+ $headerMap = ['Authorization' => 'Bearer ' . $customerToken];
+
+ return $this->graphQlQuery($query, [], '', $headerMap);
+ }
+}
From 0df8d31c7b55c9fe49339df24ae45170749054f8 Mon Sep 17 00:00:00 2001
From: mageprince
Date: Wed, 20 Feb 2019 16:56:11 +0530
Subject: [PATCH 137/254] Show error message if no any product slected from
recent order group
---
app/code/Magento/Checkout/Controller/Cart/Addgroup.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/code/Magento/Checkout/Controller/Cart/Addgroup.php b/app/code/Magento/Checkout/Controller/Cart/Addgroup.php
index c205f3c16072f..948d55c4c98a4 100644
--- a/app/code/Magento/Checkout/Controller/Cart/Addgroup.php
+++ b/app/code/Magento/Checkout/Controller/Cart/Addgroup.php
@@ -74,6 +74,8 @@ public function execute()
}
}
$this->cart->save();
+ } else {
+ $this->messageManager->addErrorMessage(__('Please select atleast one product to add to cart'));
}
return $this->_goBack();
}
From 78916b3f987d47febbdf443b8839baca780e9c02 Mon Sep 17 00:00:00 2001
From: nmalevanec
Date: Wed, 20 Feb 2019 13:30:27 +0200
Subject: [PATCH 138/254] Fix static tests.
---
lib/internal/Magento/Framework/Module/ModuleList/Loader.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/internal/Magento/Framework/Module/ModuleList/Loader.php b/lib/internal/Magento/Framework/Module/ModuleList/Loader.php
index 80958f65e110e..72421f793f131 100644
--- a/lib/internal/Magento/Framework/Module/ModuleList/Loader.php
+++ b/lib/internal/Magento/Framework/Module/ModuleList/Loader.php
@@ -134,7 +134,7 @@ private function sortBySequence(array $origList): array
$modules = $this->prearrangeModules($origList);
$expanded = [];
- foreach ($modules as $moduleName => $value) {
+ foreach (array_keys($modules) as $moduleName) {
$sequence = $this->expandSequence($origList, $moduleName);
asort($sequence);
From b63123e693fe7f950318ed6550d71494661fea89 Mon Sep 17 00:00:00 2001
From: mageprince
Date: Wed, 20 Feb 2019 17:12:37 +0530
Subject: [PATCH 139/254] Solve page break on long string search
---
.../Magento/luma/Magento_Theme/web/css/source/_module.less | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
index 99da7716f9274..9f0997ed2ba85 100644
--- a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
+++ b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
@@ -503,6 +503,7 @@
> .page-title-wrapper {
.page-title {
display: inline-block;
+ word-break: break-all;
}
.page-title + .action {
From 1236770b10b14969a69ac81725a6bab781011ffd Mon Sep 17 00:00:00 2001
From: mageprince
Date: Wed, 20 Feb 2019 17:30:37 +0530
Subject: [PATCH 140/254] Move css to general for all devices
---
.../luma/Magento_Theme/web/css/source/_module.less | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
index 9f0997ed2ba85..4d990a82cb7e4 100644
--- a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
+++ b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
@@ -77,6 +77,14 @@
.lib-vendor-prefix-flex-grow(1);
}
+ .page-main {
+ > .page-title-wrapper {
+ .page-title {
+ word-break: break-all;
+ }
+ }
+ }
+
//
// Header
// ---------------------------------------------
@@ -503,7 +511,6 @@
> .page-title-wrapper {
.page-title {
display: inline-block;
- word-break: break-all;
}
.page-title + .action {
From adccc57a67718d5e527e08308e467c78d02d2568 Mon Sep 17 00:00:00 2001
From: mageprince
Date: Wed, 20 Feb 2019 17:44:40 +0530
Subject: [PATCH 141/254] Change error message
---
app/code/Magento/Checkout/Controller/Cart/Addgroup.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Checkout/Controller/Cart/Addgroup.php b/app/code/Magento/Checkout/Controller/Cart/Addgroup.php
index 948d55c4c98a4..f32fd9504c77d 100644
--- a/app/code/Magento/Checkout/Controller/Cart/Addgroup.php
+++ b/app/code/Magento/Checkout/Controller/Cart/Addgroup.php
@@ -75,7 +75,7 @@ public function execute()
}
$this->cart->save();
} else {
- $this->messageManager->addErrorMessage(__('Please select atleast one product to add to cart'));
+ $this->messageManager->addErrorMessage(__('Please select at least one product to add to cart'));
}
return $this->_goBack();
}
From b8bbd973153808c97205b239e5ec3c1b815d9960 Mon Sep 17 00:00:00 2001
From: serhii balko
Date: Wed, 20 Feb 2019 15:21:38 +0200
Subject: [PATCH 142/254] MAGETWO-97396: Tax applied on child product is based
on Tax Class of parent product
---
.../Sales/Total/Quote/CommonTaxCollector.php | 44 +++++++++
.../Total/Quote/CommonTaxCollectorTest.php | 94 +++++++++++++++++++
.../Magento/ConfigurableProduct/composer.json | 3 +-
.../Magento/ConfigurableProduct/etc/di.xml | 3 +
4 files changed, 143 insertions(+), 1 deletion(-)
create mode 100644 app/code/Magento/ConfigurableProduct/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php
create mode 100644 app/code/Magento/ConfigurableProduct/Test/Unit/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
diff --git a/app/code/Magento/ConfigurableProduct/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php b/app/code/Magento/ConfigurableProduct/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php
new file mode 100644
index 0000000000000..8bdde2aeb0cff
--- /dev/null
+++ b/app/code/Magento/ConfigurableProduct/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php
@@ -0,0 +1,44 @@
+getProduct()->getTypeId() === Configurable::TYPE_CODE && $item->getHasChildren()) {
+ $childItem = $item->getChildren()[0];
+ $result->getTaxClassKey()->setValue($childItem->getProduct()->getTaxClassId());
+ }
+
+ return $result;
+ }
+}
diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollectorTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
new file mode 100644
index 0000000000000..9007eed40ae9b
--- /dev/null
+++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
@@ -0,0 +1,94 @@
+objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
+ $this->commonTaxCollectorPlugin = $this->objectManager->getObject(CommonTaxCollectorPlugin::class);
+ }
+
+ /**
+ * Test to apply Tax Class Id from child item for configurable product
+ */
+ public function testAfterMapItem()
+ {
+ $childTaxClassId = 10;
+
+ /** @var Product|MockObject $childProductMock */
+ $childProductMock = $this->createPartialMock(
+ Product::class,
+ ['getTaxClassId']
+ );
+ $childProductMock->method('getTaxClassId')->willReturn($childTaxClassId);
+ /* @var AbstractItem|MockObject $quoteItemMock */
+ $childQuoteItemMock = $this->createMock(
+ AbstractItem::class
+ );
+ $childQuoteItemMock->method('getProduct')->willReturn($childProductMock);
+
+ /** @var Product|MockObject $productMock */
+ $productMock = $this->createPartialMock(
+ Product::class,
+ ['getTypeId']
+ );
+ $productMock->method('getTypeId')->willReturn(Configurable::TYPE_CODE);
+ /* @var AbstractItem|MockObject $quoteItemMock */
+ $quoteItemMock = $this->createPartialMock(
+ AbstractItem::class,
+ ['getProduct', 'getHasChildren', 'getChildren', 'getQuote', 'getAddress', 'getOptionByCode']
+ );
+ $quoteItemMock->method('getProduct')->willReturn($productMock);
+ $quoteItemMock->method('getHasChildren')->willReturn(true);
+ $quoteItemMock->method('getChildren')->willReturn([$childQuoteItemMock]);
+
+ /* @var TaxClassKeyInterface|MockObject $taxClassObjectMock */
+ $taxClassObjectMock = $this->createMock(TaxClassKeyInterface::class);
+ $taxClassObjectMock->method('setValue')->with($childTaxClassId);
+
+ /* @var QuoteDetailsItemInterface|MockObject $quoteDetailsItemMock */
+ $quoteDetailsItemMock = $this->createMock(QuoteDetailsItemInterface::class);
+ $quoteDetailsItemMock->method('getTaxClassKey')->willReturn($taxClassObjectMock);
+
+ $this->commonTaxCollectorPlugin->afterMapItem(
+ $this->createMock(CommonTaxCollector::class),
+ $quoteDetailsItemMock,
+ $this->createMock(QuoteDetailsItemInterfaceFactory::class),
+ $quoteItemMock
+ );
+ }
+}
diff --git a/app/code/Magento/ConfigurableProduct/composer.json b/app/code/Magento/ConfigurableProduct/composer.json
index e795ea7cd3618..76096fd6bdf67 100644
--- a/app/code/Magento/ConfigurableProduct/composer.json
+++ b/app/code/Magento/ConfigurableProduct/composer.json
@@ -25,7 +25,8 @@
"magento/module-sales-rule": "*",
"magento/module-product-video": "*",
"magento/module-configurable-sample-data": "*",
- "magento/module-product-links-sample-data": "*"
+ "magento/module-product-links-sample-data": "*",
+ "magento/module-tax": "*"
},
"type": "magento2-module",
"license": [
diff --git a/app/code/Magento/ConfigurableProduct/etc/di.xml b/app/code/Magento/ConfigurableProduct/etc/di.xml
index 0ae9ffde66f43..06134fcbf09d8 100644
--- a/app/code/Magento/ConfigurableProduct/etc/di.xml
+++ b/app/code/Magento/ConfigurableProduct/etc/di.xml
@@ -245,4 +245,7 @@
+
+
+
From f5e4fb76e8473e50b388cc5a0588d8f2852cdad6 Mon Sep 17 00:00:00 2001
From: Alex Calandra
Date: Wed, 20 Feb 2019 08:28:24 -0600
Subject: [PATCH 143/254] MC-4543: Convert MassAssignCustomerGroupTest to MFTF
- Adding Tests for Mass Assigning Customers to Groups
---
.../AdminDeleteCustomerGroupActionGroup.xml | 4 +-
.../AdminFilterCustomerByNameActionGroup.xml | 20 ++++++
.../AdminSelectAllCustomersActionGroup.xml | 14 ++++
.../AdminSelectCustomerByEmailActionGroup.xml | 17 +++++
.../NavigateCustomerActionGroup.xml | 15 ++++
.../NavigateCustomerGroupActionGroup.xml | 15 ++++
.../SetGroupCustomerActionGroup.xml | 22 ++++++
.../VerifyGroupCustomerActionGroup.xml | 20 ++++++
.../Test/Mftf/Data/CustomerGroupData.xml | 5 ++
.../Mftf/Section/AdminCustomerGridSection.xml | 3 +
.../AdminEditCustomerInformationSection.xml | 1 +
.../Mftf/Section/CustomersPageSection.xml | 2 +
.../Mftf/Test/ChangeCustomerGroupTest.xml | 70 +++++++++++++++++++
13 files changed, 206 insertions(+), 2 deletions(-)
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerByNameActionGroup.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSelectAllCustomersActionGroup.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSelectCustomerByEmailActionGroup.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/NavigateCustomerActionGroup.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/NavigateCustomerGroupActionGroup.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/SetGroupCustomerActionGroup.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/VerifyGroupCustomerActionGroup.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerGroupActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerGroupActionGroup.xml
index 2609f0ab5c0d6..788e5f8967f43 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerGroupActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteCustomerGroupActionGroup.xml
@@ -18,8 +18,8 @@
-
-
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerByNameActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerByNameActionGroup.xml
new file mode 100644
index 0000000000000..c49a0dbe20ae7
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerByNameActionGroup.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSelectAllCustomersActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSelectAllCustomersActionGroup.xml
new file mode 100644
index 0000000000000..1a8b4da67e74a
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSelectAllCustomersActionGroup.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSelectCustomerByEmailActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSelectCustomerByEmailActionGroup.xml
new file mode 100644
index 0000000000000..bb84d578fd9ed
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSelectCustomerByEmailActionGroup.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/NavigateCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/NavigateCustomerActionGroup.xml
new file mode 100644
index 0000000000000..be639d245f022
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/NavigateCustomerActionGroup.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/NavigateCustomerGroupActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/NavigateCustomerGroupActionGroup.xml
new file mode 100644
index 0000000000000..076797f349107
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/NavigateCustomerGroupActionGroup.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SetGroupCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SetGroupCustomerActionGroup.xml
new file mode 100644
index 0000000000000..d1123ea858f0b
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SetGroupCustomerActionGroup.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/VerifyGroupCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/VerifyGroupCustomerActionGroup.xml
new file mode 100644
index 0000000000000..712d3a59a2144
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/VerifyGroupCustomerActionGroup.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Data/CustomerGroupData.xml b/app/code/Magento/Customer/Test/Mftf/Data/CustomerGroupData.xml
index c1f11c9e9c390..6b4f3fc9d6b6e 100644
--- a/app/code/Magento/Customer/Test/Mftf/Data/CustomerGroupData.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Data/CustomerGroupData.xml
@@ -13,6 +13,11 @@
3
Retail Customer
+
+ Group_
+ 3
+ Retail Customer
+
- General
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml
index d9d3bfe7f737c..b3c4e2361fdcb 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerGridSection.xml
@@ -11,5 +11,8 @@
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml
index f5bbb84eaa593..8c2e481bc908b 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerInformationSection.xml
@@ -11,5 +11,6 @@
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/CustomersPageSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/CustomersPageSection.xml
index 60c635387199a..1af43c9aa81f0 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/CustomersPageSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/CustomersPageSection.xml
@@ -12,6 +12,8 @@
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
new file mode 100644
index 0000000000000..90ea5c2be8c97
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 544485428178dd0a107f7fdf9df4a753a6a455d9 Mon Sep 17 00:00:00 2001
From: serhii balko
Date: Wed, 20 Feb 2019 17:00:01 +0200
Subject: [PATCH 144/254] MAGETWO-97396: Tax applied on child product is based
on Tax Class of parent product
---
.../Tax/Model/Sales/Total/Quote/CommonTaxCollectorTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/ConfigurableProduct/Test/Unit/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollectorTest.php b/app/code/Magento/ConfigurableProduct/Test/Unit/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
index 9007eed40ae9b..1a5c6c0003bfa 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Unit/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
+++ b/app/code/Magento/ConfigurableProduct/Test/Unit/Plugin/Tax/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
@@ -78,7 +78,7 @@ public function testAfterMapItem()
/* @var TaxClassKeyInterface|MockObject $taxClassObjectMock */
$taxClassObjectMock = $this->createMock(TaxClassKeyInterface::class);
- $taxClassObjectMock->method('setValue')->with($childTaxClassId);
+ $taxClassObjectMock->expects($this->once())->method('setValue')->with($childTaxClassId);
/* @var QuoteDetailsItemInterface|MockObject $quoteDetailsItemMock */
$quoteDetailsItemMock = $this->createMock(QuoteDetailsItemInterface::class);
From ada2a0464fd0f719d3ce2dba483877517e5cb684 Mon Sep 17 00:00:00 2001
From: Alex Calandra
Date: Wed, 20 Feb 2019 09:29:22 -0600
Subject: [PATCH 145/254] MC-4543: Convert MassAssignCustomerGroupTest to MFTF
- Making action group clearer
---
.../Test/Mftf/ActionGroup/SetGroupCustomerActionGroup.xml | 2 +-
.../Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SetGroupCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SetGroupCustomerActionGroup.xml
index d1123ea858f0b..ca5e16c4ddb40 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/SetGroupCustomerActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/SetGroupCustomerActionGroup.xml
@@ -8,7 +8,7 @@
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
index 90ea5c2be8c97..9948ba3cf6cfe 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
@@ -41,7 +41,7 @@
-
+
From e0d5a9d5df287b7394fd2788e64f3f70dbfcf945 Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Wed, 20 Feb 2019 09:37:20 -0600
Subject: [PATCH 146/254] MQE-1453: Deliver weekly PR
- Fix reference to incorrect Add New Product Attribute button
---
.../Test/Mftf/Section/AdminProductAttributeGridSection.xml | 2 +-
.../AdminCreateCustomProductAttributeWithDropdownFieldTest.xml | 2 +-
.../Test/AdminCreateProductAttributeFromProductPageTest.xml | 2 +-
.../Test/AdminCreateProductAttributeRequiredTextFieldTest.xml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml
index 12cc788ae06ae..5efd04eacb719 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeGridSection.xml
@@ -10,7 +10,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml
index 5b6a0b7f2ab3e..09b49011938e8 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCustomProductAttributeWithDropdownFieldTest.xml
@@ -59,7 +59,7 @@
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml
index 5badcc366ac3a..5c798db29b976 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeFromProductPageTest.xml
@@ -59,7 +59,7 @@
-
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml
index 176af624022e4..d4d6496e018f5 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateProductAttributeRequiredTextFieldTest.xml
@@ -57,7 +57,7 @@
-
+
From 6e8277e5313aa9c40ec7c25c59f3f0394940cff1 Mon Sep 17 00:00:00 2001
From: John S
Date: Wed, 20 Feb 2019 09:48:31 -0600
Subject: [PATCH 147/254] MC-4526: Convert
VerifyConfigurableProductLayeredNavigationTest to MFTF
- Correcting an argument reference in an Action Group.
- Replaced "waitForLoadingMaskToDisappear" with "waitForPageLoad".
---
.../ActionGroup/StorefrontProductAttributeActionGroup.xml | 4 ++--
...refrontVerifyConfigurableProductLayeredNavigationTest.xml | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductAttributeActionGroup.xml
index 8fab65527315e..7780827381533 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductAttributeActionGroup.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductAttributeActionGroup.xml
@@ -14,7 +14,7 @@
-
+
@@ -23,4 +23,4 @@
-
\ No newline at end of file
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml
index a230b6851da73..bb69122dc0be9 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontVerifyConfigurableProductLayeredNavigationTest.xml
@@ -5,6 +5,7 @@
* See COPYING.txt for license details.
*/
-->
+
@@ -131,7 +132,7 @@
-
+
@@ -145,4 +146,4 @@
-
\ No newline at end of file
+
From 72c39f18142583f6123ab92f2ea0d5c694f95a17 Mon Sep 17 00:00:00 2001
From: Alex Calandra
Date: Wed, 20 Feb 2019 10:29:34 -0600
Subject: [PATCH 148/254] MC-4543: Convert MassAssignCustomerGroupTest to MFTF
- Removing unused argument from action group reference
---
.../Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
index 9948ba3cf6cfe..0cf6f986c4fa8 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
@@ -63,8 +63,6 @@
-
-
-
+
From 01bfe90b33206d352b14a80a2a2bdafafd90a7f9 Mon Sep 17 00:00:00 2001
From: Oleksandr Iegorov
Date: Wed, 20 Feb 2019 10:48:15 -0600
Subject: [PATCH 149/254] MAGETWO-98328: Update FedEx Shipping Dates behavior
in Tracking Popup
---
.../Fedex/Plugin/Block/DataProviders/Tracking/ChangeTitle.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Fedex/Plugin/Block/DataProviders/Tracking/ChangeTitle.php b/app/code/Magento/Fedex/Plugin/Block/DataProviders/Tracking/ChangeTitle.php
index d148b91aa3e7a..86a576f2db650 100644
--- a/app/code/Magento/Fedex/Plugin/Block/DataProviders/Tracking/ChangeTitle.php
+++ b/app/code/Magento/Fedex/Plugin/Block/DataProviders/Tracking/ChangeTitle.php
@@ -16,13 +16,15 @@
class ChangeTitle
{
/**
+ * Title modification in case if FedEx used as carrier
+ *
* @param Subject $subject
* @param \Magento\Framework\Phrase|string $result
* @param Status $trackingStatus
* @return \Magento\Framework\Phrase|string
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function afterGetTitle(Subject $subject, $result, Status $trackingStatus): string
+ public function afterGetTitle(Subject $subject, $result, Status $trackingStatus)
{
if ($trackingStatus->getCarrier() === Carrier::CODE) {
$result = __('Expected Delivery:');
From 0a56988e31ba69f2fb48500f98ee393fce0bf8d7 Mon Sep 17 00:00:00 2001
From: Oleksandr Iegorov
Date: Wed, 20 Feb 2019 11:07:31 -0600
Subject: [PATCH 150/254] MAGETWO-98328: Update FedEx Shipping Dates behavior
in Tracking Popup
---
.../Shipping/Block/DataProviders/Tracking/DeliveryDateTitle.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/code/Magento/Shipping/Block/DataProviders/Tracking/DeliveryDateTitle.php b/app/code/Magento/Shipping/Block/DataProviders/Tracking/DeliveryDateTitle.php
index dc66c4f0bd018..ec1ee277a5a51 100644
--- a/app/code/Magento/Shipping/Block/DataProviders/Tracking/DeliveryDateTitle.php
+++ b/app/code/Magento/Shipping/Block/DataProviders/Tracking/DeliveryDateTitle.php
@@ -15,6 +15,8 @@
class DeliveryDateTitle implements ArgumentInterface
{
/**
+ * Returns Title in case if carrier defined
+ *
* @param Status $trackingStatus
* @return \Magento\Framework\Phrase|string
*/
From 9a0c504199f414bf8dfc9d286d6fda48f5fd208b Mon Sep 17 00:00:00 2001
From: Amol2jcommerce
Date: Wed, 20 Feb 2019 23:27:53 +0530
Subject: [PATCH 151/254] CSS-Property-name-issue
---
.../Magento/blank/Magento_Swatches/web/css/source/_module.less | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/design/frontend/Magento/blank/Magento_Swatches/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Swatches/web/css/source/_module.less
index 28aa3f187e95c..8824624d1c63a 100644
--- a/app/design/frontend/Magento/blank/Magento_Swatches/web/css/source/_module.less
+++ b/app/design/frontend/Magento/blank/Magento_Swatches/web/css/source/_module.less
@@ -110,7 +110,7 @@
.lib-css(color, @attr-swatch-option__color);
&.selected {
- .lib-css(blackground, @attr-swatch-option__selected__background);
+ .lib-css(background, @attr-swatch-option__selected__background);
.lib-css(border, @attr-swatch-option__selected__border);
.lib-css(color, @attr-swatch-option__selected__color);
}
From a68e81575c158b92505cc5e3c300ca551fae5cf7 Mon Sep 17 00:00:00 2001
From: Amol2jcommerce
Date: Wed, 20 Feb 2019 23:33:33 +0530
Subject: [PATCH 152/254] unwanted changes reverted CSS-Property-name-issue
---
.../Magento/blank/Magento_Customer/web/css/source/_module.less | 2 +-
.../Magento/luma/Magento_Customer/web/css/source/_module.less | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less b/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less
index a94fedbcbbd14..9df59ca5dac92 100644
--- a/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less
+++ b/app/design/frontend/Magento/blank/Magento_Customer/web/css/source/_module.less
@@ -421,7 +421,7 @@
> .field {
> .control {
- width: 80%;
+ width: 55%;
}
}
}
diff --git a/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
index 61fc2610fc2e5..2e7856d390bd0 100755
--- a/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
+++ b/app/design/frontend/Magento/luma/Magento_Customer/web/css/source/_module.less
@@ -375,7 +375,7 @@
.fieldset {
> .field {
> .control {
- width: 80%;
+ width: 55%;
}
}
}
From ecf6ddd231dff70ad5e2011b71ef9f8a2d3c0e94 Mon Sep 17 00:00:00 2001
From: Oleksandr Iegorov
Date: Wed, 20 Feb 2019 13:21:14 -0600
Subject: [PATCH 153/254] MAGETWO-98328: Update FedEx Shipping Dates behavior
in Tracking Popup
---
.../Magento/Fedex/Plugin/Block/Tracking/PopupDeliveryDate.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/code/Magento/Fedex/Plugin/Block/Tracking/PopupDeliveryDate.php b/app/code/Magento/Fedex/Plugin/Block/Tracking/PopupDeliveryDate.php
index 942d21dfa5e47..e1597707f9d02 100644
--- a/app/code/Magento/Fedex/Plugin/Block/Tracking/PopupDeliveryDate.php
+++ b/app/code/Magento/Fedex/Plugin/Block/Tracking/PopupDeliveryDate.php
@@ -3,7 +3,6 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-declare(strict_types=1);
namespace Magento\Fedex\Plugin\Block\Tracking;
@@ -26,7 +25,7 @@ class PopupDeliveryDate
* @return string
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function afterFormatDeliveryDateTime(Popup $subject, string $result, string $date, string $time): string
+ public function afterFormatDeliveryDateTime(Popup $subject, $result, $date, $time)
{
if ($this->getCarrier($subject) === Carrier::CODE) {
$result = $subject->formatDeliveryDate($date);
From ec3162997f44ff03676ac4f1cd6e025c229d6352 Mon Sep 17 00:00:00 2001
From: John S
Date: Wed, 20 Feb 2019 14:33:31 -0600
Subject: [PATCH 154/254] MC-4543: Convert MassAssignCustomerGroupTest to MFTF
- Fixing text alignment.
- Adding setup/cleanup steps to the "before"/"after" blocks.
- Fixing data references in the "actionGroups".
---
.../Mftf/Test/ChangeCustomerGroupTest.xml | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
index 9948ba3cf6cfe..b6b4ae667db78 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/ChangeCustomerGroupTest.xml
@@ -6,7 +6,8 @@
*/
-->
-
+
@@ -20,6 +21,8 @@
+
+
@@ -28,30 +31,33 @@
+
+
-
+
-
+
-
+
-
+
-
+
+
@@ -62,6 +68,7 @@
+
From 139d4fa0676397aded13f512c28560655a31aca6 Mon Sep 17 00:00:00 2001
From: Nathan Smith
Date: Wed, 20 Feb 2019 15:10:43 -0600
Subject: [PATCH 155/254] MC-15020: Customer attribute of type file causes
customer page to not load
- Declared hidden dependency
---
.../Magento/Ui/view/base/web/js/form/element/file-uploader.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js b/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js
index 357571350a268..c6bf36f5cc867 100644
--- a/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/file-uploader.js
@@ -16,7 +16,8 @@ define([
'Magento_Ui/js/form/element/abstract',
'mage/backend/notification',
'mage/translate',
- 'jquery/file-uploader'
+ 'jquery/file-uploader',
+ 'mage/adminhtml/tools'
], function ($, _, utils, uiAlert, validator, Element, notification, $t) {
'use strict';
From dc7d112ad0038aa022b94ab9e2fbb20ec1e571d3 Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Wed, 20 Feb 2019 15:25:32 -0600
Subject: [PATCH 156/254] MC-13679: Forgot Password on Storefront validates
customer email input
- Fixed annotatations and seeInCurrentUrl
---
.../Customer/Test/Mftf/Test/StorefrontForgotPasswordTest.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontForgotPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontForgotPasswordTest.xml
index acacc2c063f7c..12e603bd3748c 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontForgotPasswordTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontForgotPasswordTest.xml
@@ -17,7 +17,7 @@
-
+
@@ -34,7 +34,7 @@
-
+
From 3fcc13cd385c531d3742b7ddbf550038ea5d0cae Mon Sep 17 00:00:00 2001
From: Serhii Dzhepa
Date: Wed, 20 Feb 2019 15:34:43 -0600
Subject: [PATCH 157/254] Fixed test for case locator is overlaped
---
.../Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml
index 593bf95392633..537ffbd475b87 100644
--- a/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml
+++ b/app/code/Magento/Config/Test/Mftf/ActionGroup/ConfigSalesTaxClassActionGroup.xml
@@ -49,11 +49,11 @@
-
+
-
\ No newline at end of file
+
From b9f9408349af2090e6f082cf52c7fe717bb052ec Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Wed, 20 Feb 2019 15:47:03 -0600
Subject: [PATCH 158/254] MC-10916: Update Customer Password on Storefront,
Valid Current Password
- Fix mtf_migrated annotation
---
.../Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml
index 38ea0de6f05a1..9bc253c91af92 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerPasswordTest.xml
@@ -17,7 +17,7 @@
-
+
@@ -53,7 +53,7 @@
-
+
@@ -70,7 +70,7 @@
-
+
From b392c7cf48c78ad499ede0d80a67b6471908d703 Mon Sep 17 00:00:00 2001
From: Cristian Partica
Date: Wed, 20 Feb 2019 17:34:37 -0600
Subject: [PATCH 159/254] MC-15000: Add New Attribute on the admin product page
with JS error
- validation has be called as a function inside the component
---
.../view/adminhtml/web/catalog/product/edit/attribute.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/edit/attribute.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/edit/attribute.js
index 407fd1fe28e39..e1923dc46d68e 100644
--- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/edit/attribute.js
+++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/product/edit/attribute.js
@@ -5,13 +5,13 @@
define([
'jquery',
- 'mage/mage'
+ 'mage/mage',
+ 'validation'
], function ($) {
'use strict';
return function (config, element) {
-
- $(element).mage('form').mage('validation', {
+ $(element).mage('form').validation({
validationUrl: config.validationUrl
});
};
From c67c3fc8bf3d50bb25047b6be835ae99bd167914 Mon Sep 17 00:00:00 2001
From: Cristian Partica
Date: Wed, 20 Feb 2019 17:45:02 -0600
Subject: [PATCH 160/254] MC-15000: Add New Attribute on the admin product page
with JS error
- remove unused phtml file
---
.../adminhtml/templates/class/page/edit.phtml | 20 -------------------
.../view/adminhtml/web/js/page/validate.js | 15 --------------
2 files changed, 35 deletions(-)
delete mode 100644 app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml
delete mode 100644 app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js
diff --git a/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml b/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml
deleted file mode 100644
index 18e86549a1ff9..0000000000000
--- a/app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
- = $block->getBackButtonHtml() ?>
- = $block->getResetButtonHtml() ?>
- = $block->getDeleteButtonHtml() ?>
- = $block->getSaveButtonHtml() ?>
-
-= $block->getRenameFormHtml() ?>
-
diff --git a/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js b/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js
deleted file mode 100644
index a49f199ba56b6..0000000000000
--- a/app/code/Magento/Tax/view/adminhtml/web/js/page/validate.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
-
-define([
- 'jquery',
- 'mage/mage'
-], function (jQuery) {
- 'use strict';
-
- return function (data, element) {
- jQuery(element).mage('form').mage('validation');
- };
-});
From cfbbe0dfefafd701ad2d90bdf788020e285e898e Mon Sep 17 00:00:00 2001
From: Ievgenii Gryshkun
Date: Thu, 21 Feb 2019 10:21:42 +0200
Subject: [PATCH 161/254] Query Cart returns internal server error if
configurable product was added
---
app/code/Magento/QuoteGraphQl/etc/di.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/code/Magento/QuoteGraphQl/etc/di.xml b/app/code/Magento/QuoteGraphQl/etc/di.xml
index ab9cd9da8d629..0697761a2a2a6 100644
--- a/app/code/Magento/QuoteGraphQl/etc/di.xml
+++ b/app/code/Magento/QuoteGraphQl/etc/di.xml
@@ -12,6 +12,7 @@
- SimpleCartItem
- VirtualCartItem
+ - ConfigurableCartItem
From 124b0e03bd3004b04f2efe3ecac4d758fc4891c5 Mon Sep 17 00:00:00 2001
From: nmalevanec
Date: Thu, 21 Feb 2019 10:49:29 +0200
Subject: [PATCH 162/254] Fix static tests.
---
app/code/Magento/Sales/Model/AdminOrder/Create.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/code/Magento/Sales/Model/AdminOrder/Create.php b/app/code/Magento/Sales/Model/AdminOrder/Create.php
index 1ba5984799414..063433140566a 100644
--- a/app/code/Magento/Sales/Model/AdminOrder/Create.php
+++ b/app/code/Magento/Sales/Model/AdminOrder/Create.php
@@ -23,6 +23,7 @@
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @since 100.0.2
*/
class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\Model\Cart\CartInterface
From 6c3440124dbe4d206dc7c9b70719f3579b6a2038 Mon Sep 17 00:00:00 2001
From: Vitaliy Boyko
Date: Thu, 21 Feb 2019 17:34:31 +0200
Subject: [PATCH 163/254] graphQl-239: removed creating assets
---
.../DataProvider/Image/Placeholder.php | 20 ++++---------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
index 699613893949b..a7a9827a0be48 100644
--- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
+++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
@@ -7,7 +7,6 @@
namespace Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Image;
-use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Image\Placeholder\Theme;
use Magento\Catalog\Model\View\Asset\PlaceholderFactory;
use Magento\Framework\View\Asset\Repository as AssetRepository;
@@ -26,25 +25,17 @@ class Placeholder
*/
private $assetRepository;
- /**
- * @var Theme
- */
- private $theme;
-
/**
* Placeholder constructor.
* @param PlaceholderFactory $placeholderFactory
* @param AssetRepository $assetRepository
- * @param Theme $theme
*/
public function __construct(
PlaceholderFactory $placeholderFactory,
- AssetRepository $assetRepository,
- Theme $theme
+ AssetRepository $assetRepository
) {
$this->placeholderFactory = $placeholderFactory;
$this->assetRepository = $assetRepository;
- $this->theme = $theme;
}
/**
@@ -52,7 +43,6 @@ public function __construct(
*
* @param string $imageType
* @return string
- * @throws \Magento\Framework\Exception\NoSuchEntityException
*/
public function getPlaceholder(string $imageType): string
{
@@ -63,10 +53,8 @@ public function getPlaceholder(string $imageType): string
return $imageAsset->getUrl();
}
- $themeData = $this->theme->getThemeData();
- return $this->assetRepository->createAsset(
- "Magento_Catalog::images/product/placeholder/{$imageType}.jpg",
- $themeData
- )->getUrl();
+ return $this->assetRepository->getUrl(
+ "Magento_Catalog::images/product/placeholder/{$imageType}.jpg"
+ );
}
}
From 228ae14af1945dec3fd02356f6a87b5ab63dd3ca Mon Sep 17 00:00:00 2001
From: Vitaliy Boyko
Date: Thu, 21 Feb 2019 17:35:27 +0200
Subject: [PATCH 164/254] graphQl-239: removed unwanted doc
---
.../Model/Resolver/Products/DataProvider/Image/Placeholder.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
index a7a9827a0be48..f5cf2a9ef82ff 100644
--- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
+++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/Image/Placeholder.php
@@ -26,7 +26,6 @@ class Placeholder
private $assetRepository;
/**
- * Placeholder constructor.
* @param PlaceholderFactory $placeholderFactory
* @param AssetRepository $assetRepository
*/
From 8f3a1bd1d91ed2bbf27fa86a7fb17e17177544fd Mon Sep 17 00:00:00 2001
From: Tom Reece
Date: Thu, 21 Feb 2019 10:26:19 -0600
Subject: [PATCH 165/254] MQE-1453: Deliver weekly PR
- Fix skip issueId in AdminCreateAndSwitchProductType
---
.../Test/Mftf/Test/AdminCreateAndSwitchProductType.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml
index d5f309b075727..e79f7f75cce3f 100755
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminCreateAndSwitchProductType.xml
@@ -54,7 +54,7 @@
-
+
From 11b3a4f55e90d41cb8efa81672fda5ab3c32df4b Mon Sep 17 00:00:00 2001
From: Valerii Naida
Date: Thu, 21 Feb 2019 11:16:45 -0600
Subject: [PATCH 166/254] GraphQL-292: Cleanup quote GraphQL scheme
---
.../etc/schema.graphqls | 2 +-
.../Magento/QuoteGraphQl/etc/schema.graphqls | 93 ++++++++-----------
2 files changed, 40 insertions(+), 55 deletions(-)
diff --git a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls
index df95632c4b606..d4780c5c0867a 100644
--- a/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/ConfigurableProductGraphQl/etc/schema.graphqls
@@ -49,7 +49,7 @@ type AddConfigurableProductsToCartOutput {
}
input ConfigurableProductCartItemInput {
- data: CartItemDetailsInput!
+ data: CartItemInput!
variant_sku: String!
customizable_options:[CustomizableOptionInput!]
}
diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
index f2806f6dd9f09..985b88b18d5c0 100644
--- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
@@ -7,15 +7,48 @@ type Query {
type Mutation {
createEmptyCart: String @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CreateEmptyCart") @doc(description:"Creates an empty shopping cart for a guest or logged in user")
- applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Coupon\\ApplyCouponToCart")
- removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Coupon\\RemoveCouponFromCart")
- setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingAddressesOnCart")
+ addSimpleProductsToCart(input: AddSimpleProductsToCartInput): AddSimpleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart")
+ addVirtualProductsToCart(input: AddVirtualProductsToCartInput): AddVirtualProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart")
applyCouponToCart(input: ApplyCouponToCartInput): ApplyCouponToCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ApplyCouponToCart")
removeCouponFromCart(input: RemoveCouponFromCartInput): RemoveCouponFromCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\RemoveCouponFromCart")
+ setShippingAddressesOnCart(input: SetShippingAddressesOnCartInput): SetShippingAddressesOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingAddressesOnCart")
setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetBillingAddressOnCart")
setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingMethodsOnCart")
- addSimpleProductsToCart(input: AddSimpleProductsToCartInput): AddSimpleProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart")
- addVirtualProductsToCart(input: AddVirtualProductsToCartInput): AddVirtualProductsToCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AddSimpleProductsToCart")
+}
+
+input AddSimpleProductsToCartInput {
+ cart_id: String!
+ cartItems: [SimpleProductCartItemInput!]!
+}
+
+input SimpleProductCartItemInput {
+ data: CartItemInput!
+ customizable_options:[CustomizableOptionInput!]
+}
+
+input AddVirtualProductsToCartInput {
+ cart_id: String!
+ cartItems: [VirtualProductCartItemInput!]!
+}
+
+input VirtualProductCartItemInput {
+ data: CartItemInput!
+ customizable_options:[CustomizableOptionInput!]
+}
+
+input CartItemInput {
+ sku: String!
+ qty: Float!
+}
+
+input CustomizableOptionInput {
+ id: Int!
+ value: String!
+}
+
+input ApplyCouponToCartInput {
+ cart_id: String!
+ coupon_code: String!
}
input SetShippingAddressesOnCartInput {
@@ -24,7 +57,7 @@ input SetShippingAddressesOnCartInput {
}
input ShippingAddressInput {
- customer_address_id: Int # Can be provided in one-page checkout and is required for multi-shipping checkout
+ customer_address_id: Int # If provided then will be used address from address book
address: CartAddressInput
cart_items: [CartItemQuantityInput!]
}
@@ -81,19 +114,6 @@ type SetShippingMethodsOnCartOutput {
cart: Cart!
}
-# If no address is provided, the system get address assigned to a quote
-# If there's no address at all - the system returns all shipping methods
-input AvailableShippingMethodsOnCartInput {
- cart_id: String!
- customer_address_id: Int
- address: CartAddressInput
-}
-
-input ApplyCouponToCartInput {
- cart_id: String!
- coupon_code: String!
-}
-
type ApplyCouponToCartOutput {
cart: Cart!
}
@@ -172,31 +192,6 @@ type RemoveCouponFromCartOutput {
cart: Cart
}
-input AddSimpleProductsToCartInput {
- cart_id: String!
- cartItems: [SimpleProductCartItemInput!]!
-}
-
-input AddVirtualProductsToCartInput {
- cart_id: String!
- cartItems: [VirtualProductCartItemInput!]!
-}
-
-input SimpleProductCartItemInput {
- data: CartItemInput!
- customizable_options:[CustomizableOptionInput!]
-}
-
-input VirtualProductCartItemInput {
- data: CartItemInput!
- customizable_options:[CustomizableOptionInput!]
-}
-
-input CustomizableOptionInput {
- id: Int!
- value: String!
-}
-
type AddSimpleProductsToCartOutput {
cart: Cart!
}
@@ -213,11 +208,6 @@ type VirtualCartItem implements CartItemInterface @doc(description: "Virtual Car
customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions")
}
-input CartItemInput {
- sku: String!
- qty: Float!
-}
-
interface CartItemInterface @typeResolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CartItemTypeResolver") {
id: String!
qty: Float!
@@ -246,8 +236,3 @@ type CartItemSelectedOptionValuePrice {
units: String!
type: PriceTypeEnum!
}
-
-input CartItemDetailsInput {
- sku: String!
- qty: Float!
-}
From 628ee277f2b4ae01e23c78c06bb9f6460867615c Mon Sep 17 00:00:00 2001
From: Kavitha
Date: Thu, 21 Feb 2019 13:31:58 -0600
Subject: [PATCH 167/254] MC-4905: Convert CreateCustomUrlRewriteEntityTest to
MFTF
---
.../ActionGroup/AdminCategoryActionGroup.xml | 12 +++
.../AdminProductGridActionGroup.xml | 16 ++++
.../AssertCMSPageContentActionGroup.xml | 10 +++
.../Mftf/Section/StorefrontCMSPageSection.xml | 1 +
.../AdminUrlRewriteActionGroup.xml | 78 +++++++++++++++++
.../AdminUrlRewriteGridActionGroup.xml | 75 ++++++++++++++++
...torefrontUrlRewriteRedirectActionGroup.xml | 32 +++++++
.../Mftf/Page/AdminUrlRewriteEditPage.xml | 14 +++
.../Mftf/Page/AdminUrlRewriteProductPage.xml | 14 +++
.../Section/AdminUrlRewriteIndexSection.xml | 2 +
...eUrlRewriteAndAddPermanentRedirectTest.xml | 86 +++++++++++++++++++
...eUrlRewriteAndAddTemporaryRedirectTest.xml | 86 +++++++++++++++++++
...yUrlRewriteAndAddPermanentRedirectTest.xml | 74 ++++++++++++++++
...tUrlRewriteAndAddTemporaryRedirectTest.xml | 76 ++++++++++++++++
14 files changed, 576 insertions(+)
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteProductPage.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml
create mode 100644 app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
index 84e8e43e83845..86986265bae2c 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminCategoryActionGroup.xml
@@ -263,4 +263,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml
index f0367fb72c6a2..c9d70319c2877 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductGridActionGroup.xml
@@ -272,4 +272,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml
index 58318660d2c42..dde6237390257 100644
--- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml
+++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/AssertCMSPageContentActionGroup.xml
@@ -23,4 +23,14 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml
index 280c7dfd8263e..4ce8842c1ad87 100644
--- a/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Section/StorefrontCMSPageSection.xml
@@ -14,5 +14,6 @@
+
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml
new file mode 100644
index 0000000000000..6bd38f53531bb
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteActionGroup.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml
new file mode 100644
index 0000000000000..f053d18e79c3e
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/AdminUrlRewriteGridActionGroup.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml
new file mode 100644
index 0000000000000..cdbd3d146a5b2
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/ActionGroup/StorefrontUrlRewriteRedirectActionGroup.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml
new file mode 100644
index 0000000000000..d8a21b1be8ad7
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteEditPage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteProductPage.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteProductPage.xml
new file mode 100644
index 0000000000000..645396bc778e9
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Page/AdminUrlRewriteProductPage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteIndexSection.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteIndexSection.xml
index 7c21acdf943ba..ef86b2eb7223a 100644
--- a/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteIndexSection.xml
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Section/AdminUrlRewriteIndexSection.xml
@@ -19,5 +19,7 @@
+
+
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml
new file mode 100644
index 0000000000000..358aa58aba0f7
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddPermanentRedirectTest.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml
new file mode 100644
index 0000000000000..e6ee9b484059d
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCMSPageUrlRewriteAndAddTemporaryRedirectTest.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml
new file mode 100644
index 0000000000000..64bb6c5fa13c0
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomCategoryUrlRewriteAndAddPermanentRedirectTest.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml
new file mode 100644
index 0000000000000..2086f16cd4f7b
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminCreateCustomProductUrlRewriteAndAddTemporaryRedirectTest.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 5d3870a57594d91884dd80d312983c840780849b Mon Sep 17 00:00:00 2001
From: Iryna Lagno
Date: Thu, 21 Feb 2019 14:03:56 -0600
Subject: [PATCH 168/254] MC-15011: Text is not displayed correctly
---
.../Cms/Test/Mftf/Page/CmsPageEditPage.xml | 2 +-
.../AdminProductFormConfigurationsSection.xml | 1 +
.../AdminConfigurableProductCreateTest.xml | 1 +
.../Product/Form/Modifier/Links.php | 26 +++++++++++++++++--
.../Product/Form/Modifier/Samples.php | 15 +++++++++--
.../form/element/uploader/uploader.html | 2 +-
.../backend/web/css/source/forms/_fields.less | 1 +
7 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/app/code/Magento/Cms/Test/Mftf/Page/CmsPageEditPage.xml b/app/code/Magento/Cms/Test/Mftf/Page/CmsPageEditPage.xml
index 885310d9399ae..73db6b61343b1 100644
--- a/app/code/Magento/Cms/Test/Mftf/Page/CmsPageEditPage.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Page/CmsPageEditPage.xml
@@ -7,7 +7,7 @@
-->
-
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml
index c5d6abd89edbf..73ae71adfaaf0 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml
@@ -27,6 +27,7 @@
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
index 24af7d44e8261..2af85e1bac048 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
@@ -36,6 +36,7 @@
+
diff --git a/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Links.php b/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Links.php
index a352c4bdf7bc3..2188a671a5aa0 100644
--- a/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Links.php
+++ b/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Links.php
@@ -86,7 +86,7 @@ public function __construct(
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function modifyData(array $data)
{
@@ -101,7 +101,7 @@ public function modifyData(array $data)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function modifyMeta(array $meta)
@@ -160,6 +160,8 @@ public function modifyMeta(array $meta)
}
/**
+ * Returns configuration for dynamic rows
+ *
* @return array
*/
protected function getDynamicRows()
@@ -180,6 +182,8 @@ protected function getDynamicRows()
}
/**
+ * Returns Record column configuration
+ *
* @return array
*/
protected function getRecord()
@@ -221,6 +225,8 @@ protected function getRecord()
}
/**
+ * Returns Title column configuration
+ *
* @return array
*/
protected function getTitleColumn()
@@ -238,6 +244,7 @@ protected function getTitleColumn()
'componentType' => Form\Field::NAME,
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'title',
+ 'labelVisible' => false,
'validation' => [
'required-entry' => true,
],
@@ -247,6 +254,8 @@ protected function getTitleColumn()
}
/**
+ * Returns Price column configuration
+ *
* @return array
*/
protected function getPriceColumn()
@@ -265,6 +274,7 @@ protected function getPriceColumn()
'dataType' => Form\Element\DataType\Number::NAME,
'component' => 'Magento_Downloadable/js/components/price-handler',
'dataScope' => 'price',
+ 'labelVisible' => false,
'addbefore' => $this->locator->getStore()->getBaseCurrency()
->getCurrencySymbol(),
'validation' => [
@@ -281,6 +291,8 @@ protected function getPriceColumn()
}
/**
+ * Returns File column configuration
+ *
* @return array
*/
protected function getFileColumn()
@@ -302,6 +314,7 @@ protected function getFileColumn()
'options' => $this->typeUpload->toOptionArray(),
'typeFile' => 'links_file',
'typeUrl' => 'link_url',
+ 'labelVisible' => false,
];
$fileLinkUrl['arguments']['data']['config'] = [
'formElement' => Form\Element\Input::NAME,
@@ -344,6 +357,8 @@ protected function getFileColumn()
}
/**
+ * Returns Sample column configuration
+ *
* @return array
*/
protected function getSampleColumn()
@@ -363,6 +378,7 @@ protected function getSampleColumn()
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'sample.type',
'options' => $this->typeUpload->toOptionArray(),
+ 'labelVisible' => false,
'typeFile' => 'sample_file',
'typeUrl' => 'sample_url',
];
@@ -382,6 +398,7 @@ protected function getSampleColumn()
'component' => 'Magento_Downloadable/js/components/file-uploader',
'elementTmpl' => 'Magento_Downloadable/components/file-uploader',
'fileInputName' => 'link_samples',
+ 'labelVisible' => false,
'uploaderConfig' => [
'url' => $this->urlBuilder->addSessionParam()->getUrl(
'adminhtml/downloadable_file/upload',
@@ -403,6 +420,8 @@ protected function getSampleColumn()
}
/**
+ * Returns Sharable columns configuration
+ *
* @return array
*/
protected function getShareableColumn()
@@ -420,6 +439,8 @@ protected function getShareableColumn()
}
/**
+ * Returns max downloads column configuration
+ *
* @return array
*/
protected function getMaxDownloadsColumn()
@@ -437,6 +458,7 @@ protected function getMaxDownloadsColumn()
'componentType' => Form\Field::NAME,
'dataType' => Form\Element\DataType\Number::NAME,
'dataScope' => 'number_of_downloads',
+ 'labelVisible' => false,
'value' => 0,
'validation' => [
'validate-zero-or-greater' => true,
diff --git a/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Samples.php b/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Samples.php
index 1587163ba8121..197bf1338f945 100644
--- a/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Samples.php
+++ b/app/code/Magento/Downloadable/Ui/DataProvider/Product/Form/Modifier/Samples.php
@@ -77,7 +77,7 @@ public function __construct(
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function modifyData(array $data)
{
@@ -90,7 +90,7 @@ public function modifyData(array $data)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function modifyMeta(array $meta)
@@ -135,6 +135,8 @@ public function modifyMeta(array $meta)
}
/**
+ * Returns configuration for dynamic rows
+ *
* @return array
*/
protected function getDynamicRows()
@@ -155,6 +157,8 @@ protected function getDynamicRows()
}
/**
+ * Returns Record column configuration
+ *
* @return array
*/
protected function getRecord()
@@ -192,6 +196,8 @@ protected function getRecord()
}
/**
+ * Returns Title column configuration
+ *
* @return array
*/
protected function getTitleColumn()
@@ -209,6 +215,7 @@ protected function getTitleColumn()
'componentType' => Form\Field::NAME,
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'title',
+ 'labelVisible' => false,
'validation' => [
'required-entry' => true,
],
@@ -218,6 +225,8 @@ protected function getTitleColumn()
}
/**
+ * Returns Sample column configuration
+ *
* @return array
*/
protected function getSampleColumn()
@@ -236,6 +245,7 @@ protected function getSampleColumn()
'component' => 'Magento_Downloadable/js/components/upload-type-handler',
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'type',
+ 'labelVisible' => false,
'options' => $this->typeUpload->toOptionArray(),
'typeFile' => 'sample_file',
'typeUrl' => 'sample_url',
@@ -246,6 +256,7 @@ protected function getSampleColumn()
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'sample_url',
'placeholder' => 'URL',
+ 'labelVisible' => false,
'validation' => [
'required-entry' => true,
'validate-url' => true,
diff --git a/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/uploader.html b/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/uploader.html
index a92b85cb47401..cf4e2243b5886 100644
--- a/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/uploader.html
+++ b/app/code/Magento/Ui/view/base/web/templates/form/element/uploader/uploader.html
@@ -6,7 +6,7 @@
-->
-