From 1f743bd7fdf8147a80630fbd8f37a2cd53ee4d49 Mon Sep 17 00:00:00 2001
From: Yurii Borysov
Date: Thu, 23 Aug 2018 15:17:16 +0300
Subject: [PATCH 001/121] MAGETWO-91559: Static blocks with same ID appear in
place of correct block
---
.../Magento/Cms/Model/ResourceModel/Block.php | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/app/code/Magento/Cms/Model/ResourceModel/Block.php b/app/code/Magento/Cms/Model/ResourceModel/Block.php
index 9aab54b02bc14..ff7cc8d3e034d 100644
--- a/app/code/Magento/Cms/Model/ResourceModel/Block.php
+++ b/app/code/Magento/Cms/Model/ResourceModel/Block.php
@@ -183,10 +183,12 @@ public function getIsUniqueBlockToStores(AbstractModel $object)
$entityMetadata = $this->metadataPool->getMetadata(BlockInterface::class);
$linkField = $entityMetadata->getLinkField();
- if ($this->_storeManager->isSingleStoreMode()) {
- $stores = [Store::DEFAULT_STORE_ID];
- } else {
- $stores = (array)$object->getData('store_id');
+ $stores = (array)$object->getData('store_id');
+ $isDefaultStore = $this->_storeManager->isSingleStoreMode()
+ || array_search(Store::DEFAULT_STORE_ID, $stores) !== false;
+
+ if(!$isDefaultStore) {
+ $stores[] = Store::DEFAULT_STORE_ID;
}
$select = $this->getConnection()->select()
@@ -196,8 +198,11 @@ public function getIsUniqueBlockToStores(AbstractModel $object)
'cb.' . $linkField . ' = cbs.' . $linkField,
[]
)
- ->where('cb.identifier = ?', $object->getData('identifier'))
- ->where('cbs.store_id IN (?)', $stores);
+ ->where('cb.identifier = ? ', $object->getData('identifier'));
+
+ if(!$isDefaultStore) {
+ $select->where('cbs.store_id IN (?)', $stores);
+ }
if ($object->getId()) {
$select->where('cb.' . $entityMetadata->getIdentifierField() . ' <> ?', $object->getId());
From 33a84d6b554dbc82b4fda378bb8da79a1ecc9f1f Mon Sep 17 00:00:00 2001
From: Vital_Pantsialeyeu
Date: Thu, 30 Aug 2018 02:23:28 +0300
Subject: [PATCH 002/121] MAGETWO-66872: Customer Address Attribute not being
marked as required when the "Values Required" setting is overriden on Website
scope
- Updated retrieve attribute collection
---
.../Model/ResourceModel/Attribute/Collection.php | 13 +++++++++++++
app/code/Magento/Eav/Model/Entity/Type.php | 10 ++--------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/app/code/Magento/Customer/Model/ResourceModel/Attribute/Collection.php b/app/code/Magento/Customer/Model/ResourceModel/Attribute/Collection.php
index 4dd2eaa68b686..4cf438a95bed4 100644
--- a/app/code/Magento/Customer/Model/ResourceModel/Attribute/Collection.php
+++ b/app/code/Magento/Customer/Model/ResourceModel/Attribute/Collection.php
@@ -42,4 +42,17 @@ protected function _getEavWebsiteTable()
{
return $this->getTable('customer_eav_attribute_website');
}
+
+ /**
+ * Set collection item class name.
+ *
+ * @return $this
+ */
+ protected function _beforeLoad()
+ {
+ $entityType = $this->getEntityType();
+ $this->setItemObjectClass($entityType->getAttributeModel());
+
+ return parent::_beforeLoad();
+ }
}
diff --git a/app/code/Magento/Eav/Model/Entity/Type.php b/app/code/Magento/Eav/Model/Entity/Type.php
index 80fcfd4ab585c..e0f890170f1b7 100644
--- a/app/code/Magento/Eav/Model/Entity/Type.php
+++ b/app/code/Magento/Eav/Model/Entity/Type.php
@@ -163,17 +163,11 @@ public function getAttributeCollection($setId = null)
/**
* Init and retrieve attribute collection
*
- * @return \Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection
+ * @return mixed
*/
protected function _getAttributeCollection()
{
- $collection = $this->_attributeFactory->create()->getCollection();
- $objectsModel = $this->getAttributeModel();
- if ($objectsModel) {
- $collection->setModel($objectsModel);
- }
-
- return $collection;
+ return $this->_universalFactory->create($this->getEntityAttributeCollection());
}
/**
From 78a9a737a2c64c7deece3fa4708a57c23cf4d314 Mon Sep 17 00:00:00 2001
From: Lusine Hakobyan
Date: Thu, 30 Aug 2018 10:38:55 +0400
Subject: [PATCH 003/121] MAGETWO-91559: Static blocks with same ID appear in
place of correct block
- Add automated test
---
.../Test/Mftf/ActionGroup/CMSActionGroup.xml | 12 +++-
.../CmsNewBlockBlockActionsSection.xml | 1 +
.../Test/Mftf/Test/CheckStaticBlocksTest.xml | 72 +++++++++++++++++++
3 files changed, 84 insertions(+), 1 deletion(-)
create mode 100644 app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml
diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml
index 06419356d8e84..d83e154bc9d70 100644
--- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml
+++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml
@@ -6,7 +6,7 @@
*/
-->
+ xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
@@ -44,4 +44,14 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewBlockBlockActionsSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewBlockBlockActionsSection.xml
index 65ea1226772cf..3cc204d64adca 100644
--- a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewBlockBlockActionsSection.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewBlockBlockActionsSection.xml
@@ -17,6 +17,7 @@
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml
new file mode 100644
index 0000000000000..df7cd59a45886
--- /dev/null
+++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From aa5fa74db5eb7b5725c7ca8ad9cb47b77c968b7c Mon Sep 17 00:00:00 2001
From: Vital_Pantsialeyeu
Date: Tue, 4 Sep 2018 23:50:07 +0300
Subject: [PATCH 004/121] MAGETWO-66872: Customer Address Attribute not being
marked as required when the "Values Required" setting is overriden on Website
scope
- Updated retrieve attribute collection
---
.../Model/ResourceModel/Attribute/Collection.php | 13 -------------
app/code/Magento/Eav/Model/Entity/Type.php | 4 +++-
2 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/app/code/Magento/Customer/Model/ResourceModel/Attribute/Collection.php b/app/code/Magento/Customer/Model/ResourceModel/Attribute/Collection.php
index 4cf438a95bed4..4dd2eaa68b686 100644
--- a/app/code/Magento/Customer/Model/ResourceModel/Attribute/Collection.php
+++ b/app/code/Magento/Customer/Model/ResourceModel/Attribute/Collection.php
@@ -42,17 +42,4 @@ protected function _getEavWebsiteTable()
{
return $this->getTable('customer_eav_attribute_website');
}
-
- /**
- * Set collection item class name.
- *
- * @return $this
- */
- protected function _beforeLoad()
- {
- $entityType = $this->getEntityType();
- $this->setItemObjectClass($entityType->getAttributeModel());
-
- return parent::_beforeLoad();
- }
}
diff --git a/app/code/Magento/Eav/Model/Entity/Type.php b/app/code/Magento/Eav/Model/Entity/Type.php
index e0f890170f1b7..462c42cbc9654 100644
--- a/app/code/Magento/Eav/Model/Entity/Type.php
+++ b/app/code/Magento/Eav/Model/Entity/Type.php
@@ -167,7 +167,9 @@ public function getAttributeCollection($setId = null)
*/
protected function _getAttributeCollection()
{
- return $this->_universalFactory->create($this->getEntityAttributeCollection());
+ $collection = $this->_universalFactory->create($this->getEntityAttributeCollection());
+ $collection->setItemObjectClass($this->getAttributeModel());
+ return $collection;
}
/**
From e61b23a8e506576974cf37f12929c7b2c8053614 Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Mon, 17 Sep 2018 10:42:58 +0300
Subject: [PATCH 005/121] MAGETWO-91559: Static blocks with same ID appear in
place of correct block
- Fix static test
---
app/code/Magento/Cms/Model/ResourceModel/Block.php | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/app/code/Magento/Cms/Model/ResourceModel/Block.php b/app/code/Magento/Cms/Model/ResourceModel/Block.php
index ff7cc8d3e034d..30e817713755c 100644
--- a/app/code/Magento/Cms/Model/ResourceModel/Block.php
+++ b/app/code/Magento/Cms/Model/ResourceModel/Block.php
@@ -95,9 +95,11 @@ protected function _beforeSave(AbstractModel $object)
}
/**
+ * Get block id.
+ *
* @param AbstractModel $object
* @param mixed $value
- * @param null $field
+ * @param string $field
* @return bool|int|string
* @throws LocalizedException
* @throws \Exception
@@ -187,7 +189,7 @@ public function getIsUniqueBlockToStores(AbstractModel $object)
$isDefaultStore = $this->_storeManager->isSingleStoreMode()
|| array_search(Store::DEFAULT_STORE_ID, $stores) !== false;
- if(!$isDefaultStore) {
+ if (!$isDefaultStore) {
$stores[] = Store::DEFAULT_STORE_ID;
}
@@ -200,7 +202,7 @@ public function getIsUniqueBlockToStores(AbstractModel $object)
)
->where('cb.identifier = ? ', $object->getData('identifier'));
- if(!$isDefaultStore) {
+ if (!$isDefaultStore) {
$select->where('cbs.store_id IN (?)', $stores);
}
@@ -241,6 +243,8 @@ public function lookupStoreIds($id)
}
/**
+ * Save an object.
+ *
* @param AbstractModel $object
* @return $this
* @throws \Exception
From 921fa69da95fa159a9a57fcc374b3cd19ac270df Mon Sep 17 00:00:00 2001
From: Vital_Pantsialeyeu
Date: Wed, 19 Sep 2018 17:43:23 +0300
Subject: [PATCH 006/121] MAGETWO-66872: Customer Address Attribute not being
marked as required when the "Values Required" setting is overriden on Website
scope
- Updated retrieve attribute collection
---
app/code/Magento/Eav/Model/Entity/Type.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Eav/Model/Entity/Type.php b/app/code/Magento/Eav/Model/Entity/Type.php
index 462c42cbc9654..444d58bf546d4 100644
--- a/app/code/Magento/Eav/Model/Entity/Type.php
+++ b/app/code/Magento/Eav/Model/Entity/Type.php
@@ -163,7 +163,7 @@ public function getAttributeCollection($setId = null)
/**
* Init and retrieve attribute collection
*
- * @return mixed
+ * @return \Magento\Eav\Model\ResourceModel\Entity\Attribute\Collection
*/
protected function _getAttributeCollection()
{
From 1e81c95abbccce1c086189ab6f59d81f3d30ab9e Mon Sep 17 00:00:00 2001
From: Sona Sargsyan
Date: Tue, 25 Sep 2018 16:10:48 +0400
Subject: [PATCH 007/121] MAGETWO-66872: Customer Address Attribute not being
marked as required when the "Values Required" setting is overriden on Website
scope
- Add automation test
---
...tCustomerAddressesFromAdminActionGroup.xml | 32 +++++++++++++++++++
.../Test/Mftf/Page/AdminEditCustomerPage.xml | 1 +
.../AdminEditCustomerAddressesSection.xml | 31 ++++++++++++++++++
3 files changed, 64 insertions(+)
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerAddressesSection.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
new file mode 100644
index 0000000000000..402566c771928
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerPage.xml b/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerPage.xml
index 31dad24ba8372..327cfe659aff2 100644
--- a/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerPage.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Page/AdminEditCustomerPage.xml
@@ -10,5 +10,6 @@
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerAddressesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerAddressesSection.xml
new file mode 100644
index 0000000000000..0718800c871a7
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerAddressesSection.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From eb2be5fbf8df76be3f5eee7872dc30aeba8d6bbb Mon Sep 17 00:00:00 2001
From: David Grigoryan
Date: Mon, 1 Oct 2018 12:40:36 +0400
Subject: [PATCH 008/121] MAGETWO-66872: Customer Address Attribute not being
marked as required when the "Values Required" setting is overriden on Website
scope
- Update automation test
---
...tCustomerAddressesFromAdminActionGroup.xml | 25 +++++++++++--------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
index 402566c771928..9d918990c8172 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
@@ -8,21 +8,24 @@
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
From 456f431e8a86fcc5d28404c5e6c13b431b043510 Mon Sep 17 00:00:00 2001
From: Alexey Yakimovich
Date: Wed, 24 Oct 2018 12:18:09 +0300
Subject: [PATCH 009/121] MAGETWO-95820: Order placed by new customer before
they registered is displayed in the admin under the name Guest
- Fixed issue with missing customer data in order when account was created after order placing;
---
.../Observer/AssignOrderToCustomerObserver.php | 15 +++++++++++----
.../AssignOrderToCustomerObserverTest.php | 11 +++++++++++
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/Sales/Observer/AssignOrderToCustomerObserver.php b/app/code/Magento/Sales/Observer/AssignOrderToCustomerObserver.php
index cade86d18e935..5883bde175101 100644
--- a/app/code/Magento/Sales/Observer/AssignOrderToCustomerObserver.php
+++ b/app/code/Magento/Sales/Observer/AssignOrderToCustomerObserver.php
@@ -31,7 +31,7 @@ public function __construct(OrderRepositoryInterface $orderRepository)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function execute(Observer $observer)
{
@@ -44,9 +44,16 @@ public function execute(Observer $observer)
$orderId = $delegateData['__sales_assign_order_id'];
$order = $this->orderRepository->get($orderId);
if (!$order->getCustomerId()) {
- //if customer ID wasn't already assigned then assigning.
- $order->setCustomerId($customer->getId());
- $order->setCustomerIsGuest(0);
+ //assign customer info to order after customer creation.
+ $order->setCustomerId($customer->getId())
+ ->setCustomerIsGuest(0)
+ ->setCustomerEmail($customer->getEmail())
+ ->setCustomerFirstname($customer->getFirstname())
+ ->setCustomerLastname($customer->getLastname())
+ ->setCustomerMiddlename($customer->getMiddlename())
+ ->setCustomerPrefix($customer->getPrefix())
+ ->setCustomerSuffix($customer->getSuffix())
+ ->setCustomerGroupId($customer->getGroupId());
$this->orderRepository->save($order);
}
}
diff --git a/app/code/Magento/Sales/Test/Unit/Observer/AssignOrderToCustomerObserverTest.php b/app/code/Magento/Sales/Test/Unit/Observer/AssignOrderToCustomerObserverTest.php
index c6e02151b9bc1..e919b45667f24 100644
--- a/app/code/Magento/Sales/Test/Unit/Observer/AssignOrderToCustomerObserverTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Observer/AssignOrderToCustomerObserverTest.php
@@ -69,6 +69,17 @@ public function testAssignOrderToCustomerAfterGuestOrder($customerId)
$orderMock->expects($this->once())->method('getCustomerId')->willReturn($customerId);
$this->orderRepositoryMock->expects($this->once())->method('get')->with($orderId)
->willReturn($orderMock);
+
+ $orderMock->expects($this->once())->method('setCustomerId')->willReturn($orderMock);
+ $orderMock->expects($this->once())->method('setCustomerIsGuest')->willReturn($orderMock);
+ $orderMock->expects($this->once())->method('setCustomerEmail')->willReturn($orderMock);
+ $orderMock->expects($this->once())->method('setCustomerFirstname')->willReturn($orderMock);
+ $orderMock->expects($this->once())->method('setCustomerLastname')->willReturn($orderMock);
+ $orderMock->expects($this->once())->method('setCustomerMiddlename')->willReturn($orderMock);
+ $orderMock->expects($this->once())->method('setCustomerPrefix')->willReturn($orderMock);
+ $orderMock->expects($this->once())->method('setCustomerSuffix')->willReturn($orderMock);
+ $orderMock->expects($this->once())->method('setCustomerGroupId')->willReturn($orderMock);
+
if (!$customerId) {
$this->orderRepositoryMock->expects($this->once())->method('save')->with($orderMock);
$this->sut->execute($observerMock);
From 5902f1e80c0884b513dbc310845ffe8f6f09aa87 Mon Sep 17 00:00:00 2001
From: Yuliya Labudova
Date: Tue, 30 Oct 2018 14:20:01 +0300
Subject: [PATCH 010/121] MAGETWO-95822: Layered Navigation shows options not
available
- Add observer for filter
---
.../Mysql/Aggregation/DataProvider.php | 23 ++++++++++++++++---
.../Model/Layer/Filter/Attribute.php | 8 +++++++
.../Mysql/Aggregation/DataProviderTest.php | 12 +++++++++-
3 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Aggregation/DataProvider.php b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Aggregation/DataProvider.php
index 15856bbee7461..66f5ad7a7192b 100644
--- a/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Aggregation/DataProvider.php
+++ b/app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Aggregation/DataProvider.php
@@ -16,8 +16,11 @@
use Magento\Framework\DB\Select;
use Magento\Framework\Search\Adapter\Mysql\Aggregation\DataProviderInterface;
use Magento\Framework\Search\Request\BucketInterface;
+use Magento\Framework\Event\Manager;
/**
+ * Data Provider for catalog search.
+ *
* @deprecated
* @see \Magento\ElasticSearch
*/
@@ -43,12 +46,18 @@ class DataProvider implements DataProviderInterface
*/
private $selectBuilderForAttribute;
+ /**
+ * @var Manager
+ */
+ private $eventManager;
+
/**
* @param Config $eavConfig
* @param ResourceConnection $resource
* @param ScopeResolverInterface $scopeResolver
* @param null $customerSession @deprecated
* @param SelectBuilderForAttribute|null $selectBuilderForAttribute
+ * @param Manager|null $eventManager
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
@@ -57,17 +66,19 @@ public function __construct(
ResourceConnection $resource,
ScopeResolverInterface $scopeResolver,
$customerSession,
- SelectBuilderForAttribute $selectBuilderForAttribute = null
+ SelectBuilderForAttribute $selectBuilderForAttribute = null,
+ Manager $eventManager = null
) {
$this->eavConfig = $eavConfig;
$this->connection = $resource->getConnection();
$this->scopeResolver = $scopeResolver;
$this->selectBuilderForAttribute = $selectBuilderForAttribute
?: ObjectManager::getInstance()->get(SelectBuilderForAttribute::class);
+ $this->eventManager = $eventManager ?: ObjectManager::getInstance()->get(Manager::class);
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getDataSet(
BucketInterface $bucket,
@@ -83,13 +94,17 @@ public function getDataSet(
'main_table.entity_id = entities.entity_id',
[]
);
+ $this->eventManager->dispatch(
+ 'catalogsearch_query_add_filter_after',
+ ['bucket' => $bucket, 'select' => $select]
+ );
$select = $this->selectBuilderForAttribute->build($select, $attribute, $currentScope);
return $select;
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function execute(Select $select)
{
@@ -97,6 +112,8 @@ public function execute(Select $select)
}
/**
+ * Get select.
+ *
* @return Select
*/
private function getSelect()
diff --git a/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php b/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php
index 7aac6e98fc044..ea0c74a401cbc 100644
--- a/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php
+++ b/app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php
@@ -156,4 +156,12 @@ private function getOptionCount($value, $optionsFacetedData)
? (int)$optionsFacetedData[$value]['count']
: 0;
}
+
+ /**
+ * @inheritdoc
+ */
+ protected function isOptionReducesResults($optionCount, $totalSize)
+ {
+ return $optionCount <= $totalSize;
+ }
}
diff --git a/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Aggregation/DataProviderTest.php b/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Aggregation/DataProviderTest.php
index 85b1b136e78d2..e3cc3e1d18377 100644
--- a/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Aggregation/DataProviderTest.php
+++ b/app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Aggregation/DataProviderTest.php
@@ -20,6 +20,7 @@
use Magento\Eav\Model\Entity\Attribute;
use Magento\Catalog\Model\Product;
use Magento\Framework\DB\Ddl\Table;
+use Magento\Framework\Event\Manager;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -64,6 +65,11 @@ class DataProviderTest extends \PHPUnit\Framework\TestCase
*/
private $selectBuilderForAttribute;
+ /**
+ * @var Manager|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $eventManager;
+
protected function setUp()
{
$this->eavConfigMock = $this->createMock(Config::class);
@@ -73,12 +79,14 @@ protected function setUp()
$this->adapterMock = $this->createMock(AdapterInterface::class);
$this->resourceConnectionMock->expects($this->once())->method('getConnection')->willReturn($this->adapterMock);
$this->selectBuilderForAttribute = $this->createMock(SelectBuilderForAttribute::class);
+ $this->eventManager = $this->createMock(Manager::class);
$this->model = new DataProvider(
$this->eavConfigMock,
$this->resourceConnectionMock,
$this->scopeResolverMock,
$this->sessionMock,
- $this->selectBuilderForAttribute
+ $this->selectBuilderForAttribute,
+ $this->eventManager
);
}
@@ -102,6 +110,7 @@ public function testGetDataSetUsesFrontendPriceIndexerTableIfAttributeIsPrice()
$selectMock = $this->createMock(Select::class);
$this->adapterMock->expects($this->atLeastOnce())->method('select')->willReturn($selectMock);
+ $this->eventManager->expects($this->once())->method('dispatch')->willReturn($selectMock);
$tableMock = $this->createMock(Table::class);
$this->model->getDataSet($bucketMock, ['scope' => $dimensionMock], $tableMock);
@@ -129,6 +138,7 @@ public function testGetDataSetUsesFrontendPriceIndexerTableForDecimalAttributes(
$selectMock = $this->createMock(Select::class);
$this->selectBuilderForAttribute->expects($this->once())->method('build')->willReturn($selectMock);
$this->adapterMock->expects($this->atLeastOnce())->method('select')->willReturn($selectMock);
+ $this->eventManager->expects($this->once())->method('dispatch')->willReturn($selectMock);
$tableMock = $this->createMock(Table::class);
$this->model->getDataSet($bucketMock, ['scope' => $dimensionMock], $tableMock);
}
From 853225e2222c62fc44166c212f8f648c66c777e5 Mon Sep 17 00:00:00 2001
From: Karen_Mkhitaryan
Date: Tue, 30 Oct 2018 17:22:08 +0400
Subject: [PATCH 011/121] MAGETWO-95820: Order placed by new customer before
they registered is displayed in the admin under the name Guest
- Add automated test
---
.../CheckoutSuccessRegisterSection.xml | 1 +
...ontCheckCustomerInfoCreatedByGuestTest.xml | 62 +++++++++++++++++++
.../Test/Mftf/Data/AllowGuestCheckoutData.xml | 24 +++++++
.../Metadata/allow_guest_checkout-meta.xml | 21 +++++++
.../Sales/Test/Mftf/Page/AdminOrderPage.xml | 13 ++++
5 files changed, 121 insertions(+)
create mode 100644 app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
create mode 100644 app/code/Magento/Config/Test/Mftf/Data/AllowGuestCheckoutData.xml
create mode 100644 app/code/Magento/Config/Test/Mftf/Metadata/allow_guest_checkout-meta.xml
create mode 100644 app/code/Magento/Sales/Test/Mftf/Page/AdminOrderPage.xml
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessRegisterSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessRegisterSection.xml
index d0ef8d347efb5..0d692e4ab143e 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessRegisterSection.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutSuccessRegisterSection.xml
@@ -12,5 +12,6 @@
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
new file mode 100644
index 0000000000000..2e2dee82a6eaf
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Config/Test/Mftf/Data/AllowGuestCheckoutData.xml b/app/code/Magento/Config/Test/Mftf/Data/AllowGuestCheckoutData.xml
new file mode 100644
index 0000000000000..f89cdf1a87b31
--- /dev/null
+++ b/app/code/Magento/Config/Test/Mftf/Data/AllowGuestCheckoutData.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+ AllowGuestCheckoutYes
+
+
+ 1
+
+
+
+ AllowGuestCheckoutNo
+
+
+ 0
+
+
diff --git a/app/code/Magento/Config/Test/Mftf/Metadata/allow_guest_checkout-meta.xml b/app/code/Magento/Config/Test/Mftf/Metadata/allow_guest_checkout-meta.xml
new file mode 100644
index 0000000000000..052d9b6574774
--- /dev/null
+++ b/app/code/Magento/Config/Test/Mftf/Metadata/allow_guest_checkout-meta.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+ string
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Page/AdminOrderPage.xml b/app/code/Magento/Sales/Test/Mftf/Page/AdminOrderPage.xml
new file mode 100644
index 0000000000000..6abe265a37b79
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Page/AdminOrderPage.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
From 1b14b277e13ac05489b69caf75c0068c9dba6518 Mon Sep 17 00:00:00 2001
From: Yauhen_Lyskavets
Date: Thu, 25 Oct 2018 15:37:41 +0300
Subject: [PATCH 012/121] MAGETWO-95823: Order Sales Report includes canceled
orders
- Bug fix.
---
.../Block/Adminhtml/Sales/Sales/Grid.php | 67 ++++++++++++++++++-
1 file changed, 64 insertions(+), 3 deletions(-)
diff --git a/app/code/Magento/Reports/Block/Adminhtml/Sales/Sales/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Sales/Sales/Grid.php
index 9f5f784df677f..25a4aa1b88ca4 100644
--- a/app/code/Magento/Reports/Block/Adminhtml/Sales/Sales/Grid.php
+++ b/app/code/Magento/Reports/Block/Adminhtml/Sales/Sales/Grid.php
@@ -6,23 +6,58 @@
namespace Magento\Reports\Block\Adminhtml\Sales\Sales;
+use Magento\Framework\DataObject;
use Magento\Reports\Block\Adminhtml\Grid\Column\Renderer\Currency;
+use Magento\Framework\App\ObjectManager;
+use Magento\Sales\Model\Order\ConfigFactory;
+use Magento\Sales\Model\Order;
/**
* Adminhtml sales report grid block
*
- * @author Magento Core Team
* @SuppressWarnings(PHPMD.DepthOfInheritance)
*/
class Grid extends \Magento\Reports\Block\Adminhtml\Grid\AbstractGrid
{
/**
- * GROUP BY criteria
- *
* @var string
*/
protected $_columnGroupBy = 'period';
+ /**
+ * @var ConfigFactory
+ */
+ private $configFactory;
+
+ /**
+ * @param \Magento\Backend\Block\Template\Context $context
+ * @param \Magento\Backend\Helper\Data $backendHelper
+ * @param \Magento\Reports\Model\ResourceModel\Report\Collection\Factory $resourceFactory
+ * @param \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory
+ * @param \Magento\Reports\Helper\Data $reportsData
+ * @param array $data
+ * @param ConfigFactory|null $configFactory
+ */
+ public function __construct(
+ \Magento\Backend\Block\Template\Context $context,
+ \Magento\Backend\Helper\Data $backendHelper,
+ \Magento\Reports\Model\ResourceModel\Report\Collection\Factory $resourceFactory,
+ \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory,
+ \Magento\Reports\Helper\Data $reportsData,
+ array $data = [],
+ ConfigFactory $configFactory = null
+ ) {
+ parent::__construct(
+ $context,
+ $backendHelper,
+ $resourceFactory,
+ $collectionFactory,
+ $reportsData,
+ $data
+ );
+ $this->configFactory = $configFactory ?: ObjectManager::getInstance()->get(ConfigFactory::class);
+ }
+
/**
* Reports grid constructor
*
@@ -331,4 +366,30 @@ protected function _prepareColumns()
return parent::_prepareColumns();
}
+
+ /**
+ * @inheritdoc
+ *
+ * Filter canceled statuses for orders.
+ *
+ * @return Grid
+ */
+ protected function _prepareCollection()
+ {
+ /** @var DataObject $filterData */
+ $filterData = $this->getData('filter_data');
+ if (!$filterData->hasData('order_statuses')) {
+ $orderConfig = $this->configFactory->create();
+ $statusValues = [];
+ $canceledStatuses = $orderConfig->getStateStatuses(Order::STATE_CANCELED);
+ $statusCodes = array_keys($orderConfig->getStatuses());
+ foreach ($statusCodes as $code) {
+ if (!isset($canceledStatuses[$code])) {
+ $statusValues[] = $code;
+ }
+ }
+ $filterData->setData('order_statuses', $statusValues);
+ }
+ return parent::_prepareCollection();
+ }
}
From f886f15f327f4e62ab65ba235a5cff4b67d30306 Mon Sep 17 00:00:00 2001
From: Lusine
Date: Thu, 1 Nov 2018 15:42:16 +0400
Subject: [PATCH 013/121] MAGETWO-95823: Order Sales Report includes canceled
orders
- Add automated test.
---
.../GenerateOrderReportActionGroup.xml | 22 +++++
.../Test/Mftf/Page/OrdersReportPage.xml | 14 ++++
.../Mftf/Section/OrderReportMainSection.xml | 28 +++++++
.../CancelOrdersInOrderSalesReportTest.xml | 80 +++++++++++++++++++
.../ActionGroup/AdminOrderActionGroup.xml | 24 +++++-
5 files changed, 167 insertions(+), 1 deletion(-)
create mode 100644 app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportActionGroup.xml
create mode 100644 app/code/Magento/Reports/Test/Mftf/Page/OrdersReportPage.xml
create mode 100644 app/code/Magento/Reports/Test/Mftf/Section/OrderReportMainSection.xml
create mode 100644 app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml
diff --git a/app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportActionGroup.xml b/app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportActionGroup.xml
new file mode 100644
index 0000000000000..b96a367903ac8
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/ActionGroup/GenerateOrderReportActionGroup.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Page/OrdersReportPage.xml b/app/code/Magento/Reports/Test/Mftf/Page/OrdersReportPage.xml
new file mode 100644
index 0000000000000..46509089b97ba
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Page/OrdersReportPage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Section/OrderReportMainSection.xml b/app/code/Magento/Reports/Test/Mftf/Section/OrderReportMainSection.xml
new file mode 100644
index 0000000000000..fb71a67da87dc
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Section/OrderReportMainSection.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml
new file mode 100644
index 0000000000000..967b0f3caf515
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml
index 53dc52ca58fa7..7df9fb6552f19 100644
--- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml
+++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml
@@ -296,4 +296,26 @@
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 9edabc7755a90fdfaa3a774415e076b495b4f0ca Mon Sep 17 00:00:00 2001
From: David Grigoryan
Date: Fri, 2 Nov 2018 16:28:02 +0400
Subject: [PATCH 014/121] MAGETWO-95822: Layered Navigation shows options not
available
- Add automated test
---
.../AdminAddOptionsToAttributeActionGroup.xml | 44 +++++++++++++++++++
...reateProductConfigurationsPanelSection.xml | 1 +
.../Section/AdminNewAttributePanelSection.xml | 1 +
.../Mftf/Section/LayeredNavigationSection.xml | 4 ++
.../Section/AdminDataGridHeaderSection.xml | 2 +
5 files changed, 52 insertions(+)
create mode 100644 app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminAddOptionsToAttributeActionGroup.xml
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminAddOptionsToAttributeActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminAddOptionsToAttributeActionGroup.xml
new file mode 100644
index 0000000000000..4328159d6e930
--- /dev/null
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/AdminAddOptionsToAttributeActionGroup.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminCreateProductConfigurationsPanelSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminCreateProductConfigurationsPanelSection.xml
index 99e47baac37d5..fa018c07bcea8 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminCreateProductConfigurationsPanelSection.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminCreateProductConfigurationsPanelSection.xml
@@ -35,5 +35,6 @@
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml
index 44077888f8bc0..1df777f44f2f4 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml
@@ -20,5 +20,6 @@
+
diff --git a/app/code/Magento/LayeredNavigation/Test/Mftf/Section/LayeredNavigationSection.xml b/app/code/Magento/LayeredNavigation/Test/Mftf/Section/LayeredNavigationSection.xml
index ad94d44d636e9..b44ee9ddbd734 100644
--- a/app/code/Magento/LayeredNavigation/Test/Mftf/Section/LayeredNavigationSection.xml
+++ b/app/code/Magento/LayeredNavigation/Test/Mftf/Section/LayeredNavigationSection.xml
@@ -16,4 +16,8 @@
+
+
diff --git a/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridHeaderSection.xml b/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridHeaderSection.xml
index 3e917a5944f95..4ee38e30f98e6 100644
--- a/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridHeaderSection.xml
+++ b/app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridHeaderSection.xml
@@ -25,5 +25,7 @@
+
+
From bbf124759cf3d27dd4bfee4a9c4e3a3969bc59ff Mon Sep 17 00:00:00 2001
From: Pavel Bystritsky
Date: Tue, 13 Nov 2018 11:56:42 +0200
Subject: [PATCH 015/121] magento/magento2#14849: [Forwardport] In Sales Emails
no translation using order.getStatusLabel().
---
app/code/Magento/Sales/Model/Order.php | 24 ++++++++---
app/code/Magento/Sales/Model/Order/Config.php | 42 +++++++++++++++----
.../frontend/email/creditmemo_update.html | 4 +-
.../email/creditmemo_update_guest.html | 4 +-
.../view/frontend/email/invoice_update.html | 4 +-
.../frontend/email/invoice_update_guest.html | 4 +-
.../view/frontend/email/order_update.html | 4 +-
.../frontend/email/order_update_guest.html | 4 +-
.../view/frontend/email/shipment_update.html | 4 +-
.../frontend/email/shipment_update_guest.html | 4 +-
.../email/creditmemo_update.html | 4 +-
.../email/creditmemo_update_guest.html | 4 +-
.../Magento_Sales/email/invoice_update.html | 4 +-
.../email/invoice_update_guest.html | 4 +-
.../Magento_Sales/email/order_update.html | 4 +-
.../email/order_update_guest.html | 4 +-
.../Magento_Sales/email/shipment_update.html | 4 +-
.../email/shipment_update_guest.html | 4 +-
18 files changed, 84 insertions(+), 46 deletions(-)
diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php
index 345ff036a2be6..e223f213b86f7 100644
--- a/app/code/Magento/Sales/Model/Order.php
+++ b/app/code/Magento/Sales/Model/Order.php
@@ -8,6 +8,7 @@
use Magento\Directory\Model\Currency;
use Magento\Framework\Api\AttributeValueFactory;
use Magento\Framework\App\ObjectManager;
+use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Locale\ResolverInterface;
use Magento\Framework\Pricing\PriceCurrencyInterface;
use Magento\Sales\Api\Data\OrderInterface;
@@ -1024,10 +1025,21 @@ public function setState($state)
return $this->setData(self::STATE, $state);
}
+ /**
+ * Retrieve frontend label of order status
+ *
+ * @return string
+ */
+ public function getFrontendStatusLabel()
+ {
+ return $this->getConfig()->getStatusFrontendLabel($this->getStatus());
+ }
+
/**
* Retrieve label of order status
*
* @return string
+ * @throws LocalizedException
*/
public function getStatusLabel()
{
@@ -1135,12 +1147,12 @@ public function place()
* Hold order
*
* @return $this
- * @throws \Magento\Framework\Exception\LocalizedException
+ * @throws LocalizedException
*/
public function hold()
{
if (!$this->canHold()) {
- throw new \Magento\Framework\Exception\LocalizedException(__('A hold action is not available.'));
+ throw new LocalizedException(__('A hold action is not available.'));
}
$this->setHoldBeforeState($this->getState());
$this->setHoldBeforeStatus($this->getStatus());
@@ -1153,12 +1165,12 @@ public function hold()
* Attempt to unhold the order
*
* @return $this
- * @throws \Magento\Framework\Exception\LocalizedException
+ * @throws LocalizedException
*/
public function unhold()
{
if (!$this->canUnhold()) {
- throw new \Magento\Framework\Exception\LocalizedException(__('You cannot remove the hold.'));
+ throw new LocalizedException(__('You cannot remove the hold.'));
}
$this->setState($this->getHoldBeforeState())
@@ -1202,7 +1214,7 @@ public function isFraudDetected()
* @param string $comment
* @param bool $graceful
* @return $this
- * @throws \Magento\Framework\Exception\LocalizedException
+ * @throws LocalizedException
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
public function registerCancellation($comment = '', $graceful = true)
@@ -1241,7 +1253,7 @@ public function registerCancellation($comment = '', $graceful = true)
$this->addStatusHistoryComment($comment, false);
}
} elseif (!$graceful) {
- throw new \Magento\Framework\Exception\LocalizedException(__('We cannot cancel this order.'));
+ throw new LocalizedException(__('We cannot cancel this order.'));
}
return $this;
}
diff --git a/app/code/Magento/Sales/Model/Order/Config.php b/app/code/Magento/Sales/Model/Order/Config.php
index e00eda647dc8d..8999fca174de9 100644
--- a/app/code/Magento/Sales/Model/Order/Config.php
+++ b/app/code/Magento/Sales/Model/Order/Config.php
@@ -5,6 +5,8 @@
*/
namespace Magento\Sales\Model\Order;
+use Magento\Framework\Exception\LocalizedException;
+
/**
* Order configuration model
*
@@ -85,7 +87,7 @@ protected function _getCollection()
/**
* @param string $state
- * @return Status|null
+ * @return Status
*/
protected function _getState($state)
{
@@ -101,7 +103,7 @@ protected function _getState($state)
* Retrieve default status for state
*
* @param string $state
- * @return string
+ * @return string|null
*/
public function getStateDefaultStatus($state)
{
@@ -115,24 +117,48 @@ public function getStateDefaultStatus($state)
}
/**
- * Retrieve status label
+ * Get status label for a specified area
*
- * @param string $code
- * @return string
+ * @param string $code
+ * @param string $area
+ * @return string
*/
- public function getStatusLabel($code)
+ private function getStatusLabelForArea(string $code, string $area): string
{
- $area = $this->state->getAreaCode();
$code = $this->maskStatusForArea($area, $code);
$status = $this->orderStatusFactory->create()->load($code);
- if ($area == 'adminhtml') {
+ if ($area === 'adminhtml') {
return $status->getLabel();
}
return $status->getStoreLabel();
}
+ /**
+ * Retrieve status label for detected area
+ *
+ * @param string $code
+ * @return string
+ * @throws LocalizedException
+ */
+ public function getStatusLabel($code)
+ {
+ $area = $this->state->getAreaCode() ?: \Magento\Framework\App\Area::AREA_FRONTEND;
+ return $this->getStatusLabelForArea($code, $area);
+ }
+
+ /**
+ * Retrieve status label for area
+ *
+ * @param string $code
+ * @return string
+ */
+ public function getStatusFrontendLabel(string $code): string
+ {
+ return $this->getStatusLabelForArea($code, \Magento\Framework\App\Area::AREA_FRONTEND);
+ }
+
/**
* Mask status for order for specified area
*
diff --git a/app/code/Magento/Sales/view/frontend/email/creditmemo_update.html b/app/code/Magento/Sales/view/frontend/email/creditmemo_update.html
index 3a4aab19e9e7c..a6a10fb49e3f5 100644
--- a/app/code/Magento/Sales/view/frontend/email/creditmemo_update.html
+++ b/app/code/Magento/Sales/view/frontend/email/creditmemo_update.html
@@ -11,7 +11,7 @@
"var this.getUrl($store, 'customer/account/')":"Customer Account URL",
"var order.getCustomerName()":"Customer Name",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -24,7 +24,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
{{trans 'You can check the status of your order by logging into your account .' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
diff --git a/app/code/Magento/Sales/view/frontend/email/creditmemo_update_guest.html b/app/code/Magento/Sales/view/frontend/email/creditmemo_update_guest.html
index bc7c079d7f21b..b7411d80d2ba6 100644
--- a/app/code/Magento/Sales/view/frontend/email/creditmemo_update_guest.html
+++ b/app/code/Magento/Sales/view/frontend/email/creditmemo_update_guest.html
@@ -10,7 +10,7 @@
"var creditmemo.increment_id":"Credit Memo Id",
"var billing.getName()":"Guest Customer Name",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -23,7 +23,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
diff --git a/app/code/Magento/Sales/view/frontend/email/invoice_update.html b/app/code/Magento/Sales/view/frontend/email/invoice_update.html
index cafdd65ff5208..4043e59f9d7d6 100644
--- a/app/code/Magento/Sales/view/frontend/email/invoice_update.html
+++ b/app/code/Magento/Sales/view/frontend/email/invoice_update.html
@@ -11,7 +11,7 @@
"var comment":"Invoice Comment",
"var invoice.increment_id":"Invoice Id",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -24,7 +24,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
{{trans 'You can check the status of your order by logging into your account .' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
diff --git a/app/code/Magento/Sales/view/frontend/email/invoice_update_guest.html b/app/code/Magento/Sales/view/frontend/email/invoice_update_guest.html
index fafb533301efb..40cdec7fb4cab 100644
--- a/app/code/Magento/Sales/view/frontend/email/invoice_update_guest.html
+++ b/app/code/Magento/Sales/view/frontend/email/invoice_update_guest.html
@@ -10,7 +10,7 @@
"var comment":"Invoice Comment",
"var invoice.increment_id":"Invoice Id",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -23,7 +23,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
diff --git a/app/code/Magento/Sales/view/frontend/email/order_update.html b/app/code/Magento/Sales/view/frontend/email/order_update.html
index a709a9ed8a7f1..a8f0068b70e87 100644
--- a/app/code/Magento/Sales/view/frontend/email/order_update.html
+++ b/app/code/Magento/Sales/view/frontend/email/order_update.html
@@ -10,7 +10,7 @@
"var order.getCustomerName()":"Customer Name",
"var comment":"Order Comment",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -23,7 +23,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
{{trans 'You can check the status of your order by logging into your account .' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
diff --git a/app/code/Magento/Sales/view/frontend/email/order_update_guest.html b/app/code/Magento/Sales/view/frontend/email/order_update_guest.html
index 5a39b01810c18..749fa3b60ad59 100644
--- a/app/code/Magento/Sales/view/frontend/email/order_update_guest.html
+++ b/app/code/Magento/Sales/view/frontend/email/order_update_guest.html
@@ -9,7 +9,7 @@
"var billing.getName()":"Guest Customer Name",
"var comment":"Order Comment",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -22,7 +22,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
diff --git a/app/code/Magento/Sales/view/frontend/email/shipment_update.html b/app/code/Magento/Sales/view/frontend/email/shipment_update.html
index 6d9efc37004bc..9d1c93287549a 100644
--- a/app/code/Magento/Sales/view/frontend/email/shipment_update.html
+++ b/app/code/Magento/Sales/view/frontend/email/shipment_update.html
@@ -10,7 +10,7 @@
"var order.getCustomerName()":"Customer Name",
"var comment":"Order Comment",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status",
+"var order.getFrontendStatusLabel()":"Order Status",
"var shipment.increment_id":"Shipment Id"
} @-->
{{template config_path="design/email/header_template"}}
@@ -24,7 +24,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
{{trans 'You can check the status of your order by logging into your account .' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
diff --git a/app/code/Magento/Sales/view/frontend/email/shipment_update_guest.html b/app/code/Magento/Sales/view/frontend/email/shipment_update_guest.html
index 4896a00b7bc5a..0d2dccd3377d2 100644
--- a/app/code/Magento/Sales/view/frontend/email/shipment_update_guest.html
+++ b/app/code/Magento/Sales/view/frontend/email/shipment_update_guest.html
@@ -9,7 +9,7 @@
"var billing.getName()":"Guest Customer Name",
"var comment":"Order Comment",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status",
+"var order.getFrontendStatusLabel()":"Order Status",
"var shipment.increment_id":"Shipment Id"
} @-->
{{template config_path="design/email/header_template"}}
@@ -23,7 +23,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
diff --git a/app/design/frontend/Magento/luma/Magento_Sales/email/creditmemo_update.html b/app/design/frontend/Magento/luma/Magento_Sales/email/creditmemo_update.html
index a7b9b330ab9ce..269e46d752084 100644
--- a/app/design/frontend/Magento/luma/Magento_Sales/email/creditmemo_update.html
+++ b/app/design/frontend/Magento/luma/Magento_Sales/email/creditmemo_update.html
@@ -11,7 +11,7 @@
"var this.getUrl($store, 'customer/account/')":"Customer Account URL",
"var order.getCustomerName()":"Customer Name",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -24,7 +24,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
{{trans 'You can check the status of your order by logging into your account .' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
diff --git a/app/design/frontend/Magento/luma/Magento_Sales/email/creditmemo_update_guest.html b/app/design/frontend/Magento/luma/Magento_Sales/email/creditmemo_update_guest.html
index 36279eb26005e..c8bdae7b08fa5 100644
--- a/app/design/frontend/Magento/luma/Magento_Sales/email/creditmemo_update_guest.html
+++ b/app/design/frontend/Magento/luma/Magento_Sales/email/creditmemo_update_guest.html
@@ -10,7 +10,7 @@
"var creditmemo.increment_id":"Credit Memo Id",
"var billing.getName()":"Guest Customer Name",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -23,7 +23,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
diff --git a/app/design/frontend/Magento/luma/Magento_Sales/email/invoice_update.html b/app/design/frontend/Magento/luma/Magento_Sales/email/invoice_update.html
index a739c9f54b08f..8ec54f1e64d9c 100644
--- a/app/design/frontend/Magento/luma/Magento_Sales/email/invoice_update.html
+++ b/app/design/frontend/Magento/luma/Magento_Sales/email/invoice_update.html
@@ -11,7 +11,7 @@
"var comment":"Invoice Comment",
"var invoice.increment_id":"Invoice Id",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -24,7 +24,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
{{trans 'You can check the status of your order by logging into your account .' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
diff --git a/app/design/frontend/Magento/luma/Magento_Sales/email/invoice_update_guest.html b/app/design/frontend/Magento/luma/Magento_Sales/email/invoice_update_guest.html
index a56ee6da9fa25..6028db7b97730 100644
--- a/app/design/frontend/Magento/luma/Magento_Sales/email/invoice_update_guest.html
+++ b/app/design/frontend/Magento/luma/Magento_Sales/email/invoice_update_guest.html
@@ -10,7 +10,7 @@
"var comment":"Invoice Comment",
"var invoice.increment_id":"Invoice Id",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -23,7 +23,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
diff --git a/app/design/frontend/Magento/luma/Magento_Sales/email/order_update.html b/app/design/frontend/Magento/luma/Magento_Sales/email/order_update.html
index 3e4bf8df2f107..fa16ac2196bf4 100644
--- a/app/design/frontend/Magento/luma/Magento_Sales/email/order_update.html
+++ b/app/design/frontend/Magento/luma/Magento_Sales/email/order_update.html
@@ -10,7 +10,7 @@
"var order.getCustomerName()":"Customer Name",
"var comment":"Order Comment",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -23,7 +23,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
{{trans 'You can check the status of your order by logging into your account .' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
diff --git a/app/design/frontend/Magento/luma/Magento_Sales/email/order_update_guest.html b/app/design/frontend/Magento/luma/Magento_Sales/email/order_update_guest.html
index 1075608db4341..8ead615fe01ca 100644
--- a/app/design/frontend/Magento/luma/Magento_Sales/email/order_update_guest.html
+++ b/app/design/frontend/Magento/luma/Magento_Sales/email/order_update_guest.html
@@ -9,7 +9,7 @@
"var billing.getName()":"Guest Customer Name",
"var comment":"Order Comment",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status"
+"var order.getFrontendStatusLabel()":"Order Status"
} @-->
{{template config_path="design/email/header_template"}}
@@ -22,7 +22,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
diff --git a/app/design/frontend/Magento/luma/Magento_Sales/email/shipment_update.html b/app/design/frontend/Magento/luma/Magento_Sales/email/shipment_update.html
index 37bf92b866c74..4f9b7286f3ae4 100644
--- a/app/design/frontend/Magento/luma/Magento_Sales/email/shipment_update.html
+++ b/app/design/frontend/Magento/luma/Magento_Sales/email/shipment_update.html
@@ -10,7 +10,7 @@
"var order.getCustomerName()":"Customer Name",
"var comment":"Order Comment",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status",
+"var order.getFrontendStatusLabel()":"Order Status",
"var shipment.increment_id":"Shipment Id"
} @-->
{{template config_path="design/email/header_template"}}
@@ -24,7 +24,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
{{trans 'You can check the status of your order by logging into your account .' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}
diff --git a/app/design/frontend/Magento/luma/Magento_Sales/email/shipment_update_guest.html b/app/design/frontend/Magento/luma/Magento_Sales/email/shipment_update_guest.html
index 954819949860b..3ef26463ea755 100644
--- a/app/design/frontend/Magento/luma/Magento_Sales/email/shipment_update_guest.html
+++ b/app/design/frontend/Magento/luma/Magento_Sales/email/shipment_update_guest.html
@@ -9,7 +9,7 @@
"var billing.getName()":"Guest Customer Name",
"var comment":"Order Comment",
"var order.increment_id":"Order Id",
-"var order.getStatusLabel()":"Order Status",
+"var order.getFrontendStatusLabel()":"Order Status",
"var shipment.increment_id":"Shipment Id"
} @-->
{{template config_path="design/email/header_template"}}
@@ -23,7 +23,7 @@
"Your order #%increment_id has been updated with a status of %order_status ."
increment_id=$order.increment_id
- order_status=$order.getStatusLabel()
+ order_status=$order.getFrontendStatusLabel()
|raw}}
From ea3a8c7a42ad4132f5641de6d47e9b8d7020cdef Mon Sep 17 00:00:00 2001
From: Alexey Yakimovich
Date: Wed, 14 Nov 2018 15:39:15 +0300
Subject: [PATCH 016/121] MAGETWO-94556: Undefined variables during product
save
- Fixed an issue with missing product data after sku validation;
---
.../adminhtml/web/js/variations/variations.js | 30 ++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js
index a46943bd5d145..c6eee5486d117 100644
--- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js
+++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js
@@ -389,10 +389,23 @@ define([
this.formSaveParams = arguments;
this.attributeSetHandlerModal().openModal();
} else {
+ if (this.validateForm(this.formElement())) {
+ this.clearOutdatedData();
+ }
this.formElement().save(arguments[0], arguments[1]);
}
},
+ /**
+ * @param {Object} formElement
+ *
+ * Validates each form element and returns true, if all elements are valid.
+ */
+ validateForm: function (formElement) {
+ formElement.validate();
+ return !formElement.additionalInvalid && !formElement.source.get('params.invalid');
+ },
+
/**
* Serialize data for specific form fields
*
@@ -410,12 +423,27 @@ define([
if (this.source.data['configurable-matrix']) {
this.source.data['configurable-matrix-serialized'] =
JSON.stringify(this.source.data['configurable-matrix']);
- delete this.source.data['configurable-matrix'];
}
if (this.source.data['associated_product_ids']) {
this.source.data['associated_product_ids_serialized'] =
JSON.stringify(this.source.data['associated_product_ids']);
+ }
+ },
+
+ /**
+ * Clear outdated data for specific form fields
+ *
+ * Outdated fields:
+ * - configurable-matrix;
+ * - associated_product_ids.
+ */
+ clearOutdatedData: function () {
+ if (this.source.data['configurable-matrix']) {
+ delete this.source.data['configurable-matrix'];
+ }
+
+ if (this.source.data['associated_product_ids']) {
delete this.source.data['associated_product_ids'];
}
},
From 8b4c1fa781ef14b2f1b9d3ae46be5b932cf108a6 Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Thu, 15 Nov 2018 18:02:08 +0300
Subject: [PATCH 017/121] MAGETWO-91559: Static blocks with same ID appear in
place of correct block
- Update automated test
---
app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml
index df7cd59a45886..c3c92dc59c288 100644
--- a/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Test/CheckStaticBlocksTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
@@ -63,10 +63,10 @@
-
+
From 1b71e53cd67d7e1ab46f98a867e94225d05cd528 Mon Sep 17 00:00:00 2001
From: Yauhen_Lyskavets
Date: Thu, 15 Nov 2018 15:11:06 +0300
Subject: [PATCH 018/121] MAGETWO-95310: [2.3] Wrong color image when filtering
by color filter
- Bug fix.
---
.../Product/Renderer/Listing/Configurable.php | 29 ++++++++++++++++---
app/code/Magento/Swatches/Helper/Data.php | 14 ++++-----
2 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/app/code/Magento/Swatches/Block/Product/Renderer/Listing/Configurable.php b/app/code/Magento/Swatches/Block/Product/Renderer/Listing/Configurable.php
index e13373fb72558..287134d6bb70a 100644
--- a/app/code/Magento/Swatches/Block/Product/Renderer/Listing/Configurable.php
+++ b/app/code/Magento/Swatches/Block/Product/Renderer/Listing/Configurable.php
@@ -8,7 +8,8 @@
use Magento\Catalog\Block\Product\Context;
use Magento\Catalog\Helper\Product as CatalogProduct;
use Magento\Catalog\Model\Product;
-use Magento\Catalog\Model\Product\Image\UrlBuilder;
+use Magento\Catalog\Model\Layer\Resolver;
+use Magento\Catalog\Model\Layer\Category as CategoryLayer;
use Magento\ConfigurableProduct\Helper\Data;
use Magento\ConfigurableProduct\Model\ConfigurableAttributeData;
use Magento\Customer\Helper\Session\CurrentCustomer;
@@ -39,6 +40,11 @@ class Configurable extends \Magento\Swatches\Block\Product\Renderer\Configurable
*/
private $variationPrices;
+ /**
+ * @var \Magento\Catalog\Model\Layer\Resolver
+ */
+ private $layerResolver;
+
/**
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @param Context $context
@@ -55,6 +61,7 @@ class Configurable extends \Magento\Swatches\Block\Product\Renderer\Configurable
* @param SwatchAttributesProvider|null $swatchAttributesProvider
* @param \Magento\Framework\Locale\Format|null $localeFormat
* @param \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Variations\Prices|null $variationPrices
+ * @param Resolver $layerResolver
*/
public function __construct(
Context $context,
@@ -70,7 +77,8 @@ public function __construct(
array $data = [],
SwatchAttributesProvider $swatchAttributesProvider = null,
\Magento\Framework\Locale\Format $localeFormat = null,
- \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Variations\Prices $variationPrices = null
+ \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Variations\Prices $variationPrices = null,
+ Resolver $layerResolver = null
) {
parent::__construct(
$context,
@@ -92,10 +100,11 @@ public function __construct(
$this->variationPrices = $variationPrices ?: ObjectManager::getInstance()->get(
\Magento\ConfigurableProduct\Model\Product\Type\Configurable\Variations\Prices::class
);
+ $this->layerResolver = $layerResolver ?: ObjectManager::getInstance()->get(Resolver::class);
}
/**
- * @return string
+ * @inheritdoc
*/
protected function getRendererTemplate()
{
@@ -121,7 +130,7 @@ protected function _toHtml()
}
/**
- * @return array
+ * @inheritdoc
*/
protected function getSwatchAttributesData()
{
@@ -247,4 +256,16 @@ private function getLayeredAttributesIfExists(Product $configurableProduct, arra
return $layeredAttributes;
}
+
+ /**
+ * @inheritdoc
+ */
+ public function getCacheKeyInfo()
+ {
+ $cacheKeyInfo = parent::getCacheKeyInfo();
+ /** @var CategoryLayer $catalogLayer */
+ $catalogLayer = $this->layerResolver->get();
+ $cacheKeyInfo[] = $catalogLayer->getStateKey();
+ return $cacheKeyInfo;
+ }
}
diff --git a/app/code/Magento/Swatches/Helper/Data.php b/app/code/Magento/Swatches/Helper/Data.php
index d82109ac12603..a40d65b6bb90b 100644
--- a/app/code/Magento/Swatches/Helper/Data.php
+++ b/app/code/Magento/Swatches/Helper/Data.php
@@ -7,7 +7,6 @@
use Magento\Catalog\Api\Data\ProductInterface as Product;
use Magento\Catalog\Api\ProductRepositoryInterface;
-use Magento\Catalog\Helper\Image;
use Magento\Catalog\Model\Product as ModelProduct;
use Magento\Catalog\Model\Product\Image\UrlBuilder;
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;
@@ -254,18 +253,15 @@ public function loadVariationByFallback(Product $parentProduct, array $attribute
$this->addFilterByParent($productCollection, $parentId);
$configurableAttributes = $this->getAttributesFromConfigurable($parentProduct);
- $allAttributesArray = [];
+
+ $resultAttributesToFilter = [];
foreach ($configurableAttributes as $attribute) {
- if (!empty($attribute['default_value'])) {
- $allAttributesArray[$attribute['attribute_code']] = $attribute['default_value'];
+ $attributeCode = $attribute->getData('attribute_code');
+ if (array_key_exists($attributeCode, $attributes)) {
+ $resultAttributesToFilter[$attributeCode] = $attributes[$attributeCode];
}
}
- $resultAttributesToFilter = array_merge(
- $attributes,
- array_diff_key($allAttributesArray, $attributes)
- );
-
$this->addFilterByAttributes($productCollection, $resultAttributesToFilter);
$variationProduct = $productCollection->getFirstItem();
From 6d5a80c09aa94b38b8e2a5a5504d38257438364f Mon Sep 17 00:00:00 2001
From: Stepan Furman
Date: Sun, 18 Nov 2018 20:13:58 +0200
Subject: [PATCH 019/121] 248: Create customer account
---
.../Model/Resolver/CreateCustomer.php | 117 ++++++++++++++++++
.../CustomerGraphQl/etc/schema.graphqls | 7 +-
2 files changed, 121 insertions(+), 3 deletions(-)
create mode 100644 app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
new file mode 100644
index 0000000000000..4dbf6ea4d7946
--- /dev/null
+++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
@@ -0,0 +1,117 @@
+customerDataProvider = $customerDataProvider;
+ $this->accountManagement = $accountManagement;
+ $this->customerFactory = $customerFactory;
+ $this->dataObjectHelper = $dataObjectHelper;
+ $this->storeManager = $storeManager;
+ $this->subscriberFactory = $subscriberFactory;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function resolve(
+ Field $field,
+ $context,
+ ResolveInfo $info,
+ array $value = null,
+ array $args = null
+ ) {
+ if (!isset($args['input']) || !is_array($args['input']) || empty($args['input'])) {
+ throw new GraphQlInputException(__('"input" value should be specified'));
+ }
+ try {
+ $customerDataObject = $this->customerFactory->create();
+ $this->dataObjectHelper->populateWithArray(
+ $customerDataObject,
+ $args['input'],
+ \Magento\Customer\Api\Data\CustomerInterface::class
+ );
+ $store = $this->storeManager->getStore();
+ $customerDataObject->setWebsiteId($store->getWebsiteId());
+ $customerDataObject->setStoreId($store->getId());
+ $customer = $this->accountManagement->createAccount($customerDataObject, $args['input']['password']);
+ if (array_key_exists('is_subscribed', $args['input'])) {
+ if ($args['input']['is_subscribed']) {
+ $this->subscriberFactory->create()->subscribeCustomerById($customer->getId());
+ }
+ }
+ $data = $this->customerDataProvider->getCustomerById((int)$customer->getId());
+ } catch (LocalizedException $e) {
+ throw new GraphQlInputException(__($e->getMessage()));
+ }
+ return ['customer' => $data];
+ }
+}
diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
index b8411f00c5cb1..951d767eb1e67 100644
--- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
@@ -8,7 +8,8 @@ type Query {
type Mutation {
generateCustomerToken(email: String!, password: String!): CustomerToken @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\GenerateCustomerToken") @doc(description:"Retrieve Customer token")
changeCustomerPassword(currentPassword: String!, newPassword: String!): Customer @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\ChangePassword") @doc(description:"Changes password for logged in customer")
- updateCustomer (input: UpdateCustomerInput): UpdateCustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomer") @doc(description:"Update customer personal information")
+ createCustomer (input: CustomerInput): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\CreateCustomer") @doc(description:"Create customer account")
+ updateCustomer (input: CustomerInput): CustomerOutput @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\UpdateCustomer") @doc(description:"Update customer personal information")
revokeCustomerToken: Boolean @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\RevokeCustomerToken") @doc(description:"Revoke Customer token")
}
@@ -16,7 +17,7 @@ type CustomerToken {
token: String @doc(description: "The customer token")
}
-input UpdateCustomerInput {
+input CustomerInput {
firstname: String
lastname: String
email: String
@@ -24,7 +25,7 @@ input UpdateCustomerInput {
is_subscribed: Boolean
}
-type UpdateCustomerOutput {
+type CustomerOutput {
customer: Customer!
}
From 91edcc574478fc57d798938261c5be4c6732707e Mon Sep 17 00:00:00 2001
From: Stepan Furman
Date: Mon, 19 Nov 2018 09:55:51 +0200
Subject: [PATCH 020/121] 248:Bugfix - Solved 'user is not authorised' error
after creating customer and trying to retrieve data
---
.../Model/Resolver/CreateCustomer.php | 53 ++++++++++++-------
1 file changed, 33 insertions(+), 20 deletions(-)
diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
index 4dbf6ea4d7946..2bf85eefe7617 100644
--- a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
+++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
@@ -7,20 +7,18 @@
namespace Magento\CustomerGraphQl\Model\Resolver;
-use Magento\Customer\Api\AccountManagementInterface;
-use Magento\Customer\Api\Data\CustomerInterfaceFactory;
-use Magento\Framework\Api\DataObjectHelper;
-use Magento\Framework\App\ObjectManager;
-use Magento\Framework\Exception\LocalizedException;
+use Magento\CustomerGraphQl\Model\Customer\CustomerDataProvider;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
+use Magento\Customer\Api\Data\CustomerInterfaceFactory;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
-use Magento\CustomerGraphQl\Model\Customer\CustomerDataProvider;
-use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Query\ResolverInterface;
+use Magento\Authorization\Model\UserContextInterface;
+use Magento\Customer\Api\AccountManagementInterface;
+use Magento\Framework\Exception\LocalizedException;
+use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Newsletter\Model\SubscriberFactory;
use Magento\Store\Model\StoreManagerInterface;
-use Psr\Log\LoggerInterface;
-use Psr\Log\Test\LoggerInterfaceTest;
+use Magento\Framework\Api\DataObjectHelper;
/**
* Create customer data resolver
@@ -51,7 +49,7 @@ class CreateCustomer implements ResolverInterface
*/
private $storeManager;
/**
- * @var Magento\Newsletter\Model\SubscriberFactory
+ * @var SubscriberFactory
*/
private $subscriberFactory;
@@ -93,16 +91,8 @@ public function resolve(
throw new GraphQlInputException(__('"input" value should be specified'));
}
try {
- $customerDataObject = $this->customerFactory->create();
- $this->dataObjectHelper->populateWithArray(
- $customerDataObject,
- $args['input'],
- \Magento\Customer\Api\Data\CustomerInterface::class
- );
- $store = $this->storeManager->getStore();
- $customerDataObject->setWebsiteId($store->getWebsiteId());
- $customerDataObject->setStoreId($store->getId());
- $customer = $this->accountManagement->createAccount($customerDataObject, $args['input']['password']);
+ $customer = $this->createUserAccount($args);
+ $this->setUpUserContext($context, $customer);
if (array_key_exists('is_subscribed', $args['input'])) {
if ($args['input']['is_subscribed']) {
$this->subscriberFactory->create()->subscribeCustomerById($customer->getId());
@@ -114,4 +104,27 @@ public function resolve(
}
return ['customer' => $data];
}
+
+ private function createUserAccount($args)
+ {
+ $customerDataObject = $this->customerFactory->create();
+ $this->dataObjectHelper->populateWithArray(
+ $customerDataObject,
+ $args['input'],
+ \Magento\Customer\Api\Data\CustomerInterface::class
+ );
+ $store = $this->storeManager->getStore();
+ $customerDataObject->setWebsiteId($store->getWebsiteId());
+ $customerDataObject->setStoreId($store->getId());
+
+ $password = array_key_exists('password', $args['input']) ? $args['input']['password'] : null;
+
+ return $this->accountManagement->createAccount($customerDataObject, $password);
+ }
+
+ private function setUpUserContext($context, $customer)
+ {
+ $context->setUserId((int)$customer->getId());
+ $context->setUserType(UserContextInterface::USER_TYPE_CUSTOMER);
+ }
}
From 5ef59e9373174a1c4dc062b823371f40f4143aff Mon Sep 17 00:00:00 2001
From: Yuliya Labudova
Date: Mon, 19 Nov 2018 11:53:04 +0300
Subject: [PATCH 021/121] MAGETWO-57337: Store View (language) switch leads to
404
- Add redirect to the home page in case with switch CMS page from other store
---
.../UrlRewrite/Model/StoreSwitcher/RewriteUrl.php | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/app/code/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrl.php b/app/code/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrl.php
index 2ce00d53588b3..34e82f561ee80 100644
--- a/app/code/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrl.php
+++ b/app/code/Magento/UrlRewrite/Model/StoreSwitcher/RewriteUrl.php
@@ -40,6 +40,8 @@ public function __construct(
}
/**
+ * Switch to another store.
+ *
* @param StoreInterface $fromStore
* @param StoreInterface $targetStore
* @param string $redirectUrl
@@ -75,6 +77,14 @@ public function switch(StoreInterface $fromStore, StoreInterface $targetStore, s
/** @var \Magento\Framework\App\Response\Http $response */
$targetUrl = $targetStore->getBaseUrl();
}
+ } else {
+ $existingRewrite = $this->urlFinder->findOneByData([
+ UrlRewrite::REQUEST_PATH => $urlPath
+ ]);
+ if ($existingRewrite) {
+ /** @var \Magento\Framework\App\Response\Http $response */
+ $targetUrl = $targetStore->getBaseUrl();
+ }
}
return $targetUrl;
From bb4f44fa53176c8ebce6ef2719dcd710d66c35ca Mon Sep 17 00:00:00 2001
From: Lusine
Date: Tue, 20 Nov 2018 14:01:33 +0400
Subject: [PATCH 022/121] MAGETWO-96124: [2.3.x] Custom Customer Attributes get
cleared in case of invalid Customer Account creation on Storefront
- Add automated test script
---
.../Mftf/Page/StorefrontCustomerCreatePage.xml | 3 ++-
.../StorefrontCustomerCreateFormSection.xml | 14 ++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerCreatePage.xml b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerCreatePage.xml
index e2ebf638934c6..101ff1451ccbf 100644
--- a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerCreatePage.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerCreatePage.xml
@@ -9,6 +9,7 @@
-
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml
index 2b5662cdd623e..a8c7cefb773d1 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml
@@ -11,9 +11,23 @@
+
From 4864793070dabf2de761c938a8c85404bf802920 Mon Sep 17 00:00:00 2001
From: David Grigoryan
Date: Wed, 21 Nov 2018 12:40:42 +0400
Subject: [PATCH 023/121] MAGETWO-95823: Order Sales Report includes canceled
orders
- Updated automated test
---
.../Test/CancelOrdersInOrderSalesReportTest.xml | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml
index 967b0f3caf515..38ad418865eac 100644
--- a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml
+++ b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml
@@ -10,12 +10,13 @@
-
+
+
@@ -32,6 +33,13 @@
+
+
+
+
+
+
+
@@ -69,12 +77,5 @@
-
-
-
-
-
-
-
From fbec41e5b8720c9e76203dc729213574a7754d97 Mon Sep 17 00:00:00 2001
From: Lusine
Date: Thu, 22 Nov 2018 17:33:10 +0400
Subject: [PATCH 024/121] MAGETWO-57337: Store View (language) switch leads to
404
- Add automated test script
---
.../Test/Mftf/ActionGroup/CMSActionGroup.xml | 16 +++++
.../StoreViewLanguageCorrectSwitchTest.xml | 60 +++++++++++++++++++
2 files changed, 76 insertions(+)
create mode 100644 app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml
diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml
index 75e059f620c2d..e2f22d29d3456 100644
--- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml
+++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CMSActionGroup.xml
@@ -44,4 +44,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml
new file mode 100644
index 0000000000000..65fabfe25e817
--- /dev/null
+++ b/app/code/Magento/Cms/Test/Mftf/Test/StoreViewLanguageCorrectSwitchTest.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From c6c9ff4a4a82025ad316f0712a045f1f804b2aab Mon Sep 17 00:00:00 2001
From: Karen_Mkhitaryan
Date: Thu, 22 Nov 2018 19:03:20 +0400
Subject: [PATCH 025/121] MAGETWO-94556: Undefined variables during product
save
- Add automated test
---
.../AdminProductAttributeOptionsSection.xml | 1 +
.../Section/AdminProductGridFilterSection.xml | 2 +-
.../AdminProductFormConfigurationsSection.xml | 1 +
.../AdminConfigurableProductCreateTest.xml | 65 +++++++++++++++++++
4 files changed, 68 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeOptionsSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeOptionsSection.xml
index 0f438540603d0..5f1112eef3625 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeOptionsSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductAttributeOptionsSection.xml
@@ -10,5 +10,6 @@
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml
index 611f12a39b510..2e4b9c6cb0430 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml
index 0de7bc00044c8..1541b5ae81a28 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml
@@ -22,6 +22,7 @@
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
index 48f46a1205ec3..f400a4d4708a8 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
@@ -68,4 +68,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From de2807d853dd8a1f817904950bbb16b4e691b31b Mon Sep 17 00:00:00 2001
From: Karen_Mkhitaryan
Date: Thu, 22 Nov 2018 19:11:49 +0400
Subject: [PATCH 026/121] MAGETWO-94556: Undefined variables during product
save
- Add minor change
---
.../Test/Mftf/Section/AdminProductFormConfigurationsSection.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml
index 1541b5ae81a28..d4ac6bec9cfd5 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminProductFormConfigurationsSection.xml
@@ -18,11 +18,11 @@
+
-
From 6c2e4c774d8ec0dbca14c0c02c985b93728d1f5f Mon Sep 17 00:00:00 2001
From: Karen_Mkhitaryan
Date: Mon, 26 Nov 2018 11:23:43 +0400
Subject: [PATCH 027/121] MAGETWO-95820: Order placed by new customer before
they registered is displayed in the admin under the name Guest
- Add fix after review
---
.../Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
index 2e2dee82a6eaf..38a23e43d426a 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
@@ -15,7 +15,8 @@
-
+
+
@@ -29,6 +30,7 @@
+
From 1ea5632e9a44e1b341273e1322c4a4bf161026d5 Mon Sep 17 00:00:00 2001
From: Karen_Mkhitaryan
Date: Mon, 26 Nov 2018 12:28:59 +0400
Subject: [PATCH 028/121] MAGETWO-95820: Order placed by new customer before
they registered is displayed in the admin under the name Guest
- Add minor change after internal review
---
.../Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
index 38a23e43d426a..a781315f7cb0a 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
@@ -30,7 +30,7 @@
-
+
@@ -50,7 +50,9 @@
+
+
From 46fd447c15e196735ee88af0441fd96678afdfa8 Mon Sep 17 00:00:00 2001
From: Karen_Mkhitaryan
Date: Mon, 26 Nov 2018 12:30:19 +0400
Subject: [PATCH 029/121] MAGETWO-95820: Order placed by new customer before
they registered is displayed in the admin under the name Guest
- Add minor change after internal review
---
.../Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml | 2 --
1 file changed, 2 deletions(-)
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
index a781315f7cb0a..740d75cb0ffe3 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
@@ -50,9 +50,7 @@
-
-
From 27d3e660c4cbb9bc62399e027469f2279e8115b6 Mon Sep 17 00:00:00 2001
From: Yauhen_Lyskavets
Date: Tue, 27 Nov 2018 18:49:18 +0300
Subject: [PATCH 030/121] MAGETWO-96406: [2.3.x] Swatch Attribute is not
displayed in the Widget CMS
- Bug fix.
---
.../Block/Product/ProductsList.php | 64 +++++++++++++-
.../layout/catalog_widget_product_list.xml | 17 ++++
.../product/widget/content/grid.phtml | 87 ++++++++++---------
.../layout/catalog_widget_product_list.xml | 12 +++
4 files changed, 136 insertions(+), 44 deletions(-)
create mode 100644 app/code/Magento/CatalogWidget/view/frontend/layout/catalog_widget_product_list.xml
create mode 100644 app/code/Magento/Swatches/view/frontend/layout/catalog_widget_product_list.xml
diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php
index 55f4d67273379..a2067bae7807d 100644
--- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php
+++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php
@@ -6,10 +6,14 @@
namespace Magento\CatalogWidget\Block\Product;
+use Magento\Catalog\Model\Product;
use Magento\Framework\App\ObjectManager;
+use Magento\Framework\App\ActionInterface;
use Magento\Framework\DataObject\IdentityInterface;
use Magento\Framework\Pricing\PriceCurrencyInterface;
use Magento\Framework\Serialize\Serializer\Json;
+use Magento\Framework\Url\Helper\Data as UrlHelper;
+use Magento\Framework\View\LayoutFactory;
use Magento\Widget\Block\BlockInterface;
/**
@@ -94,6 +98,21 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem
*/
private $json;
+ /**
+ * @var LayoutFactory
+ */
+ private $layoutFactory;
+
+ /**
+ * @var UrlHelper
+ */
+ private $urlHelper;
+
+ /**
+ * @var \Magento\Framework\View\Element\RendererList
+ */
+ private $rendererListBlock;
+
/**
* @param \Magento\Catalog\Block\Product\Context $context
* @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory
@@ -104,6 +123,10 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem
* @param \Magento\Widget\Helper\Conditions $conditionsHelper
* @param array $data
* @param Json|null $json
+ * @param LayoutFactory|null $layoutFactory
+ * @param UrlHelper|null $urlHelper
+ *
+ * @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
\Magento\Catalog\Block\Product\Context $context,
@@ -114,7 +137,9 @@ public function __construct(
\Magento\CatalogWidget\Model\Rule $rule,
\Magento\Widget\Helper\Conditions $conditionsHelper,
array $data = [],
- Json $json = null
+ Json $json = null,
+ LayoutFactory $layoutFactory = null,
+ UrlHelper $urlHelper = null
) {
$this->productCollectionFactory = $productCollectionFactory;
$this->catalogProductVisibility = $catalogProductVisibility;
@@ -123,6 +148,8 @@ public function __construct(
$this->rule = $rule;
$this->conditionsHelper = $conditionsHelper;
$this->json = $json ?: ObjectManager::getInstance()->get(Json::class);
+ $this->layoutFactory = $layoutFactory ?: ObjectManager::getInstance()->get(LayoutFactory::class);
+ $this->urlHelper = $urlHelper ?: ObjectManager::getInstance()->get(UrlHelper::class);
parent::__construct(
$context,
$data
@@ -217,6 +244,41 @@ public function getProductPriceHtml(
return $price;
}
+ /**
+ * @inheritdoc
+ */
+ protected function getDetailsRendererList()
+ {
+ if (empty($this->rendererListBlock)) {
+ /** @var $layout \Magento\Framework\View\LayoutInterface */
+ $layout = $this->layoutFactory->create(['cacheable' => false]);
+ $layout->getUpdate()->addHandle('catalog_widget_product_list')->load();
+ $layout->generateXml();
+ $layout->generateElements();
+
+ $this->rendererListBlock = $layout->getBlock('category.product.type.widget.details.renderers');
+ }
+ return $this->rendererListBlock;
+ }
+
+ /**
+ * Get post parameters.
+ *
+ * @param Product $product
+ * @return array
+ */
+ public function getAddToCartPostParams(Product $product)
+ {
+ $url = $this->getAddToCartUrl($product);
+ return [
+ 'action' => $url,
+ 'data' => [
+ 'product' => $product->getEntityId(),
+ ActionInterface::PARAM_NAME_URL_ENCODED => $this->urlHelper->getEncodedUrl($url),
+ ]
+ ];
+ }
+
/**
* @inheritdoc
*/
diff --git a/app/code/Magento/CatalogWidget/view/frontend/layout/catalog_widget_product_list.xml b/app/code/Magento/CatalogWidget/view/frontend/layout/catalog_widget_product_list.xml
new file mode 100644
index 0000000000000..9a6d704ecce9b
--- /dev/null
+++ b/app/code/Magento/CatalogWidget/view/frontend/layout/catalog_widget_product_list.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml b/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml
index f2273f7d44ff3..159d4010c0115 100644
--- a/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml
+++ b/app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml
@@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+use Magento\Framework\App\Action\Action;
// @codingStandardsIgnoreFile
@@ -48,57 +49,57 @@
= $block->escapeHtml($_item->getName()) ?>
- getProductPriceHtml($_item, $type);
- ?>
-
= $block->getReviewsSummaryHtml($_item, $templateType) ?>
+ = $block->getProductPriceHtml($_item, $type) ?>
+
+ = $block->getProductDetailsHtml($_item) ?>
+
-
-
-
- isSaleable()): ?>
- getTypeInstance()->hasRequiredOptions($_item)): ?>
-
- = $block->escapeHtml(__('Add to Cart')) ?>
-
+
+
+
+
+ isSaleable()): ?>
+ getAddToCartPostParams($_item); ?>
+
- helper('Magento\Framework\Data\Helper\PostHelper');
- $postData = $postDataHelper->getPostData($block->getAddToCartUrl($_item), ['product' => $_item->getEntityId()])
- ?>
-
- = $block->escapeHtml(__('Add to Cart')) ?>
-
+ getIsSalable()): ?>
+
= $block->escapeHtml(__('In stock')) ?>
+
+
= $block->escapeHtml(__('Out of stock')) ?>
+
-
- getIsSalable()): ?>
-
= $block->escapeHtml(__('In stock')) ?>
-
-
= $block->escapeHtml(__('Out of stock')) ?>
+
+
+
+
-
-
-
-
+
+
+
diff --git a/app/code/Magento/Swatches/view/frontend/layout/catalog_widget_product_list.xml b/app/code/Magento/Swatches/view/frontend/layout/catalog_widget_product_list.xml
new file mode 100644
index 0000000000000..91798cbd9947f
--- /dev/null
+++ b/app/code/Magento/Swatches/view/frontend/layout/catalog_widget_product_list.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From dabc8865967719c5e387c5c7576a978f5198ee22 Mon Sep 17 00:00:00 2001
From: Yaroslav Rogoza
Date: Wed, 28 Nov 2018 16:51:00 +0100
Subject: [PATCH 031/121] Added possibility to retrieve cart information
---
.../Model/Cart/ExtractDataFromCart.php | 3 +
.../QuoteGraphQl/Model/Resolver/Cart.php | 67 +++++++++++++++++++
.../Magento/QuoteGraphQl/etc/schema.graphqls | 6 +-
3 files changed, 71 insertions(+), 5 deletions(-)
create mode 100644 app/code/Magento/QuoteGraphQl/Model/Resolver/Cart.php
diff --git a/app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromCart.php b/app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromCart.php
index faefa686606e2..438f28980918d 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromCart.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Cart/ExtractDataFromCart.php
@@ -40,8 +40,11 @@ public function execute(Quote $cart): array
];
}
+ $appliedCoupon = $cart->getCouponCode();
+
return [
'items' => $items,
+ 'applied_coupon' => $appliedCoupon ? ['code' => $appliedCoupon] : null
];
}
}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/Cart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/Cart.php
new file mode 100644
index 0000000000000..5023c186f1e6c
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/Cart.php
@@ -0,0 +1,67 @@
+getCartForUser = $getCartForUser;
+ $this->extractDataFromCart = $extractDataFromCart;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
+ {
+ if (!isset($args['cart_id'])) {
+ throw new GraphQlInputException(__('Required parameter "cart_id" is missing'));
+ }
+ $maskedCartId = $args['cart_id'];
+
+ $currentUserId = $context->getUserId();
+ $cart = $this->getCartForUser->execute($maskedCartId, $currentUserId);
+
+ $data = array_merge(
+ [
+ 'cart_id' => $maskedCartId,
+ 'model' => $cart
+ ],
+ $this->extractDataFromCart->execute($cart)
+ );
+
+ return $data;
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
index edc643973ce77..4c1101a5f90a8 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 {
- getAvailableShippingMethodsOnCart(input: AvailableShippingMethodsOnCartInput): AvailableShippingMethodsOnCartOutput @doc(description:"Returns available shipping methods for cart by address/address_id")
+ Cart(cart_id: String!): Cart @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\Cart") @doc(description:"Returns information about shopping cart")
}
type Mutation {
@@ -84,10 +84,6 @@ input AvailableShippingMethodsOnCartInput {
address: CartAddressInput
}
-type AvailableShippingMethodsOnCartOutput {
- available_shipping_methods: [CheckoutShippingMethod]
-}
-
input ApplyCouponToCartInput {
cart_id: String!
coupon_code: String!
From af0b38bdcbb393d94db3422e34c072572165a3b9 Mon Sep 17 00:00:00 2001
From: Stepan Furman
Date: Wed, 28 Nov 2018 22:17:05 +0200
Subject: [PATCH 032/121] refactoring + first test
---
.../Model/Resolver/CreateCustomer.php | 27 +++++--
.../GraphQl/Customer/CreateCustomerTest.php | 73 +++++++++++++++++++
2 files changed, 93 insertions(+), 7 deletions(-)
create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php
diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
index 2bf85eefe7617..a265dc300b923 100644
--- a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
+++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
@@ -7,18 +7,20 @@
namespace Magento\CustomerGraphQl\Model\Resolver;
-use Magento\CustomerGraphQl\Model\Customer\CustomerDataProvider;
-use Magento\Framework\GraphQl\Exception\GraphQlInputException;
-use Magento\Customer\Api\Data\CustomerInterfaceFactory;
-use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
-use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Authorization\Model\UserContextInterface;
use Magento\Customer\Api\AccountManagementInterface;
+use Magento\Customer\Api\Data\CustomerInterface;
+use Magento\Customer\Api\Data\CustomerInterfaceFactory;
+use Magento\CustomerGraphQl\Model\Customer\CustomerDataProvider;
+use Magento\Framework\Api\DataObjectHelper;
use Magento\Framework\Exception\LocalizedException;
+use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\GraphQl\Config\Element\Field;
+use Magento\Framework\GraphQl\Exception\GraphQlInputException;
+use Magento\Framework\GraphQl\Query\ResolverInterface;
+use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Magento\Newsletter\Model\SubscriberFactory;
use Magento\Store\Model\StoreManagerInterface;
-use Magento\Framework\Api\DataObjectHelper;
/**
* Create customer data resolver
@@ -102,16 +104,23 @@ public function resolve(
} catch (LocalizedException $e) {
throw new GraphQlInputException(__($e->getMessage()));
}
+
return ['customer' => $data];
}
+ /**
+ * @param $args
+ * @return CustomerInterface
+ * @throws LocalizedException
+ * @throws NoSuchEntityException
+ */
private function createUserAccount($args)
{
$customerDataObject = $this->customerFactory->create();
$this->dataObjectHelper->populateWithArray(
$customerDataObject,
$args['input'],
- \Magento\Customer\Api\Data\CustomerInterface::class
+ CustomerInterface::class
);
$store = $this->storeManager->getStore();
$customerDataObject->setWebsiteId($store->getWebsiteId());
@@ -122,6 +131,10 @@ private function createUserAccount($args)
return $this->accountManagement->createAccount($customerDataObject, $password);
}
+ /**
+ * @param $context
+ * @param CustomerInterface $customer
+ */
private function setUpUserContext($context, $customer)
{
$context->setUserId((int)$customer->getId());
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php
new file mode 100644
index 0000000000000..80a24eacb5f2c
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php
@@ -0,0 +1,73 @@
+customerRegistry = Bootstrap::getObjectManager()->get(CustomerRegistry::class);
+ $this->customerRepository = Bootstrap::getObjectManager()->get(CustomerRepositoryInterface::class);
+ }
+
+ /**
+ * @throws \Exception
+ */
+ public function testCreateCustomerAccount()
+ {
+ $newFirstname = 'Richard';
+ $newLastname = 'Rowe';
+ $currentPassword = 'test123#';
+ $newEmail = 'customer_created' . rand(1, 2000000) . '@example.com';
+
+ $query = <<graphQlQuery($query);
+
+ $this->assertEquals($newFirstname, $response['createCustomer']['customer']['firstname']);
+ $this->assertEquals($newLastname, $response['createCustomer']['customer']['lastname']);
+ $this->assertEquals($newEmail, $response['createCustomer']['customer']['email']);
+ $this->assertEquals(true, $response['createCustomer']['customer']['is_subscribed']);
+ }
+}
From acf541e7ba9967be7932bdac5c329fb3841829e1 Mon Sep 17 00:00:00 2001
From: David Grigoryan
Date: Thu, 29 Nov 2018 11:54:39 +0400
Subject: [PATCH 033/121] MAGETWO-96106: CMS Block status is not staged
- Updated automated test
---
.../Magento/Cms/Test/Mftf/Data/BlockData.xml | 18 ++++++++
.../Test/Mftf/Page/AdminCmsEditBlockPage.xml | 14 ++++++
.../Mftf/Section/AdminBlockGridSection.xml | 18 ++++++++
.../ActionGroup/AdminWidgetActionGroup.xml | 44 +++++++++++++++++++
.../Widget/Test/Mftf/Data/WidgetData.xml | 19 ++++++++
.../Test/Mftf/Page/AdminNewWidgetPage.xml | 4 +-
.../Mftf/Section/AdminNewWidgetSection.xml | 8 +++-
7 files changed, 122 insertions(+), 3 deletions(-)
create mode 100644 app/code/Magento/Cms/Test/Mftf/Data/BlockData.xml
create mode 100644 app/code/Magento/Cms/Test/Mftf/Page/AdminCmsEditBlockPage.xml
create mode 100644 app/code/Magento/Cms/Test/Mftf/Section/AdminBlockGridSection.xml
create mode 100644 app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetActionGroup.xml
create mode 100644 app/code/Magento/Widget/Test/Mftf/Data/WidgetData.xml
diff --git a/app/code/Magento/Cms/Test/Mftf/Data/BlockData.xml b/app/code/Magento/Cms/Test/Mftf/Data/BlockData.xml
new file mode 100644
index 0000000000000..dea047ec43568
--- /dev/null
+++ b/app/code/Magento/Cms/Test/Mftf/Data/BlockData.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ Sales25off
+ Sales25off
+ All Store Views
+ sales25off everything!
+ 0
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Page/AdminCmsEditBlockPage.xml b/app/code/Magento/Cms/Test/Mftf/Page/AdminCmsEditBlockPage.xml
new file mode 100644
index 0000000000000..3fd100ee02aa2
--- /dev/null
+++ b/app/code/Magento/Cms/Test/Mftf/Page/AdminCmsEditBlockPage.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Section/AdminBlockGridSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/AdminBlockGridSection.xml
new file mode 100644
index 0000000000000..ab15570a01f40
--- /dev/null
+++ b/app/code/Magento/Cms/Test/Mftf/Section/AdminBlockGridSection.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetActionGroup.xml
new file mode 100644
index 0000000000000..05c56f588c5d0
--- /dev/null
+++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetActionGroup.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Widget/Test/Mftf/Data/WidgetData.xml b/app/code/Magento/Widget/Test/Mftf/Data/WidgetData.xml
new file mode 100644
index 0000000000000..4c6e98aafd765
--- /dev/null
+++ b/app/code/Magento/Widget/Test/Mftf/Data/WidgetData.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ CMS Static Block
+ Magento Luma
+ testName
+ All Store Views
+ All Pages
+ Page Top
+
+
diff --git a/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml b/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml
index 8eb0a5f65318e..d495a36f68d0a 100644
--- a/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml
+++ b/app/code/Magento/Widget/Test/Mftf/Page/AdminNewWidgetPage.xml
@@ -7,8 +7,8 @@
-->
-
+ 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 38b4df335ea83..bc90c45ae5d5f 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">
@@ -25,5 +25,11 @@
+
+
+
+
+
+
From bcfae0ce0eeeb1203ba114d274d53b816c117c3e Mon Sep 17 00:00:00 2001
From: Stepan Furman
Date: Mon, 3 Dec 2018 23:27:04 +0200
Subject: [PATCH 034/121] extend CustomerInput schema
---
.../Magento/CustomerGraphQl/etc/schema.graphqls | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
index a6b48b62568d1..9e33b8a0d3fa7 100644
--- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
@@ -18,10 +18,16 @@ type CustomerToken {
}
input CustomerInput {
- firstname: String
- lastname: String
- email: String
- password: String
+ prefix: String
+ firstname: String!
+ middlename: String!
+ lastname: String!
+ suffix: String
+ dob: String
+ taxvat: String
+ gender: String
+ email: String!
+ password: String!
is_subscribed: Boolean
}
From 9bf12ccb6439e611c762e973ccc5f3d68568669f Mon Sep 17 00:00:00 2001
From: Stepan Furman
Date: Tue, 4 Dec 2018 00:52:16 +0200
Subject: [PATCH 035/121] subscription implementetion way changed, schema
required fields removed, gender input type changed
---
.../Model/Resolver/CreateCustomer.php | 21 +++++++++++--------
.../CustomerGraphQl/etc/schema.graphqls | 12 +++++------
2 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
index a265dc300b923..51353cd5b27aa 100644
--- a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
+++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
@@ -11,6 +11,7 @@
use Magento\Customer\Api\AccountManagementInterface;
use Magento\Customer\Api\Data\CustomerInterface;
use Magento\Customer\Api\Data\CustomerInterfaceFactory;
+use Magento\CustomerGraphQl\Model\Customer\ChangeSubscriptionStatus;
use Magento\CustomerGraphQl\Model\Customer\CustomerDataProvider;
use Magento\Framework\Api\DataObjectHelper;
use Magento\Framework\Exception\LocalizedException;
@@ -22,26 +23,20 @@
use Magento\Newsletter\Model\SubscriberFactory;
use Magento\Store\Model\StoreManagerInterface;
-/**
- * Create customer data resolver
- */
class CreateCustomer implements ResolverInterface
{
/**
* @var CustomerDataProvider
*/
private $customerDataProvider;
-
/**
* @var AccountManagementInterface
*/
private $accountManagement;
-
/**
* @var CustomerInterfaceFactory
*/
private $customerFactory;
-
/**
* @var DataObjectHelper
*/
@@ -54,6 +49,10 @@ class CreateCustomer implements ResolverInterface
* @var SubscriberFactory
*/
private $subscriberFactory;
+ /**
+ * @var ChangeSubscriptionStatus
+ */
+ private $changeSubscriptionStatus;
/**
* @param DataObjectHelper $dataObjectHelper
@@ -62,6 +61,7 @@ class CreateCustomer implements ResolverInterface
* @param StoreManagerInterface $storeManager
* @param SubscriberFactory $subscriberFactory
* @param CustomerDataProvider $customerDataProvider
+ * @param ChangeSubscriptionStatus $changeSubscriptionStatus
*/
public function __construct(
DataObjectHelper $dataObjectHelper,
@@ -69,7 +69,8 @@ public function __construct(
AccountManagementInterface $accountManagement,
StoreManagerInterface $storeManager,
SubscriberFactory $subscriberFactory,
- CustomerDataProvider $customerDataProvider
+ CustomerDataProvider $customerDataProvider,
+ ChangeSubscriptionStatus $changeSubscriptionStatus
) {
$this->customerDataProvider = $customerDataProvider;
$this->accountManagement = $accountManagement;
@@ -77,6 +78,7 @@ public function __construct(
$this->dataObjectHelper = $dataObjectHelper;
$this->storeManager = $storeManager;
$this->subscriberFactory = $subscriberFactory;
+ $this->changeSubscriptionStatus = $changeSubscriptionStatus;
}
/**
@@ -94,13 +96,14 @@ public function resolve(
}
try {
$customer = $this->createUserAccount($args);
+ $customerId = (int)$customer->getId();
$this->setUpUserContext($context, $customer);
if (array_key_exists('is_subscribed', $args['input'])) {
if ($args['input']['is_subscribed']) {
- $this->subscriberFactory->create()->subscribeCustomerById($customer->getId());
+ $this->changeSubscriptionStatus->execute($customerId, true);
}
}
- $data = $this->customerDataProvider->getCustomerById((int)$customer->getId());
+ $data = $this->customerDataProvider->getCustomerById($customerId);
} catch (LocalizedException $e) {
throw new GraphQlInputException(__($e->getMessage()));
}
diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
index 9e33b8a0d3fa7..9ff16eddbe5f3 100644
--- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
@@ -19,15 +19,15 @@ type CustomerToken {
input CustomerInput {
prefix: String
- firstname: String!
- middlename: String!
- lastname: String!
+ firstname: String
+ middlename: String
+ lastname: String
suffix: String
dob: String
taxvat: String
- gender: String
- email: String!
- password: String!
+ gender: Int
+ email: String
+ password: String
is_subscribed: Boolean
}
From 906aeb25f9c1dd4cf45e343f6405fef0766ab5fd Mon Sep 17 00:00:00 2001
From: Stepan Furman
Date: Tue, 4 Dec 2018 09:47:25 +0200
Subject: [PATCH 036/121] added customer input fields doc block, changed try
catch block for handling only validation exceptions
---
.../Model/Resolver/CreateCustomer.php | 15 +++++++++++--
.../CustomerGraphQl/etc/schema.graphqls | 22 +++++++++----------
2 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
index 51353cd5b27aa..503c7203233f8 100644
--- a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
+++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
@@ -18,8 +18,11 @@
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
+use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
+use Magento\Framework\GraphQl\Query\Resolver\Value;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
+use Magento\Framework\Validator\Exception as ValidatorException;
use Magento\Newsletter\Model\SubscriberFactory;
use Magento\Store\Model\StoreManagerInterface;
@@ -82,7 +85,15 @@ public function __construct(
}
/**
- * @inheritdoc
+ * @param Field $field
+ * @param ContextInterface $context
+ * @param ResolveInfo $info
+ * @param array|null $value
+ * @param array|null $args
+ * @return array|Value|mixed
+ * @throws GraphQlInputException
+ * @throws LocalizedException
+ * @throws NoSuchEntityException
*/
public function resolve(
Field $field,
@@ -104,7 +115,7 @@ public function resolve(
}
}
$data = $this->customerDataProvider->getCustomerById($customerId);
- } catch (LocalizedException $e) {
+ } catch (ValidatorException $e) {
throw new GraphQlInputException(__($e->getMessage()));
}
diff --git a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
index 9ff16eddbe5f3..d7a00b70303e4 100644
--- a/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/CustomerGraphQl/etc/schema.graphqls
@@ -18,17 +18,17 @@ type CustomerToken {
}
input CustomerInput {
- prefix: String
- firstname: String
- middlename: String
- lastname: String
- suffix: String
- dob: String
- taxvat: String
- gender: Int
- email: String
- password: String
- is_subscribed: Boolean
+ prefix: String @doc(description: "An honorific, such as Dr., Mr., or Mrs.")
+ firstname: String @doc(description: "The customer's first name")
+ middlename: String @doc(description: "The customer's middle name")
+ lastname: String @doc(description: "The customer's family name")
+ suffix: String @doc(description: "A value such as Sr., Jr., or III")
+ email: String @doc(description: "The customer's email address. Required")
+ dob: String @doc(description: "The customer's date of birth")
+ taxvat: String @doc(description: "The customer's Tax/VAT number (for corporate customers)")
+ gender: Int @doc(description: "The customer's gender(Male - 1, Female - 2)")
+ password: String @doc(description: "The customer's password")
+ is_subscribed: Boolean @doc(description: "Indicates whether the customer is subscribed to the company's newsletter")
}
type CustomerOutput {
From 0136faf798d7c67907981ab25f4db0850aeeaa03 Mon Sep 17 00:00:00 2001
From: Stepan Furman
Date: Tue, 4 Dec 2018 11:25:48 +0200
Subject: [PATCH 037/121] turn InputMismatchException into
GraphQlInputException
---
.../Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
index 503c7203233f8..ad09fd71efde3 100644
--- a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
+++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
@@ -16,6 +16,7 @@
use Magento\Framework\Api\DataObjectHelper;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
+use Magento\Framework\Exception\State\InputMismatchException;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
@@ -117,6 +118,8 @@ public function resolve(
$data = $this->customerDataProvider->getCustomerById($customerId);
} catch (ValidatorException $e) {
throw new GraphQlInputException(__($e->getMessage()));
+ } catch (InputMismatchException $e) {
+ throw new GraphQlInputException(__($e->getMessage()));
}
return ['customer' => $data];
From 72b3c93f37c4c559ec2eab76b16b943d94961527 Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Tue, 4 Dec 2018 14:59:07 +0300
Subject: [PATCH 038/121] MAGETWO-95820: Order placed by new customer before
they registered is displayed in the admin under the name Guest
- Update automated test
---
.../Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
index 740d75cb0ffe3..52eb0c3eb69e4 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
@@ -51,7 +51,7 @@
-
+
From 064b76e914ef2f95f8f1476e107194e4a0deae9a Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Tue, 4 Dec 2018 15:57:38 +0300
Subject: [PATCH 039/121] MAGETWO-95820: Order placed by new customer before
they registered is displayed in the admin under the name Guest
- Update automated test
---
.../Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
index 52eb0c3eb69e4..e489f80ab6281 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
@@ -52,8 +52,8 @@
-
-
+
+
From 579772cd4a0813cb8c0c12891707835d37806dd6 Mon Sep 17 00:00:00 2001
From: Yauhen_Lyskavets
Date: Tue, 4 Dec 2018 16:48:43 +0300
Subject: [PATCH 040/121] MAGETWO-95310: [2.3] Wrong color image when filtering
by color filter
- CM test fix.
---
.../Swatches/Block/Product/Renderer/Listing/Configurable.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/code/Magento/Swatches/Block/Product/Renderer/Listing/Configurable.php b/app/code/Magento/Swatches/Block/Product/Renderer/Listing/Configurable.php
index 287134d6bb70a..2e4980c2fbfd0 100644
--- a/app/code/Magento/Swatches/Block/Product/Renderer/Listing/Configurable.php
+++ b/app/code/Magento/Swatches/Block/Product/Renderer/Listing/Configurable.php
@@ -192,6 +192,7 @@ protected function getOptionImages()
* Add images to result json config in case of Layered Navigation is used
*
* @return array
+ * @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
* @since 100.2.0
*/
protected function _getAdditionalConfig()
From 9f80c0106f59bb1d2e5d4409c17045901fee1534 Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Tue, 4 Dec 2018 16:59:39 +0300
Subject: [PATCH 041/121] MAGETWO-95820: Order placed by new customer before
they registered is displayed in the admin under the name Guest
- Update automated test
---
.../Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
index e489f80ab6281..79936776ab0ac 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
@@ -51,9 +51,9 @@
-
-
-
+
+
+
From 255b8f226400a1a5f2e2d93b877bfffe1a8f60ea Mon Sep 17 00:00:00 2001
From: Stepan Furman
Date: Tue, 4 Dec 2018 20:30:20 +0200
Subject: [PATCH 042/121] split class, format changes
---
.../Model/Customer/CreateAccount.php | 78 ++++++++++++
.../Model/Customer/SetUpUserContext.php | 23 ++++
.../Model/Resolver/CreateCustomer.php | 113 ++++--------------
3 files changed, 125 insertions(+), 89 deletions(-)
create mode 100644 app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php
create mode 100644 app/code/Magento/CustomerGraphQl/Model/Customer/SetUpUserContext.php
diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php b/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php
new file mode 100644
index 0000000000000..355bd1c6ec853
--- /dev/null
+++ b/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php
@@ -0,0 +1,78 @@
+dataObjectHelper = $dataObjectHelper;
+ $this->customerFactory = $customerFactory;
+ $this->accountManagement = $accountManagement;
+ $this->storeManager = $storeManager;
+ }
+
+ /**
+ * @param array $args
+ * @return CustomerInterface
+ * @throws LocalizedException
+ * @throws NoSuchEntityException
+ */
+ public function execute($args)
+ {
+ $customerDataObject = $this->customerFactory->create();
+ $this->dataObjectHelper->populateWithArray(
+ $customerDataObject,
+ $args['input'],
+ CustomerInterface::class
+ );
+ $store = $this->storeManager->getStore();
+ $customerDataObject->setWebsiteId($store->getWebsiteId());
+ $customerDataObject->setStoreId($store->getId());
+
+ $password = array_key_exists('password', $args['input']) ? $args['input']['password'] : null;
+
+ return $this->accountManagement->createAccount($customerDataObject, $password);
+ }
+}
diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/SetUpUserContext.php b/app/code/Magento/CustomerGraphQl/Model/Customer/SetUpUserContext.php
new file mode 100644
index 0000000000000..94131722e5a9f
--- /dev/null
+++ b/app/code/Magento/CustomerGraphQl/Model/Customer/SetUpUserContext.php
@@ -0,0 +1,23 @@
+setUserId((int)$customer->getId());
+ $context->setUserType(UserContextInterface::USER_TYPE_CUSTOMER);
+ }
+}
diff --git a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
index ad09fd71efde3..299045c6b62b0 100644
--- a/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
+++ b/app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php
@@ -7,94 +7,62 @@
namespace Magento\CustomerGraphQl\Model\Resolver;
-use Magento\Authorization\Model\UserContextInterface;
-use Magento\Customer\Api\AccountManagementInterface;
-use Magento\Customer\Api\Data\CustomerInterface;
-use Magento\Customer\Api\Data\CustomerInterfaceFactory;
use Magento\CustomerGraphQl\Model\Customer\ChangeSubscriptionStatus;
+use Magento\CustomerGraphQl\Model\Customer\CreateAccount;
use Magento\CustomerGraphQl\Model\Customer\CustomerDataProvider;
-use Magento\Framework\Api\DataObjectHelper;
-use Magento\Framework\Exception\LocalizedException;
-use Magento\Framework\Exception\NoSuchEntityException;
+use Magento\CustomerGraphQl\Model\Customer\SetUpUserContext;
use Magento\Framework\Exception\State\InputMismatchException;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
-use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
-use Magento\Framework\GraphQl\Query\Resolver\Value;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Magento\Framework\Validator\Exception as ValidatorException;
-use Magento\Newsletter\Model\SubscriberFactory;
-use Magento\Store\Model\StoreManagerInterface;
+/**
+ * Create customer account resolver
+ */
class CreateCustomer implements ResolverInterface
{
/**
* @var CustomerDataProvider
*/
private $customerDataProvider;
+
/**
- * @var AccountManagementInterface
- */
- private $accountManagement;
- /**
- * @var CustomerInterfaceFactory
- */
- private $customerFactory;
- /**
- * @var DataObjectHelper
+ * @var ChangeSubscriptionStatus
*/
- private $dataObjectHelper;
+ private $changeSubscriptionStatus;
+
/**
- * @var StoreManagerInterface
+ * @var CreateAccount
*/
- private $storeManager;
+ private $createAccount;
+
/**
- * @var SubscriberFactory
+ * @var SetUpUserContext
*/
- private $subscriberFactory;
- /**
- * @var ChangeSubscriptionStatus
- */
- private $changeSubscriptionStatus;
+ private $setUpUserContext;
/**
- * @param DataObjectHelper $dataObjectHelper
- * @param CustomerInterfaceFactory $customerFactory
- * @param AccountManagementInterface $accountManagement
- * @param StoreManagerInterface $storeManager
- * @param SubscriberFactory $subscriberFactory
* @param CustomerDataProvider $customerDataProvider
* @param ChangeSubscriptionStatus $changeSubscriptionStatus
+ * @param SetUpUserContext $setUpUserContext
+ * @param CreateAccount $createAccount
*/
public function __construct(
- DataObjectHelper $dataObjectHelper,
- CustomerInterfaceFactory $customerFactory,
- AccountManagementInterface $accountManagement,
- StoreManagerInterface $storeManager,
- SubscriberFactory $subscriberFactory,
CustomerDataProvider $customerDataProvider,
- ChangeSubscriptionStatus $changeSubscriptionStatus
+ ChangeSubscriptionStatus $changeSubscriptionStatus,
+ SetUpUserContext $setUpUserContext,
+ CreateAccount $createAccount
) {
$this->customerDataProvider = $customerDataProvider;
- $this->accountManagement = $accountManagement;
- $this->customerFactory = $customerFactory;
- $this->dataObjectHelper = $dataObjectHelper;
- $this->storeManager = $storeManager;
- $this->subscriberFactory = $subscriberFactory;
$this->changeSubscriptionStatus = $changeSubscriptionStatus;
+ $this->createAccount = $createAccount;
+ $this->setUpUserContext = $setUpUserContext;
}
/**
- * @param Field $field
- * @param ContextInterface $context
- * @param ResolveInfo $info
- * @param array|null $value
- * @param array|null $args
- * @return array|Value|mixed
- * @throws GraphQlInputException
- * @throws LocalizedException
- * @throws NoSuchEntityException
+ * @inheritdoc
*/
public function resolve(
Field $field,
@@ -107,9 +75,9 @@ public function resolve(
throw new GraphQlInputException(__('"input" value should be specified'));
}
try {
- $customer = $this->createUserAccount($args);
+ $customer = $this->createAccount->execute($args);
$customerId = (int)$customer->getId();
- $this->setUpUserContext($context, $customer);
+ $this->setUpUserContext->execute($context, $customer);
if (array_key_exists('is_subscribed', $args['input'])) {
if ($args['input']['is_subscribed']) {
$this->changeSubscriptionStatus->execute($customerId, true);
@@ -124,37 +92,4 @@ public function resolve(
return ['customer' => $data];
}
-
- /**
- * @param $args
- * @return CustomerInterface
- * @throws LocalizedException
- * @throws NoSuchEntityException
- */
- private function createUserAccount($args)
- {
- $customerDataObject = $this->customerFactory->create();
- $this->dataObjectHelper->populateWithArray(
- $customerDataObject,
- $args['input'],
- CustomerInterface::class
- );
- $store = $this->storeManager->getStore();
- $customerDataObject->setWebsiteId($store->getWebsiteId());
- $customerDataObject->setStoreId($store->getId());
-
- $password = array_key_exists('password', $args['input']) ? $args['input']['password'] : null;
-
- return $this->accountManagement->createAccount($customerDataObject, $password);
- }
-
- /**
- * @param $context
- * @param CustomerInterface $customer
- */
- private function setUpUserContext($context, $customer)
- {
- $context->setUserId((int)$customer->getId());
- $context->setUserType(UserContextInterface::USER_TYPE_CUSTOMER);
- }
}
From 89584157cac040738fab386e51e54ebd81286954 Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Tue, 11 Dec 2018 11:07:17 +0300
Subject: [PATCH 043/121] MAGETWO-95820: Order placed by new customer before
they registered is displayed in the admin under the name Guest
- Update automated test
---
.../Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml | 2 --
1 file changed, 2 deletions(-)
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
index 79936776ab0ac..693c05684f292 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StoreFrontCheckCustomerInfoCreatedByGuestTest.xml
@@ -25,12 +25,10 @@
-
-
From f50d5ceae5f98e09d1f7a161fda54bd171b95f77 Mon Sep 17 00:00:00 2001
From: Sona Sargsyan
Date: Tue, 11 Dec 2018 15:50:12 +0400
Subject: [PATCH 044/121] MAGETWO-96406: [2.3.x] Swatch Attribute is not
displayed in the Widget CMS
- Added automation test
---
.../AdminProductAttributeActionGroup.xml | 16 ++++
.../CreateNewPageWithWidgetActionGroup.xml | 40 +++++++++
.../Cms/Test/Mftf/Data/NewCMSPageData.xml | 14 +++
.../Section/CmsNewPagePageActionsSection.xml | 1 +
.../Section/AdminNewAttributePanelSection.xml | 7 ++
.../AddSwatchToProductActionGroup.xml | 18 ++++
.../StorefrontProductInfoMainSection.xml | 1 +
...SwatchAttributesDisplayInWidgetCMSTest.xml | 85 +++++++++++++++++++
8 files changed, 182 insertions(+)
create mode 100644 app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml
create mode 100644 app/code/Magento/Cms/Test/Mftf/Data/NewCMSPageData.xml
create mode 100644 app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.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..8f8a86ac5adf1 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
@@ -47,4 +47,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml
new file mode 100644
index 0000000000000..a4b88c544de88
--- /dev/null
+++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Data/NewCMSPageData.xml b/app/code/Magento/Cms/Test/Mftf/Data/NewCMSPageData.xml
new file mode 100644
index 0000000000000..61dfb051d101e
--- /dev/null
+++ b/app/code/Magento/Cms/Test/Mftf/Data/NewCMSPageData.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ CMSpage
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageActionsSection.xml b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageActionsSection.xml
index 42f8f4d00ee9f..a340d0af1e7a1 100644
--- a/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageActionsSection.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Section/CmsNewPagePageActionsSection.xml
@@ -22,5 +22,6 @@
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml
index 44077888f8bc0..9310091ee13f2 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml
@@ -9,6 +9,13 @@
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml
index 60a8035dedeca..a4fbc028e54a6 100644
--- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml
+++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml
@@ -62,4 +62,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml b/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml
index 415ae88fceb52..e40a04080285a 100644
--- a/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml
+++ b/app/code/Magento/Swatches/Test/Mftf/Section/StorefrontProductInfoMainSection.xml
@@ -14,5 +14,6 @@
+
diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml
new file mode 100644
index 0000000000000..bcd4cac70118b
--- /dev/null
+++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 27ad6c4e25d38bdf80be07406d2755da94e4a681 Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Tue, 11 Dec 2018 13:13:43 -0600
Subject: [PATCH 045/121] MC-5717: Sub-category doesnt display after moving
categories
---
.../Catalog/Controller/Adminhtml/Category/RefreshPath.php | 1 +
.../Unit/Controller/Adminhtml/Category/RefreshPathTest.php | 4 ++--
.../Catalog/view/adminhtml/ui_component/category_form.xml | 7 +++++++
.../Catalog/view/adminhtml/web/catalog/category/form.js | 2 ++
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php
index 046ebbb119e5b..e58a0c5b0996e 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php
@@ -44,6 +44,7 @@ public function execute()
'id' => $categoryId,
'path' => $category->getPath(),
'parentId' => $category->getParentId(),
+ 'level' => $category->getLevel()
]);
}
}
diff --git a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/RefreshPathTest.php b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/RefreshPathTest.php
index 45de62e218cfc..adf00333721ba 100644
--- a/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/RefreshPathTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Category/RefreshPathTest.php
@@ -66,8 +66,8 @@ private function setObjectProperty($object, string $propertyName, $value) : void
*/
public function testExecute() : void
{
- $value = ['id' => 3, 'path' => '1/2/3', 'parentId' => 2];
- $result = '{"id":3,"path":"1/2/3","parentId":"2"}';
+ $value = ['id' => 3, 'path' => '1/2/3', 'parentId' => 2, 'level' => 2];
+ $result = '{"id":3,"path":"1/2/3","parentId":"2","level":"2"}';
$requestMock = $this->getMockForAbstractClass(\Magento\Framework\App\RequestInterface::class);
diff --git a/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml b/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml
index 1a54db0d59f0f..90d6e0b48400e 100644
--- a/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml
+++ b/app/code/Magento/Catalog/view/adminhtml/ui_component/category_form.xml
@@ -77,6 +77,13 @@
text
+
+
+ -
+
- category
+
+
+
-
diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js
index 0a04358e41123..76aaddf55ac99 100644
--- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js
+++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/form.js
@@ -15,6 +15,7 @@ define([
categoryIdSelector: 'input[name="id"]',
categoryPathSelector: 'input[name="path"]',
categoryParentSelector: 'input[name="parent"]',
+ categoryLevelSelector: 'input[name="level"]',
refreshUrl: config.refreshUrl
},
@@ -47,6 +48,7 @@ define([
$(this.options.categoryIdSelector).val(data.id).change();
$(this.options.categoryPathSelector).val(data.path).change();
$(this.options.categoryParentSelector).val(data.parentId).change();
+ $(this.options.categoryLevelSelector).val(data.level).change();
}
}
};
From b44371f7167d42a03ff3797f58929aa53da7b00b Mon Sep 17 00:00:00 2001
From: Alexey Yakimovich
Date: Wed, 12 Dec 2018 16:08:27 +0300
Subject: [PATCH 046/121] MAGETWO-94556: Undefined variables during product
save
- Fixed js static and unit tests;
---
.../view/adminhtml/web/js/variations/variations.js | 1 +
.../view/adminhtml/web/js/variations/variations.test.js | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js
index c6eee5486d117..4cb580ce9740c 100644
--- a/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js
+++ b/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.js
@@ -403,6 +403,7 @@ define([
*/
validateForm: function (formElement) {
formElement.validate();
+
return !formElement.additionalInvalid && !formElement.source.get('params.invalid');
},
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.test.js
index ed2e29f4baf16..01998a69d3519 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.test.js
@@ -46,8 +46,8 @@ define([
variation.serializeData();
- expect(variation.source.data['configurable-matrix']).toBeUndefined();
- expect(variation.source.data['associated_product_ids']).toBeUndefined();
+ expect(variation.source.data['configurable-matrix']).toEqual(matrix);
+ expect(variation.source.data['associated_product_ids']).toEqual(ids);
expect(variation.source.data['configurable-matrix-serialized']).toEqual(resultMatrix);
expect(variation.source.data['associated_product_ids_serialized']).toEqual(resultIds);
});
@@ -112,8 +112,8 @@ define([
variation.source.data['associated_product_ids_serialized'] = JSON.stringify(['some old data']);
variation.serializeData();
- expect(variation.source.data['configurable-matrix']).toBeUndefined();
- expect(variation.source.data['associated_product_ids']).toBeUndefined();
+ expect(variation.source.data['configurable-matrix']).toEqual(matrix);
+ expect(variation.source.data['associated_product_ids']).toEqual(ids);
expect(variation.source.data['configurable-matrix-serialized']).toEqual(resultMatrix);
expect(variation.source.data['associated_product_ids_serialized']).toEqual(resultIds);
});
From 859bb7055e0c79b3f7ea2d82fec266a981adb016 Mon Sep 17 00:00:00 2001
From: Sona Sargsyan
Date: Wed, 12 Dec 2018 17:39:56 +0400
Subject: [PATCH 047/121] MAGETWO-96406: [2.3.x] Swatch Attribute is not
displayed in the Widget CMS
- Added fixes based on comments
---
.../Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml | 1 +
app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml | 1 +
.../Test/Mftf/Section/AdminNewAttributePanelSection.xml | 2 ++
.../Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml | 5 ++---
.../StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml | 4 ++--
5 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml
index a4b88c544de88..7c8694a247dee 100644
--- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml
+++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml
@@ -30,6 +30,7 @@
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml b/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml
index c7ea85e441bb9..101e694d75f55 100644
--- a/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml
@@ -101,6 +101,7 @@
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml
index 9310091ee13f2..48d526b72bc2c 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminNewAttributePanelSection.xml
@@ -16,6 +16,8 @@
+
+
diff --git a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml
index a4fbc028e54a6..2c91bba75fec9 100644
--- a/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml
+++ b/app/code/Magento/Swatches/Test/Mftf/ActionGroup/AddSwatchToProductActionGroup.xml
@@ -70,9 +70,8 @@
-
-
-
+
+
diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml
index bcd4cac70118b..b45339edecd86 100644
--- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml
+++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml
@@ -32,8 +32,8 @@
-
-
+
+
From 4bcd4787239bc155e91473c1ee0ba8bc22fbb35e Mon Sep 17 00:00:00 2001
From: Karen_Mkhitaryan
Date: Thu, 13 Dec 2018 11:16:18 +0400
Subject: [PATCH 048/121] MAGETWO-94556: Undefined variables during product
save
- Fix test
---
.../Test/Mftf/Test/AdminConfigurableProductCreateTest.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
index f400a4d4708a8..bba352b16cc8a 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
@@ -113,9 +113,11 @@
+
+
From 1749d09856d08ee571b13f07ed4efe972f8c4cdb Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Thu, 13 Dec 2018 13:49:24 +0300
Subject: [PATCH 049/121] MAGETWO-96124: [2.3.x] Custom Customer Attributes get
cleared in case of invalid Customer Account creation on Storefront
- Update automated test script
---
.../Customer/Test/Mftf/Page/StorefrontCustomerCreatePage.xml | 2 +-
.../Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerCreatePage.xml b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerCreatePage.xml
index 101ff1451ccbf..0d273da353005 100644
--- a/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerCreatePage.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Page/StorefrontCustomerCreatePage.xml
@@ -10,6 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
-
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml
index a8c7cefb773d1..ee14ee5c165c5 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontCustomerCreateFormSection.xml
@@ -17,7 +17,7 @@
-
+
From d3d06f17e679f96a094061fd807edbe407515d51 Mon Sep 17 00:00:00 2001
From: David Grigoryan
Date: Thu, 13 Dec 2018 15:34:53 +0400
Subject: [PATCH 050/121] MAGETWO-96411: [2.3.x] Default addresses not selected
when checking out from cart
- Add automated test
---
.../AdminCustomerShopingCartActionGroup.xml | 27 ++++
.../AdminCustomerMainActionsSection.xml | 1 +
.../AdminCustomerShoppingCartSection.xml | 23 ++++
.../AdminOrderFormShippingAddressSection.xml | 1 +
...DifferentBillingAndShippingAddressTest.xml | 124 ++++++++++++++++++
5 files changed, 176 insertions(+)
create mode 100644 app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerShopingCartActionGroup.xml
create mode 100644 app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerShoppingCartSection.xml
create mode 100644 app/code/Magento/Sales/Test/Mftf/Test/AdminDifferentBillingAndShippingAddressTest.xml
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerShopingCartActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerShopingCartActionGroup.xml
new file mode 100644
index 0000000000000..f5d5682e374f2
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerShopingCartActionGroup.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerMainActionsSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerMainActionsSection.xml
index 3ff880c64e6d6..0a56763b66704 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerMainActionsSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerMainActionsSection.xml
@@ -11,5 +11,6 @@
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerShoppingCartSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerShoppingCartSection.xml
new file mode 100644
index 0000000000000..c4a4d650c1e59
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerShoppingCartSection.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormShippingAddressSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormShippingAddressSection.xml
index b79d933268769..0f1461b121e15 100644
--- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormShippingAddressSection.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormShippingAddressSection.xml
@@ -10,6 +10,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminDifferentBillingAndShippingAddressTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminDifferentBillingAndShippingAddressTest.xml
new file mode 100644
index 0000000000000..37ab0302e6fd2
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminDifferentBillingAndShippingAddressTest.xml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 8131d75032e66004c123b02e23786f2729748b22 Mon Sep 17 00:00:00 2001
From: Sona Sargsyan
Date: Thu, 13 Dec 2018 17:28:15 +0400
Subject: [PATCH 051/121] MAGETWO-66872: Customer Address Attribute not being
marked as required when the "Values Required" setting is overriden on Website
scope
- Added fix for b2b
---
.../ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
index 9d918990c8172..8eaf5a1f1d284 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
@@ -28,8 +28,8 @@
-
+
-
\ No newline at end of file
+
From b029e34e661b0740d52caf7afa65e2af911f7b1a Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Tue, 18 Dec 2018 16:24:48 +0300
Subject: [PATCH 052/121] MAGETWO-94556: Undefined variables during product
save
- Update automated test
---
.../Mftf/Section/AdminChooseAffectedAttributeSetSection.xml | 1 +
.../Test/Mftf/Test/AdminConfigurableProductCreateTest.xml | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminChooseAffectedAttributeSetSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminChooseAffectedAttributeSetSection.xml
index 4289638352990..fb83251ab287d 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminChooseAffectedAttributeSetSection.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/AdminChooseAffectedAttributeSetSection.xml
@@ -10,5 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
\ No newline at end of file
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
index bba352b16cc8a..a3da630fa2dfb 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdminConfigurableProductCreateTest.xml
@@ -113,11 +113,11 @@
-
+
-
+
From c4f9b60e5c255a540a391d8e00bd07fc54e53e78 Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Wed, 19 Dec 2018 12:40:26 +0300
Subject: [PATCH 053/121] MAGETWO-94556: Undefined variables during product
save
- Update automated test
---
.../Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml
index 2e4b9c6cb0430..611f12a39b510 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductGridFilterSection.xml
@@ -9,7 +9,7 @@
-
+
From 5000d937ecd2e9399f268c481e7b7412d3e7db0b Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Thu, 20 Dec 2018 17:03:00 +0300
Subject: [PATCH 054/121] MAGETWO-66872: Customer Address Attribute not being
marked as required when the "Values Required" setting is overriden on Website
scope
- Update automation test
---
...tCustomerAddressesFromAdminActionGroup.xml | 12 +++----
.../AdminEditCustomerAddressesSection.xml | 33 ++++++++++---------
2 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
index 8eaf5a1f1d284..617c895bc1201 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/EditCustomerAddressesFromAdminActionGroup.xml
@@ -12,11 +12,10 @@
-
+
+
-
-
@@ -26,10 +25,7 @@
-
-
-
-
-
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerAddressesSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerAddressesSection.xml
index 0718800c871a7..04d6c4dc2a09d 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerAddressesSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminEditCustomerAddressesSection.xml
@@ -10,22 +10,23 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 3998176c0995dbb912977719039fdac956c8a43c Mon Sep 17 00:00:00 2001
From: Pavel Bystritsky
Date: Thu, 20 Dec 2018 16:09:29 +0200
Subject: [PATCH 055/121] ENGCOM-3491: Static test fix.
---
app/code/Magento/Sales/Model/Order/Config.php | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Sales/Model/Order/Config.php b/app/code/Magento/Sales/Model/Order/Config.php
index 8999fca174de9..70cf8c181cf95 100644
--- a/app/code/Magento/Sales/Model/Order/Config.php
+++ b/app/code/Magento/Sales/Model/Order/Config.php
@@ -75,6 +75,8 @@ public function __construct(
}
/**
+ * Get collection.
+ *
* @return \Magento\Sales\Model\ResourceModel\Order\Status\Collection
*/
protected function _getCollection()
@@ -86,6 +88,8 @@ protected function _getCollection()
}
/**
+ * Get state.
+ *
* @param string $state
* @return Status
*/
@@ -275,8 +279,9 @@ public function getInvisibleOnFrontStatuses()
}
/**
- * Get existing order statuses
- * Visible or invisible on frontend according to passed param
+ * Get existing order statuses.
+ *
+ * Visible or invisible on frontend according to passed param.
*
* @param bool $visibility
* @return array
From 54561ba1a13d0a0ed60e4d2fb3974b558d901f2b Mon Sep 17 00:00:00 2001
From: Lusine Papyan
Date: Fri, 21 Dec 2018 10:55:23 +0400
Subject: [PATCH 056/121] MAGETWO-96849: [2.3.x] Money are refunded to gift
card during partial refund when it's not required
- Add automated test script
---
.../Sales/Test/Mftf/Section/AdminCreditMemoTotalSection.xml | 1 +
.../Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml | 1 +
2 files changed, 2 insertions(+)
diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminCreditMemoTotalSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminCreditMemoTotalSection.xml
index 84fcc8fc47dfb..df1a0064d25a8 100644
--- a/app/code/Magento/Sales/Test/Mftf/Section/AdminCreditMemoTotalSection.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminCreditMemoTotalSection.xml
@@ -21,5 +21,6 @@
+
\ No newline at end of file
diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml
index 578022217f358..6fa5d9a9a3787 100644
--- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml
@@ -18,5 +18,6 @@
+
From 2bc10a2484462d6554dbc07655b68e56ca4f72f2 Mon Sep 17 00:00:00 2001
From: Pavel Bystritsky
Date: Fri, 21 Dec 2018 15:58:15 +0200
Subject: [PATCH 057/121] ENGCOM-3491: WebAPI test fix.
---
.../Service/V1/OrderStatusHistoryAddTest.php | 43 ++++++++++---------
1 file changed, 23 insertions(+), 20 deletions(-)
diff --git a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderStatusHistoryAddTest.php b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderStatusHistoryAddTest.php
index c5ecead00ce29..9e3bd4ca48478 100644
--- a/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderStatusHistoryAddTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Sales/Service/V1/OrderStatusHistoryAddTest.php
@@ -11,6 +11,7 @@
/**
* Class OrderCommentAddTest
+ *
* @package Magento\Sales\Service\V1
*/
class OrderStatusHistoryAddTest extends WebapiAbstract
@@ -48,7 +49,7 @@ public function testOrderCommentAdd()
OrderStatusHistoryInterface::CREATED_AT => null,
OrderStatusHistoryInterface::PARENT_ID => $order->getId(),
OrderStatusHistoryInterface::ENTITY_NAME => null,
- OrderStatusHistoryInterface::STATUS => null,
+ OrderStatusHistoryInterface::STATUS => $order->getStatus(),
OrderStatusHistoryInterface::IS_VISIBLE_ON_FRONT => 1,
];
@@ -69,25 +70,27 @@ public function testOrderCommentAdd()
//Verification
$comments = $order->load($order->getId())->getAllStatusHistory();
+ $comment = reset($comments);
- $commentData = reset($comments);
- foreach ($commentData as $key => $value) {
- $this->assertEquals(
- $commentData[OrderStatusHistoryInterface::COMMENT],
- $statusHistoryComment->getComment()
- );
- $this->assertEquals(
- $commentData[OrderStatusHistoryInterface::PARENT_ID],
- $statusHistoryComment->getParentId()
- );
- $this->assertEquals(
- $commentData[OrderStatusHistoryInterface::IS_CUSTOMER_NOTIFIED],
- $statusHistoryComment->getIsCustomerNotified()
- );
- $this->assertEquals(
- $commentData[OrderStatusHistoryInterface::IS_VISIBLE_ON_FRONT],
- $statusHistoryComment->getIsVisibleOnFront()
- );
- }
+ $this->assertEquals(
+ $commentData[OrderStatusHistoryInterface::COMMENT],
+ $comment->getComment()
+ );
+ $this->assertEquals(
+ $commentData[OrderStatusHistoryInterface::PARENT_ID],
+ $comment->getParentId()
+ );
+ $this->assertEquals(
+ $commentData[OrderStatusHistoryInterface::IS_CUSTOMER_NOTIFIED],
+ $comment->getIsCustomerNotified()
+ );
+ $this->assertEquals(
+ $commentData[OrderStatusHistoryInterface::IS_VISIBLE_ON_FRONT],
+ $comment->getIsVisibleOnFront()
+ );
+ $this->assertEquals(
+ $commentData[OrderStatusHistoryInterface::STATUS],
+ $comment->getStatus()
+ );
}
}
From 7c5bea3783ea15d81dc5e3e4e64ab23dd5c3dff9 Mon Sep 17 00:00:00 2001
From: Stepan Furman
Date: Mon, 24 Dec 2018 15:25:18 +0200
Subject: [PATCH 058/121] GraphQL-248: Test coverage
---
.../GraphQl/Customer/CreateCustomerTest.php | 169 +++++++++++++++++-
1 file changed, 168 insertions(+), 1 deletion(-)
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php
index 80a24eacb5f2c..7342800379d13 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/CreateCustomerTest.php
@@ -35,7 +35,7 @@ protected function setUp()
/**
* @throws \Exception
*/
- public function testCreateCustomerAccount()
+ public function testCreateCustomerAccountWithPassword()
{
$newFirstname = 'Richard';
$newLastname = 'Rowe';
@@ -70,4 +70,171 @@ public function testCreateCustomerAccount()
$this->assertEquals($newEmail, $response['createCustomer']['customer']['email']);
$this->assertEquals(true, $response['createCustomer']['customer']['is_subscribed']);
}
+
+ /**
+ * @throws \Exception
+ */
+ public function testCreateCustomerAccountWithoutPassword()
+ {
+ $newFirstname = 'Richard';
+ $newLastname = 'Rowe';
+ $newEmail = 'customer_created' . rand(1, 2000000) . '@example.com';
+
+ $query = <<graphQlQuery($query);
+
+ $this->assertEquals($newFirstname, $response['createCustomer']['customer']['firstname']);
+ $this->assertEquals($newLastname, $response['createCustomer']['customer']['lastname']);
+ $this->assertEquals($newEmail, $response['createCustomer']['customer']['email']);
+ $this->assertEquals(true, $response['createCustomer']['customer']['is_subscribed']);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage "input" value should be specified
+ */
+ public function testCreateCustomerIfInputDataIsEmpty()
+ {
+ $query = <<graphQlQuery($query);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage The customer email is missing. Enter and try again.
+ */
+ public function testCreateCustomerIfEmailMissed()
+ {
+ $newFirstname = 'Richard';
+ $newLastname = 'Rowe';
+ $currentPassword = 'test123#';
+
+ $query = <<graphQlQuery($query);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage "Email" is not a valid email address.
+ */
+ public function testCreateCustomerIfEmailIsNotValid()
+ {
+ $newFirstname = 'Richard';
+ $newLastname = 'Rowe';
+ $currentPassword = 'test123#';
+ $newEmail = 'email';
+
+ $query = <<graphQlQuery($query);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Field "test123" is not defined by type CustomerInput.
+ */
+ public function testCreateCustomerIfPassedAttributeDosNotExistsInCustomerInput()
+ {
+ $newFirstname = 'Richard';
+ $newLastname = 'Rowe';
+ $currentPassword = 'test123#';
+ $newEmail = 'customer_created' . rand(1, 2000000) . '@example.com';
+
+ $query = <<graphQlQuery($query);
+ }
}
From 7329633242e8ffc523f36a5721a01c4486d42069 Mon Sep 17 00:00:00 2001
From: David Grigoryan
Date: Thu, 27 Dec 2018 17:45:01 +0400
Subject: [PATCH 059/121] MAGETWO-96411: [2.3.x] Default addresses not selected
when checking out from cart
- Add automated test
---
...DifferentBillingAndShippingAddressTest.xml | 124 ------------------
1 file changed, 124 deletions(-)
delete mode 100644 app/code/Magento/Sales/Test/Mftf/Test/AdminDifferentBillingAndShippingAddressTest.xml
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminDifferentBillingAndShippingAddressTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminDifferentBillingAndShippingAddressTest.xml
deleted file mode 100644
index 37ab0302e6fd2..0000000000000
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminDifferentBillingAndShippingAddressTest.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
From f7f56fc819f1b7fc33370e66cf613c35c2044c48 Mon Sep 17 00:00:00 2001
From: Andrii Meysar
Date: Thu, 3 Jan 2019 17:47:33 +0200
Subject: [PATCH 060/121] MAGETWO-67129: Function test
Magento\GroupedProduct\Test\TestCase\CreateGroupedProductEntityTest fails
randomly
---
.../AssociatedProducts/Search/Grid.php | 62 +++++++++++++++++++
.../CreateGroupedProductEntityTest.xml | 2 +-
2 files changed, 63 insertions(+), 1 deletion(-)
diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts/Search/Grid.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts/Search/Grid.php
index 45481d6ee0758..6c19291222a97 100644
--- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts/Search/Grid.php
+++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/Block/Adminhtml/Product/Grouped/AssociatedProducts/Search/Grid.php
@@ -20,6 +20,13 @@ class Grid extends DataGrid
*/
protected $addProducts = '.action-primary[data-role="action"]';
+ /**
+ * Grid selector.
+ *
+ * @var string
+ */
+ private $gridSelector = '[data-role="grid-wrapper"]';
+
/**
* Filters array mapping
*
@@ -40,4 +47,59 @@ public function addProducts()
{
$this->_rootElement->find($this->addProducts)->click();
}
+
+ /**
+ * @inheritdoc
+ */
+ public function searchAndSelect(array $filter)
+ {
+ $this->waitGridVisible();
+ $this->waitLoader();
+ parent::searchAndSelect($filter);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ protected function waitLoader()
+ {
+ parent::waitLoader();
+ $this->waitGridLoaderInvisible();
+ }
+
+ /**
+ * Wait for grid to appear.
+ *
+ * @return void
+ */
+ private function waitGridVisible()
+ {
+ $browser = $this->_rootElement;
+ $selector = $this->gridSelector;
+
+ return $browser->waitUntil(
+ function () use ($browser, $selector) {
+ $element = $browser->find($selector);
+ return $element->isVisible() ? true : null;
+ }
+ );
+ }
+
+ /**
+ * Wait for grid spinner disappear.
+ *
+ * @return void
+ */
+ private function waitGridLoaderInvisible()
+ {
+ $browser = $this->_rootElement;
+ $selector = $this->loader;
+
+ return $browser->waitUntil(
+ function () use ($browser, $selector) {
+ $element = $browser->find($selector);
+ return $element->isVisible() === false ? true : null;
+ }
+ );
+ }
}
diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.xml
index 38ef02ff49441..39f4fd08bb922 100644
--- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/CreateGroupedProductEntityTest.xml
@@ -8,7 +8,7 @@
- test_type:acceptance_test, test_type:extended_acceptance_test, stable:no
+ test_type:acceptance_test, test_type:extended_acceptance_test
test-grouped-product-%isolation%
GroupedProduct %isolation%
GroupedProduct_sku%isolation%
From 69eaa77c837ac8a19fb7f2f3dccd9d60dd286b41 Mon Sep 17 00:00:00 2001
From: Alexey Yakimovich
Date: Fri, 4 Jan 2019 12:00:55 +0300
Subject: [PATCH 061/121] MAGETWO-94556: Undefined variables during product
save
- Fixed js unit test;
---
.../view/adminhtml/web/js/variations/variations.test.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.test.js
index c3bb90f79a495..6b68978380ea4 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/variations.test.js
@@ -164,8 +164,8 @@ define([
variation.serializeData();
- expect(variation.source.data['configurable-matrix']).toBeUndefined();
- expect(variation.source.data['associated_product_ids']).toBeUndefined();
+ expect(variation.source.data['configurable-matrix']).toEqual(matrix);
+ expect(variation.source.data['associated_product_ids']).toEqual(ids);
expect(variation.source.data['configurable-matrix-serialized']).toEqual(resultMatrix);
expect(variation.source.data['associated_product_ids_serialized']).toEqual(resultIds);
From 0b8d5314b9c103cee5d763b91517504c3d122d51 Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Thu, 10 Jan 2019 09:29:16 -0600
Subject: [PATCH 062/121] MC-6296: Update DCTRequest
---
app/code/Magento/Dhl/Model/Carrier.php | 27 +++--
.../Dhl/Test/Unit/Model/CarrierTest.php | 82 +++++++++-----
...ata_dhl.php => dhl_quote_request_data.php} | 7 +-
...ponse_rates.xml => dhl_quote_response.xml} | 104 +++++++++++++-----
.../Model/_files/dhl_quote_response_rates.php | 31 ++++++
5 files changed, 184 insertions(+), 67 deletions(-)
rename app/code/Magento/Dhl/Test/Unit/Model/_files/{rates_request_data_dhl.php => dhl_quote_request_data.php} (92%)
rename app/code/Magento/Dhl/Test/Unit/Model/_files/{success_dhl_response_rates.xml => dhl_quote_response.xml} (84%)
create mode 100644 app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response_rates.php
diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php
index d997db6ac1a3e..9f1d9ef75659f 100644
--- a/app/code/Magento/Dhl/Model/Carrier.php
+++ b/app/code/Magento/Dhl/Model/Carrier.php
@@ -199,6 +199,8 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin
'SiteID', 'Password'
];
+ protected $productMetadata;
+
/**
* Xml response validator
*
@@ -261,7 +263,8 @@ public function __construct(
\Magento\Framework\Stdlib\DateTime $dateTime,
\Magento\Framework\HTTP\ZendClientFactory $httpClientFactory,
array $data = [],
- \Magento\Dhl\Model\Validator\XmlValidator $xmlValidator = null
+ \Magento\Dhl\Model\Validator\XmlValidator $xmlValidator = null,
+ \Magento\Framework\App\ProductMetadataInterface $productMetadata
) {
$this->readFactory = $readFactory;
$this->_carrierHelper = $carrierHelper;
@@ -272,6 +275,7 @@ public function __construct(
$this->mathDivision = $mathDivision;
$this->_dateTime = $dateTime;
$this->_httpClientFactory = $httpClientFactory;
+ $this->productMetadata = $productMetadata;
parent::__construct(
$scopeConfig,
$rateErrorFactory,
@@ -929,6 +933,7 @@ protected function _getQuotes()
$date = date(self::REQUEST_DATE_FORMAT, strtotime($this->_getShipDate() . " +{$offset} days"));
$this->_setQuotesRequestXmlDate($requestXml, $date);
+
$request = $requestXml->asXML();
$debugPoint['request'] = $this->filterDebugData($request);
$responseBody = $this->_getCachedQuotes($request);
@@ -983,18 +988,26 @@ protected function _getQuotesFromServer($request)
protected function _buildQuotesRequestXml()
{
$rawRequest = $this->_rawRequest;
- $xmlStr = '' .
- '' .
+ ' ';
+ 'xsi:schemaLocation="http://www.dhl.com DCT-req_global-2.0.xsd"/>';
+
$xml = $this->_xmlElFactory->create(['data' => $xmlStr]);
$nodeGetQuote = $xml->addChild('GetQuote', '', '');
$nodeRequest = $nodeGetQuote->addChild('Request');
$nodeServiceHeader = $nodeRequest->addChild('ServiceHeader');
- $nodeServiceHeader->addChild('SiteID', (string)$this->getConfigData('id'));
- $nodeServiceHeader->addChild('Password', (string)$this->getConfigData('password'));
+ $nodeServiceHeader->addChild('MessageTime', date('Y-m-d\TH:i:sP'));
+ $nodeServiceHeader->addChild('MessageReference', uniqid('magento_quotereq_'));
+ $nodeServiceHeader->addChild('SiteID', (string) $this->getConfigData('id'));
+ $nodeServiceHeader->addChild('Password', (string) $this->getConfigData('password'));
+
+ $nodeMetaData = $nodeRequest->addChild('MetaData');
+ $nodeMetaData->addChild('SoftwareName', $this->productMetadata->getName());
+ $nodeMetaData->addChild('SoftwareVersion', $this->productMetadata->getVersion());
$nodeFrom = $nodeGetQuote->addChild('From');
$nodeFrom->addChild('CountryCode', $rawRequest->getOrigCountryId());
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
index 96c76a17bc317..06a2c84285702 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
@@ -55,6 +55,7 @@ class CarrierTest extends \PHPUnit\Framework\TestCase
private $model;
/**
+ * @var Error|MockObject
* @var Error|MockObject
*/
private $error;
@@ -124,6 +125,7 @@ protected function setUp()
$configReader = $this->getConfigReader();
$readFactory = $this->getReadFactory();
$storeManager = $this->getStoreManager();
+ $productMetadata = $this->getProductMetadata();
$this->error = $this->getMockBuilder(Error::class)
->setMethods(['setCarrier', 'setCarrierTitle', 'setErrorMessage'])
@@ -160,6 +162,7 @@ protected function setUp()
'carrierHelper' => $carrierHelper,
'data' => ['id' => 'dhl', 'store' => '1'],
'xmlValidator' => $this->xmlValidator,
+ 'productMetadata' => $productMetadata
]
);
}
@@ -183,7 +186,7 @@ public function scopeConfigGetValue($path)
'carriers/dhl/content_type' => 'N',
'carriers/dhl/nondoc_methods' => '1,3,4,8,P,Q,E,F,H,J,M,V,Y',
'carriers/dhl/showmethod' => 1,
- 'carriers/dhl/title' => 'dhl Title',
+ 'carriers/dhl/title' => 'DHL Title',
'carriers/dhl/specificerrmsg' => 'dhl error message',
'carriers/dhl/unit_of_measure' => 'K',
'carriers/dhl/size' => '1',
@@ -191,7 +194,7 @@ public function scopeConfigGetValue($path)
'carriers/dhl/width' => '1.6',
'carriers/dhl/depth' => '1.6',
'carriers/dhl/debug' => 1,
- 'shipping/origin/country_id' => 'GB',
+ 'shipping/origin/country_id' => 'GB'
];
return isset($pathMap[$path]) ? $pathMap[$path] : null;
}
@@ -247,8 +250,14 @@ protected function _invokePrepareShippingLabelContent(\SimpleXMLElement $xml)
return $method->invoke($model, $xml);
}
+ /**
+ * Tests that valid rates are returned when sending a quotes request.
+ */
public function testCollectRates()
{
+ $requestData = require __DIR__ . '/_files/dhl_quote_request_data.php';
+ $responseXml = file_get_contents(__DIR__ . '/_files/dhl_quote_response.xml');
+
$this->scope->method('getValue')
->willReturnCallback([$this, 'scopeConfigGetValue']);
@@ -256,13 +265,9 @@ public function testCollectRates()
->willReturn(true);
$this->httpResponse->method('getBody')
- ->willReturn(file_get_contents(__DIR__ . '/_files/success_dhl_response_rates.xml'));
+ ->willReturn($responseXml);
- /** @var RateRequest $request */
- $request = $this->objectManager->getObject(
- RateRequest::class,
- require __DIR__ . '/_files/rates_request_data_dhl.php'
- );
+ $request = $this->objectManager->getObject(RateRequest::class, $requestData);
$reflectionClass = new \ReflectionObject($this->httpClient);
$rawPostData = $reflectionClass->getProperty('raw_post_data');
@@ -272,13 +277,27 @@ public function testCollectRates()
->method('debug')
->with($this->stringContains('**** **** '));
- self::assertNotEmpty($this->model->collectRates($request)->getAllRates());
- self::assertContains('18.223 ', $rawPostData->getValue($this->httpClient));
- self::assertContains('0.630 ', $rawPostData->getValue($this->httpClient));
- self::assertContains('0.630 ', $rawPostData->getValue($this->httpClient));
- self::assertContains('0.630 ', $rawPostData->getValue($this->httpClient));
+ $expectedRates = require __DIR__ . '/_files/dhl_quote_response_rates.php';
+ $actualRates = $this->model->collectRates($request)->getAllRates();
+
+ self::assertEquals(count($expectedRates), count($actualRates));
+
+ foreach ($actualRates as $i => $actualRate) {
+ $actualRate = $actualRate->getData();
+ unset($actualRate['method_title']);
+ self::assertEquals($expectedRates[$i], $actualRate);
+ }
+
+ $requestXml = $rawPostData->getValue($this->httpClient);
+ self::assertContains('18.223 ', $requestXml);
+ self::assertContains('0.630 ', $requestXml);
+ self::assertContains('0.630 ', $requestXml);
+ self::assertContains('0.630 ', $requestXml);
}
+ /**
+ * Tests that an error is returned when attempting to collect rates for an inactive shipping method.
+ */
public function testCollectRatesErrorMessage()
{
$this->scope->method('getValue')
@@ -296,16 +315,6 @@ public function testCollectRatesErrorMessage()
$this->assertSame($this->error, $this->model->collectRates($request));
}
- public function testCollectRatesFail()
- {
- $this->scope->expects($this->once())->method('isSetFlag')->willReturn(true);
-
- $request = new RateRequest();
- $request->setPackageWeight(1);
-
- $this->assertFalse(false, $this->model->collectRates($request));
- }
-
/**
* Test request to shipment sends valid xml values.
*/
@@ -595,14 +604,18 @@ private function getRateMethodFactory(): MockObject
->disableOriginalConstructor()
->setMethods(['create'])
->getMock();
- $rateMethod = $this->getMockBuilder(Method::class)
- ->disableOriginalConstructor()
- ->setMethods(['setPrice'])
- ->getMock();
- $rateMethod->method('setPrice')
- ->willReturnSelf();
+
$rateMethodFactory->method('create')
- ->willReturn($rateMethod);
+ ->willReturnCallback(function () {
+ $rateMethod = $this->getMockBuilder(Method::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['setPrice'])
+ ->getMock();
+ $rateMethod->method('setPrice')
+ ->willReturnSelf();
+
+ return $rateMethod;
+ });
return $rateMethodFactory;
}
@@ -700,4 +713,13 @@ private function getHttpClientFactory(): MockObject
return $httpClientFactory;
}
+
+ private function getProductMetadata(): MockObject
+ {
+ $productMetadata = $this->createMock(\Magento\Framework\App\ProductMetadata::class);
+ $productMetadata->method('getName')->willReturn('Magento');
+ $productMetadata->method('getVersion')->willReturn('2.3.1');
+
+ return $productMetadata;
+ }
}
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/rates_request_data_dhl.php b/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_request_data.php
similarity index 92%
rename from app/code/Magento/Dhl/Test/Unit/Model/_files/rates_request_data_dhl.php
rename to app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_request_data.php
index 32e9c78886cef..f762b99735233 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/_files/rates_request_data_dhl.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_request_data.php
@@ -24,10 +24,9 @@
'limit_carrier' => null,
'base_subtotal_incl_tax' => '5',
'orig_country_id' => 'US',
- 'country_id' => 'US',
- 'region_id' => '12',
- 'city' => 'Fremont',
- 'postcode' => '94538',
+ 'orig_region_id' => '12',
+ 'orig_city' => 'Fremont',
+ 'orig_postcode' => '94538',
'dhl_id' => 'MAGEN_8501',
'dhl_password' => 'QR2GO1U74X',
'dhl_account' => '799909537',
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml b/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response.xml
similarity index 84%
rename from app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml
rename to app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response.xml
index b529e86ef154c..7421707966411 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/_files/success_dhl_response_rates.xml
+++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response.xml
@@ -5,9 +5,9 @@
* See COPYING.txt for license details.
*/
-->
-
-
+
@@ -16,15 +16,15 @@
-
- NUQ
- NUQ
-
-
- BER
- BER
-
+
+ NUQ
+ NUQ
+
+
+ BER
+ BER
+
E
E
EXPRESS 9:00
@@ -42,9 +42,10 @@
2
0
0
-
-
- 2014-01-13
+
+ 2014-01-13 11:59:00
+ +00:00
+
PT9H
2.205
LB
@@ -101,8 +102,19 @@
0.000
0.000
+ 09:00:00
+ 17:00:00
+ PT1H
+
+ NUQ
+ NUQ
+
+
+ BER
+ BER
+
Q
Q
MEDICAL EXPRESS
@@ -120,9 +132,10 @@
2
0
0
-
-
- 2014-01-13
+
+ 2014-01-13 11:59:00
+ +00:00
+
PT9H
2.205
LB
@@ -179,8 +192,19 @@
0.000
0.000
+ 09:00:00
+ 17:00:00
+ PT1H
+
+ NUQ
+ NUQ
+
+
+ BER
+ BER
+
Y
Y
EXPRESS 12:00
@@ -198,9 +222,10 @@
2
0
0
-
-
- 2014-01-13
+
+ 2014-01-13 11:59:00
+ +00:00
+
PT12H
2.205
LB
@@ -257,8 +282,19 @@
0.000
0.000
+ 09:00:00
+ 17:00:00
+ PT1H
+
+ NUQ
+ NUQ
+
+
+ BER
+ BER
+
3
3
B2C
@@ -275,9 +311,10 @@
2
0
0
-
-
- 2014-01-13
+
+ 2014-01-13 11:59:00
+ +00:00
+
PT23H59M
2.205
LB
@@ -309,8 +346,19 @@
0.000
0.000
+ 09:00:00
+ 17:00:00
+ PT1H
+
+ NUQ
+ NUQ
+
+
+ BER
+ BER
+
P
P
EXPRESS WORLDWIDE
@@ -328,9 +376,10 @@
2
0
0
-
-
- 2014-01-13
+
+ 2014-01-13 11:59:00
+ +00:00
+
PT23H59M
2.205
LB
@@ -387,6 +436,9 @@
0.000
0.000
+ 09:00:00
+ 17:00:00
+ PT1H
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response_rates.php b/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response_rates.php
new file mode 100644
index 0000000000000..e623b5944ce7c
--- /dev/null
+++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response_rates.php
@@ -0,0 +1,31 @@
+ 'dhl',
+ 'carrier_title' => 'DHL Title',
+ 'cost' => 45.85,
+ 'method' => 'E'
+ ],
+ [
+ 'carrier' => 'dhl',
+ 'carrier_title' => 'DHL Title',
+ 'cost' => 35.26,
+ 'method' => 'Q'
+ ],
+ [
+ 'carrier' => 'dhl',
+ 'carrier_title' => 'DHL Title',
+ 'cost' => 37.38,
+ 'method' => 'Y'
+ ],
+ [
+ 'carrier' => 'dhl',
+ 'carrier_title' => 'DHL Title',
+ 'cost' => 35.26,
+ 'method' => 'P'
+ ]
+];
\ No newline at end of file
From 1decc0c6ff4e7720581709d3c29d9e2d00bf86c0 Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Thu, 10 Jan 2019 10:13:50 -0600
Subject: [PATCH 063/121] MC-6296: Update DCTRequest
Fixed Typo
---
app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
index 06a2c84285702..6676be9cc8b7e 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
@@ -55,7 +55,6 @@ class CarrierTest extends \PHPUnit\Framework\TestCase
private $model;
/**
- * @var Error|MockObject
* @var Error|MockObject
*/
private $error;
From f6a2f2a7c1fbff444b996a7df97f6856414df98d Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Fri, 11 Jan 2019 15:47:12 -0600
Subject: [PATCH 064/121] MC-11005: Create functions for DHL message timestamp
and reference
---
app/code/Magento/Dhl/Model/Carrier.php | 42 +++++++++++++++++++
.../Dhl/Test/Unit/Model/CarrierTest.php | 27 ++++++++++++
2 files changed, 69 insertions(+)
diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php
index d997db6ac1a3e..7840820d91253 100644
--- a/app/code/Magento/Dhl/Model/Carrier.php
+++ b/app/code/Magento/Dhl/Model/Carrier.php
@@ -56,6 +56,13 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin
*/
const CODE = 'dhl';
+ /**
+ * DHL service prefixes used for message reference
+ */
+ const SERVICE_PREFIX_QUOTE = 'QUOT';
+ const SERVICE_PREFIX_SHIPVAL = 'SHIP';
+ const SERVICE_PREFIX_TRACKING = 'TRCK';
+
/**
* Rate request data
*
@@ -1972,4 +1979,39 @@ protected function isDutiable($origCountryId, $destCountryId)
self::DHL_CONTENT_TYPE_NON_DOC == $this->getConfigData('content_type')
|| !$this->_isDomestic;
}
+
+ /**
+ * Builds a datetime string to be used as the MessageTime in accordance to the expected format.
+ *
+ * @param string|null $datetime
+ * @return string
+ */
+ protected function buildMessageTimestamp(string $datetime = null): string
+ {
+ return $this->_coreDate->date(\DATE_RFC3339, $datetime);
+ }
+
+ /**
+ * Builds a string to be used as the MessageReference.
+ *
+ * @param string $servicePrefix
+ * @return string
+ * @throws \Magento\Framework\Exception\LocalizedException
+ */
+ protected function buildMessageReference(string $servicePrefix): string
+ {
+ $validPrefixes = [
+ self::SERVICE_PREFIX_QUOTE,
+ self::SERVICE_PREFIX_SHIPVAL,
+ self::SERVICE_PREFIX_TRACKING
+ ];
+
+ if (!in_array($servicePrefix, $validPrefixes)) {
+ throw new \Magento\Framework\Exception\LocalizedException(
+ __("Invalid service prefix \"$servicePrefix\" provided while attempting to build MessageReference")
+ );
+ }
+
+ return str_replace('.', '', uniqid("MAGE_{$servicePrefix}_", true));
+ }
}
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
index 96c76a17bc317..e90f22e2a150d 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
@@ -537,6 +537,33 @@ public function dhlProductsDataProvider() : array
];
}
+ /**
+ * Tests that the built message reference string is of the appropriate format.
+ *
+ * @expectedException \Magento\Framework\Exception\LocalizedException
+ * @expectedExceptionMessage Invalid service prefix
+ * @throws \ReflectionException
+ */
+ public function testBuildMessageReference()
+ {
+ $method = new \ReflectionMethod($this->model, 'buildMessageReference');
+ $method->setAccessible(true);
+
+ $msgRefQuote = $method->invoke($this->model, Carrier::SERVICE_PREFIX_QUOTE);
+ self::assertGreaterThanOrEqual(28, strlen($msgRefQuote));
+ self::assertLessThanOrEqual(32, strlen($msgRefQuote));
+
+ $msgRefShip = $method->invoke($this->model, Carrier::SERVICE_PREFIX_SHIPVAL);
+ self::assertGreaterThanOrEqual(28, strlen($msgRefShip));
+ self::assertLessThanOrEqual(32, strlen($msgRefShip));
+
+ $msgRefTrack = $method->invoke($this->model, Carrier::SERVICE_PREFIX_TRACKING);
+ self::assertGreaterThanOrEqual(28, strlen($msgRefTrack));
+ self::assertLessThanOrEqual(32, strlen($msgRefTrack));
+
+ $method->invoke($this->model, 'TEST');
+ }
+
/**
* Creates mock for XML factory.
*
From 3a4d363081ddccc521b6a71cc8cc366580b6d658 Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Fri, 11 Jan 2019 16:06:20 -0600
Subject: [PATCH 065/121] MC-11005: Create functions for DHL message timestamp
and reference
---
app/code/Magento/Dhl/Model/Carrier.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php
index 7840820d91253..9bbe0f2beed9a 100644
--- a/app/code/Magento/Dhl/Model/Carrier.php
+++ b/app/code/Magento/Dhl/Model/Carrier.php
@@ -1986,7 +1986,7 @@ protected function isDutiable($origCountryId, $destCountryId)
* @param string|null $datetime
* @return string
*/
- protected function buildMessageTimestamp(string $datetime = null): string
+ private function buildMessageTimestamp(string $datetime = null): string
{
return $this->_coreDate->date(\DATE_RFC3339, $datetime);
}
@@ -1998,7 +1998,7 @@ protected function buildMessageTimestamp(string $datetime = null): string
* @return string
* @throws \Magento\Framework\Exception\LocalizedException
*/
- protected function buildMessageReference(string $servicePrefix): string
+ private function buildMessageReference(string $servicePrefix): string
{
$validPrefixes = [
self::SERVICE_PREFIX_QUOTE,
From 1c139107ee6f6f55a403f5f826aeea5ec4665b03 Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Mon, 14 Jan 2019 13:13:10 +0300
Subject: [PATCH 066/121] MAGETWO-96106: CMS Block status is not staged
- Updated automated
---
.../Widget/Test/Mftf/ActionGroup/AdminWidgetActionGroup.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetActionGroup.xml b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetActionGroup.xml
index 05c56f588c5d0..c303b7cc8e900 100644
--- a/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetActionGroup.xml
+++ b/app/code/Magento/Widget/Test/Mftf/ActionGroup/AdminWidgetActionGroup.xml
@@ -7,7 +7,7 @@
-->
-
+
From 4090741cc8d2cc8837dce204f3d5272f22813513 Mon Sep 17 00:00:00 2001
From: Yuliya Labudova
Date: Mon, 14 Jan 2019 18:18:29 +0300
Subject: [PATCH 067/121] MC-5573: Refactoring tests. Improve specified test
cases.
- Add new line in the end of file and change noNamespaceSchemaLocation.
---
.../AdminAddDefaultVideoBundleProductTest.xml | 2 +-
...minRemoveDefaultVideoBundleProductTest.xml | 2 +-
.../AdvanceCatalogSearchBundleProductTest.xml | 2 +-
.../Mftf/Test/CaptchaFormsDisplayingTest.xml | 2 +-
.../AdminAddDefaultVideoSimpleProductTest.xml | 2 +-
...AdminAddDefaultVideoVirtualProductTest.xml | 2 +-
...minRemoveDefaultVideoSimpleProductTest.xml | 2 +-
...inRemoveDefaultVideoVirtualProductTest.xml | 2 +-
...AdvanceCatalogSearchVirtualProductTest.xml | 2 +-
.../Test/CheckTierPricingOfProductsTest.xml | 2 +-
...IncrementsWorkWithDecimalinventoryTest.xml | 2 +-
.../Test/CheckoutSpecificDestinationsTest.xml | 172 +++++++++---------
...OfDefaultBillingAndShippingAddressTest.xml | 2 +-
.../AdvanceCatalogSearchConfigurableTest.xml | 2 +-
...AddDefaultVideoDownloadableProductTest.xml | 2 +-
...ceCatalogSearchDownloadableProductTest.xml | 2 +-
...AdminAddDefaultVideoGroupedProductTest.xml | 2 +-
...inRemoveDefaultVideoGroupedProductTest.xml | 2 +-
...AdvanceCatalogSearchGroupedProductTest.xml | 2 +-
...erifySubscribedNewsletterDisplayedTest.xml | 2 +-
.../AdminAddDefaultVideoSimpleProductTest.xml | 2 +-
...minRemoveDefaultVideoSimpleProductTest.xml | 2 +-
.../AdminCreateOrderWithBundleProductTest.xml | 2 +-
...dminSubmitConfigurableProductOrderTest.xml | 2 +-
.../Test/StorefrontRedirectToOrderHistory.xml | 2 +-
...inRemoveProductWeeeAttributeOptionTest.xml | 3 +-
.../Test/StorefrontUpdateWishlistTest.xml | 118 ++++++------
.../Test/EndToEndB2CGuestUserTest.xml | 2 +-
.../Test/EndToEndB2CLoggedInUserTest.xml | 2 +-
.../Test/EndToEndB2CLoggedInUserTest.xml | 2 +-
30 files changed, 174 insertions(+), 173 deletions(-)
diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml
index 3c00344697699..c49202f31aefb 100644
--- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml
+++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminAddDefaultVideoBundleProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml
index e3cb68b6664e2..d050c5443d1fe 100644
--- a/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml
+++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdminRemoveDefaultVideoBundleProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml
index 0b220efaad49f..52bce67600888 100644
--- a/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml
+++ b/app/code/Magento/Bundle/Test/Mftf/Test/AdvanceCatalogSearchBundleProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest.xml b/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest.xml
index a088266f760a5..035e58de06ccf 100644
--- a/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest.xml
+++ b/app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml
index 5456cb02e74ca..f657fbbdae607 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml
index f48c352c5290a..eab36bc90dc18 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddDefaultVideoVirtualProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml
index 1bd218d18c27d..876eedb9347c7 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml
index e6d3978cad7bb..8b3b38d0ece31 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminRemoveDefaultVideoVirtualProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchVirtualProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchVirtualProductTest.xml
index 0eb8f5668751a..84c3f81ef6dbf 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchVirtualProductTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdvanceCatalogSearchVirtualProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml
index 7da668df59022..cee40241185b4 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/CheckTierPricingOfProductsTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml
index f283a040ced41..e6c37c8dc15e3 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml
index 269ca94b3f772..f3807388399b8 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/CheckoutSpecificDestinationsTest.xml
@@ -1,86 +1,86 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml
index 9664ec47420cc..89028e146c358 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/IdentityOfDefaultBillingAndShippingAddressTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdvanceCatalogSearchConfigurableTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdvanceCatalogSearchConfigurableTest.xml
index 454f9f5f29a7a..c303e4d19db81 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdvanceCatalogSearchConfigurableTest.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/AdvanceCatalogSearchConfigurableTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml
index 88dcca0958719..a7acdfded29b6 100644
--- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml
+++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminAddDefaultVideoDownloadableProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdvanceCatalogSearchDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdvanceCatalogSearchDownloadableProductTest.xml
index af5d20b075d12..66177b6875dd9 100644
--- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdvanceCatalogSearchDownloadableProductTest.xml
+++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdvanceCatalogSearchDownloadableProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml
index 8634fc3f6f9dc..c3a95bbef3aa3 100644
--- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml
+++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminAddDefaultVideoGroupedProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml
index 25c45abdfe047..e322d4a1eb038 100644
--- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml
+++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdminRemoveDefaultVideoGroupedProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest.xml b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest.xml
index 0fd52ac4a65a4..2a600d38250f8 100644
--- a/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest.xml
+++ b/app/code/Magento/GroupedProduct/Test/Mftf/Test/AdvanceCatalogSearchGroupedProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml
index faed8b1af952e..0ef4f69f565a8 100644
--- a/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml
+++ b/app/code/Magento/Newsletter/Test/Mftf/Test/VerifySubscribedNewsletterDisplayedTest.xml
@@ -6,7 +6,7 @@
*/
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml
index bd7cc0cdf5b4a..2b5f87f78d5e5 100644
--- a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml
+++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminAddDefaultVideoSimpleProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml
index f5a7886fed45c..d4da0ffa54451 100644
--- a/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml
+++ b/app/code/Magento/ProductVideo/Test/Mftf/Test/AdminRemoveDefaultVideoSimpleProductTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml
index f15f5de5df696..93124ac0ffd89 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminCreateOrderWithBundleProductTest.xml
@@ -6,7 +6,7 @@
*/
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml
index 041252af0ac5b..74784ed495f8a 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitConfigurableProductOrderTest.xml
@@ -6,7 +6,7 @@
*/
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistory.xml b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistory.xml
index 9790b5dfc47f3..ad3a411d92414 100644
--- a/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistory.xml
+++ b/app/code/Magento/Sales/Test/Mftf/Test/StorefrontRedirectToOrderHistory.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml
index 2e3467fe2c7c5..4f00f72720ef4 100644
--- a/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml
+++ b/app/code/Magento/Weee/Test/Mftf/Test/AdminRemoveProductWeeeAttributeOptionTest.xml
@@ -6,7 +6,7 @@
*/
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
@@ -44,6 +44,7 @@
+
diff --git a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml
index 9f11de49adcd4..84b605747d08b 100644
--- a/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml
+++ b/app/code/Magento/Wishlist/Test/Mftf/Test/StorefrontUpdateWishlistTest.xml
@@ -1,59 +1,59 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml
index f5cd41bda74d7..404bebfb719dc 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CGuestUserTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml
index 3e386a034eecc..9fe70c8b4dd3b 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductCatalogSearch/Test/EndToEndB2CLoggedInUserTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
diff --git a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/Test/EndToEndB2CLoggedInUserTest.xml b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/Test/EndToEndB2CLoggedInUserTest.xml
index d3b009eecf877..cb3d9edbc1cbb 100644
--- a/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/Test/EndToEndB2CLoggedInUserTest.xml
+++ b/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/Test/EndToEndB2CLoggedInUserTest.xml
@@ -7,7 +7,7 @@
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
From c6c3a25ec2e5a1ab99117f65bb9a977f924a2bcf Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Mon, 14 Jan 2019 10:46:52 -0600
Subject: [PATCH 068/121] MC-11005 - Create functions for DHL message timestamp
and reference
Changed visibility on constants to private
---
app/code/Magento/Dhl/Model/Carrier.php | 6 +++---
app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php | 10 +++++++---
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php
index 9bbe0f2beed9a..e765b33bfdba1 100644
--- a/app/code/Magento/Dhl/Model/Carrier.php
+++ b/app/code/Magento/Dhl/Model/Carrier.php
@@ -59,9 +59,9 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin
/**
* DHL service prefixes used for message reference
*/
- const SERVICE_PREFIX_QUOTE = 'QUOT';
- const SERVICE_PREFIX_SHIPVAL = 'SHIP';
- const SERVICE_PREFIX_TRACKING = 'TRCK';
+ private const SERVICE_PREFIX_QUOTE = 'QUOT';
+ private const SERVICE_PREFIX_SHIPVAL = 'SHIP';
+ private const SERVICE_PREFIX_TRACKING = 'TRCK';
/**
* Rate request data
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
index e90f22e2a150d..311dfe2eac736 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
@@ -549,15 +549,19 @@ public function testBuildMessageReference()
$method = new \ReflectionMethod($this->model, 'buildMessageReference');
$method->setAccessible(true);
- $msgRefQuote = $method->invoke($this->model, Carrier::SERVICE_PREFIX_QUOTE);
+ $constPrefixQuote = new \ReflectionClassConstant($this->model, 'SERVICE_PREFIX_QUOTE');
+ $constPrefixShipval = new \ReflectionClassConstant($this->model, 'SERVICE_PREFIX_SHIPVAL');
+ $constPrefixTracking = new \ReflectionClassConstant($this->model, 'SERVICE_PREFIX_TRACKING');
+
+ $msgRefQuote = $method->invoke($this->model, $constPrefixQuote->getValue());
self::assertGreaterThanOrEqual(28, strlen($msgRefQuote));
self::assertLessThanOrEqual(32, strlen($msgRefQuote));
- $msgRefShip = $method->invoke($this->model, Carrier::SERVICE_PREFIX_SHIPVAL);
+ $msgRefShip = $method->invoke($this->model, $constPrefixShipval->getValue());
self::assertGreaterThanOrEqual(28, strlen($msgRefShip));
self::assertLessThanOrEqual(32, strlen($msgRefShip));
- $msgRefTrack = $method->invoke($this->model, Carrier::SERVICE_PREFIX_TRACKING);
+ $msgRefTrack = $method->invoke($this->model, $constPrefixTracking->getValue());
self::assertGreaterThanOrEqual(28, strlen($msgRefTrack));
self::assertLessThanOrEqual(32, strlen($msgRefTrack));
From 80061a668e3107aa8d5713d4819e824d92bff93d Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Mon, 14 Jan 2019 14:19:24 -0600
Subject: [PATCH 069/121] MC-6296 - Update DCTRequest
Updated productMetadata variable visibility to private
Updated building of quote request to use new messageTimestamp and messageReference function
---
app/code/Magento/Dhl/Model/Carrier.php | 23 +++++---
.../Dhl/Test/Unit/Model/CarrierTest.php | 52 +++++++++++--------
2 files changed, 46 insertions(+), 29 deletions(-)
diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php
index 7a493460e0352..bd129eb6111a5 100644
--- a/app/code/Magento/Dhl/Model/Carrier.php
+++ b/app/code/Magento/Dhl/Model/Carrier.php
@@ -16,6 +16,7 @@
use Magento\Shipping\Model\Rate\Result;
use Magento\Framework\Xml\Security;
use Magento\Dhl\Model\Validator\XmlValidator;
+use Magento\Framework\App\ProductMetadataInterface;
/**
* DHL International (API v1.4)
@@ -206,7 +207,10 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin
'SiteID', 'Password'
];
- protected $productMetadata;
+ /**
+ * @var \Magento\Framework\App\ProductMetadataInterface
+ */
+ private $productMetadata;
/**
* Xml response validator
@@ -242,6 +246,7 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin
* @param \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory
* @param array $data
* @param \Magento\Dhl\Model\Validator\XmlValidator $xmlValidator
+ * @param \Magento\Framework\App\ProductMetadataInterface $productMetadata
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -271,7 +276,7 @@ public function __construct(
\Magento\Framework\HTTP\ZendClientFactory $httpClientFactory,
array $data = [],
\Magento\Dhl\Model\Validator\XmlValidator $xmlValidator = null,
- \Magento\Framework\App\ProductMetadataInterface $productMetadata
+ \Magento\Framework\App\ProductMetadataInterface $productMetadata = null
) {
$this->readFactory = $readFactory;
$this->_carrierHelper = $carrierHelper;
@@ -282,7 +287,6 @@ public function __construct(
$this->mathDivision = $mathDivision;
$this->_dateTime = $dateTime;
$this->_httpClientFactory = $httpClientFactory;
- $this->productMetadata = $productMetadata;
parent::__construct(
$scopeConfig,
$rateErrorFactory,
@@ -304,8 +308,10 @@ public function __construct(
if ($this->getConfigData('content_type') == self::DHL_CONTENT_TYPE_DOC) {
$this->_freeMethod = 'free_method_doc';
}
- $this->xmlValidator = $xmlValidator
- ?: \Magento\Framework\App\ObjectManager::getInstance()->get(XmlValidator::class);
+
+ $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
+ $this->xmlValidator = $xmlValidator ?: $objectManager->get(XmlValidator::class);
+ $this->productMetadata = $productMetadata ?: $objectManager->get(ProductMetadataInterface::class);
}
/**
@@ -1007,8 +1013,11 @@ protected function _buildQuotesRequestXml()
$nodeRequest = $nodeGetQuote->addChild('Request');
$nodeServiceHeader = $nodeRequest->addChild('ServiceHeader');
- $nodeServiceHeader->addChild('MessageTime', date('Y-m-d\TH:i:sP'));
- $nodeServiceHeader->addChild('MessageReference', uniqid('magento_quotereq_'));
+ $nodeServiceHeader->addChild('MessageTime', $this->buildMessageTimestamp());
+ $nodeServiceHeader->addChild(
+ 'MessageReference',
+ $this->buildMessageReference(self::SERVICE_PREFIX_QUOTE)
+ );
$nodeServiceHeader->addChild('SiteID', (string) $this->getConfigData('id'));
$nodeServiceHeader->addChild('Password', (string) $this->getConfigData('password'));
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
index 35d998b1108df..785ddb854fe7a 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
@@ -117,15 +117,6 @@ protected function setUp()
$this->scope = $this->getMockForAbstractClass(ScopeConfigInterface::class);
- $xmlElFactory = $this->getXmlFactory();
- $rateFactory = $this->getRateFactory();
- $rateMethodFactory = $this->getRateMethodFactory();
- $httpClientFactory = $this->getHttpClientFactory();
- $configReader = $this->getConfigReader();
- $readFactory = $this->getReadFactory();
- $storeManager = $this->getStoreManager();
- $productMetadata = $this->getProductMetadata();
-
$this->error = $this->getMockBuilder(Error::class)
->setMethods(['setCarrier', 'setCarrierTitle', 'setErrorMessage'])
->getMock();
@@ -136,8 +127,6 @@ protected function setUp()
$this->errorFactory->method('create')
->willReturn($this->error);
- $carrierHelper = $this->getCarrierHelper();
-
$this->xmlValidator = $this->getMockBuilder(XmlValidator::class)
->disableOriginalConstructor()
->getMock();
@@ -148,20 +137,21 @@ protected function setUp()
Carrier::class,
[
'scopeConfig' => $this->scope,
- 'xmlSecurity' => new Security(),
- 'logger' => $this->logger,
- 'xmlElFactory' => $xmlElFactory,
- 'rateFactory' => $rateFactory,
'rateErrorFactory' => $this->errorFactory,
- 'rateMethodFactory' => $rateMethodFactory,
- 'httpClientFactory' => $httpClientFactory,
- 'readFactory' => $readFactory,
- 'storeManager' => $storeManager,
- 'configReader' => $configReader,
- 'carrierHelper' => $carrierHelper,
+ 'logger' => $this->logger,
+ 'xmlSecurity' => new Security(),
+ 'xmlElFactory' => $this->getXmlFactory(),
+ 'rateFactory' => $this->getRateFactory(),
+ 'rateMethodFactory' => $this->getRateMethodFactory(),
+ 'carrierHelper' => $this->getCarrierHelper(),
+ 'coreDate' => $this->getCoreDate(),
+ 'configReader' => $this->getConfigReader(),
+ 'storeManager' => $this->getStoreManager(),
+ 'readFactory' => $this->getReadFactory(),
+ 'httpClientFactory' => $this->getHttpClientFactory(),
'data' => ['id' => 'dhl', 'store' => '1'],
'xmlValidator' => $this->xmlValidator,
- 'productMetadata' => $productMetadata
+ 'productMetadata' => $this->getProductMetadata()
]
);
}
@@ -721,6 +711,21 @@ private function getCarrierHelper(): CarrierHelper
return $carrierHelper;
}
+ /**
+ * @return MockObject
+ */
+ private function getCoreDate(): MockObject
+ {
+ $coreDate = $this->getMockBuilder(\Magento\Framework\Stdlib\DateTime\DateTime::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $coreDate->method('date')->willReturnCallback(function () {
+ return date(\DATE_RFC3339);
+ });
+
+ return $coreDate;
+ }
+
/**
* @return MockObject
*/
@@ -744,6 +749,9 @@ private function getHttpClientFactory(): MockObject
return $httpClientFactory;
}
+ /**
+ * @return MockObject
+ */
private function getProductMetadata(): MockObject
{
$productMetadata = $this->createMock(\Magento\Framework\App\ProductMetadata::class);
From 2794d6ae7b33666e87c33e643f3996c13ac50706 Mon Sep 17 00:00:00 2001
From: Andrii Meysar
Date: Tue, 15 Jan 2019 17:25:29 +0200
Subject: [PATCH 070/121] MC-10939: Integration tests failure on Jenkins
---
.../BundleImportExport/Model/BundleTest.php | 19 +-
.../AbstractProductExportImportTestCase.php | 227 ++++++++++--------
.../CatalogImportExport/Model/ProductTest.php | 21 +-
.../Model/ConfigurableTest.php | 32 ++-
.../Model/DownloadableTest.php | 72 ++----
.../GroupedImportExport/Model/GroupedTest.php | 19 +-
6 files changed, 186 insertions(+), 204 deletions(-)
diff --git a/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/BundleTest.php b/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/BundleTest.php
index e15f8d47a7bfc..864bdaa2a1331 100644
--- a/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/BundleTest.php
+++ b/dev/tests/integration/testsuite/Magento/BundleImportExport/Model/BundleTest.php
@@ -9,7 +9,10 @@
class BundleTest extends AbstractProductExportImportTestCase
{
- public function exportImportDataProvider()
+ /**
+ * @return array
+ */
+ public function exportImportDataProvider(): array
{
return [
// @todo uncomment after MAGETWO-49677 resolved
@@ -45,17 +48,13 @@ public function exportImportDataProvider()
];
}
- public function importReplaceDataProvider()
- {
- return $this->exportImportDataProvider();
- }
-
/**
- * @param \Magento\Catalog\Model\Product $expectedProduct
- * @param \Magento\Catalog\Model\Product $actualProduct
+ * @inheritdoc
*/
- protected function assertEqualsSpecificAttributes($expectedProduct, $actualProduct)
- {
+ protected function assertEqualsSpecificAttributes(
+ \Magento\Catalog\Model\Product $expectedProduct,
+ \Magento\Catalog\Model\Product $actualProduct
+ ): void {
$expectedBundleProductOptions = $expectedProduct->getExtensionAttributes()->getBundleProductOptions();
$actualBundleProductOptions = $actualProduct->getExtensionAttributes()->getBundleProductOptions();
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/AbstractProductExportImportTestCase.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/AbstractProductExportImportTestCase.php
index b562879b319d6..d3a2e4c53f246 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/AbstractProductExportImportTestCase.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/AbstractProductExportImportTestCase.php
@@ -55,6 +55,16 @@ abstract class AbstractProductExportImportTestCase extends \PHPUnit\Framework\Te
'is_salable', // stock indexation is not performed during import
];
+ /**
+ * @var array
+ */
+ private static $attributesToRefresh = [
+ 'tax_class_id',
+ ];
+
+ /**
+ * @inheritdoc
+ */
protected function setUp()
{
$this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
@@ -65,12 +75,17 @@ protected function setUp()
\Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType::$commonAttributesCache = [];
}
+ /**
+ * @inheritdoc
+ */
protected function tearDown()
{
- $this->executeRollbackFixtures($this->fixtures);
+ $this->executeFixtures($this->fixtures, true);
}
/**
+ * Run import/export tests.
+ *
* @magentoAppArea adminhtml
* @magentoDbIsolation disabled
* @magentoAppIsolation enabled
@@ -78,36 +93,60 @@ protected function tearDown()
* @param array $fixtures
* @param string[] $skus
* @param string[] $skippedAttributes
+ * @return void
* @dataProvider exportImportDataProvider
*/
- public function testExport($fixtures, $skus, $skippedAttributes = [])
+ public function testImportExport(array $fixtures, array $skus, array $skippedAttributes = []): void
{
$this->fixtures = $fixtures;
- $this->executeFixtures($fixtures, $skus);
+ $this->executeFixtures($fixtures);
$this->modifyData($skus);
$skippedAttributes = array_merge(self::$skippedAttributes, $skippedAttributes);
- $this->executeExportTest($skus, $skippedAttributes);
+ $csvFile = $this->executeExportTest($skus, $skippedAttributes);
+
+ $this->executeImportReplaceTest($skus, $skippedAttributes, false, $csvFile);
+ $this->executeImportReplaceTest($skus, $skippedAttributes, true, $csvFile);
+ $this->executeImportDeleteTest($skus, $csvFile);
}
- abstract public function exportImportDataProvider();
+ /**
+ * Provide data for import/export.
+ *
+ * @return array
+ */
+ abstract public function exportImportDataProvider(): array;
/**
+ * Modify data.
+ *
* @param array $skus
+ * @return void
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- protected function modifyData($skus)
+ protected function modifyData(array $skus): void
{
}
/**
+ * Prepare product.
+ *
* @param \Magento\Catalog\Model\Product $product
+ * @return void
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function prepareProduct($product)
+ public function prepareProduct(\Magento\Catalog\Model\Product $product): void
{
}
- protected function executeExportTest($skus, $skippedAttributes)
+ /**
+ * Execute export test.
+ *
+ * @param array $skus
+ * @param array $skippedAttributes
+ * @return string
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
+ */
+ protected function executeExportTest(array $skus, array $skippedAttributes): string
{
$index = 0;
$ids = [];
@@ -140,10 +179,23 @@ protected function executeExportTest($skus, $skippedAttributes)
$this->assertEqualsSpecificAttributes($origProducts[$index], $newProduct);
}
+
+ return $csvfile;
}
- private function assertEqualsOtherThanSkippedAttributes($expected, $actual, $skippedAttributes)
- {
+ /**
+ * Assert data equals (ignore skipped attributes).
+ *
+ * @param array $expected
+ * @param array $actual
+ * @param array $skippedAttributes
+ * @return void
+ */
+ private function assertEqualsOtherThanSkippedAttributes(
+ array $expected,
+ array $actual,
+ array $skippedAttributes
+ ): void {
foreach ($expected as $key => $value) {
if (is_object($value) || in_array($key, $skippedAttributes)) {
continue;
@@ -158,134 +210,93 @@ private function assertEqualsOtherThanSkippedAttributes($expected, $actual, $ski
}
/**
- * @magentoAppArea adminhtml
- * @magentoDbIsolation disabled
- * @magentoAppIsolation enabled
+ * Execute import test with delete behavior.
*
- * @param array $fixtures
- * @param string[] $skus
- * @dataProvider exportImportDataProvider
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ * @param array $skus
+ * @param string|null $csvFile
+ * @return void
*/
- public function testImportDelete($fixtures, $skus, $skippedAttributes = [])
- {
- $this->fixtures = $fixtures;
- $this->executeFixtures($fixtures, $skus);
- $this->modifyData($skus);
- $this->executeImportDeleteTest($skus);
- }
-
- protected function executeImportDeleteTest($skus)
+ protected function executeImportDeleteTest(array $skus, string $csvFile = null): void
{
- $csvfile = $this->exportProducts();
- $this->importProducts($csvfile, \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE);
- /** @var \Magento\Catalog\Model\Product $product */
- $product = $this->objectManager->create(\Magento\Catalog\Model\Product::class);
+ $csvFile = $csvFile ?? $this->exportProducts();
+ $this->importProducts($csvFile, \Magento\ImportExport\Model\Import::BEHAVIOR_DELETE);
foreach ($skus as $sku) {
$productId = $this->productResource->getIdBySku($sku);
- $product->load($productId);
- $this->assertNull($product->getId());
+ $this->assertFalse($productId);
}
}
/**
- * Execute fixtures
+ * Execute fixtures.
*
- * @param array $skus
* @param array $fixtures
+ * @param bool $rollback
* @return void
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- protected function executeFixtures($fixtures, $skus = [])
+ protected function executeFixtures(array $fixtures, bool $rollback = false)
{
foreach ($fixtures as $fixture) {
- $fixturePath = $this->fileSystem->getDirectoryRead(DirectoryList::ROOT)
- ->getAbsolutePath('/dev/tests/integration/testsuite/' . $fixture);
+ $fixturePath = $this->resolveFixturePath($fixture, $rollback);
include $fixturePath;
}
}
/**
- * Execute rollback fixtures
+ * Resolve fixture path.
*
- * @param array $fixtures
- * @return void
+ * @param string $fixture
+ * @param bool $rollback
+ * @return string
*/
- private function executeRollbackFixtures($fixtures)
+ private function resolveFixturePath(string $fixture, bool $rollback = false)
{
- foreach ($fixtures as $fixture) {
- $fixturePath = $this->fileSystem->getDirectoryRead(DirectoryList::ROOT)
- ->getAbsolutePath('/dev/tests/integration/testsuite/' . $fixture);
+ $fixturePath = $this->fileSystem->getDirectoryRead(DirectoryList::ROOT)
+ ->getAbsolutePath('/dev/tests/integration/testsuite/' . $fixture);
+ if ($rollback) {
$fileInfo = pathinfo($fixturePath);
$extension = '';
if (isset($fileInfo['extension'])) {
$extension = '.' . $fileInfo['extension'];
}
- $rollbackfixturePath = $fileInfo['dirname'] . '/' . $fileInfo['filename'] . '_rollback' . $extension;
- if (file_exists($rollbackfixturePath)) {
- include $rollbackfixturePath;
- }
+ $fixturePath = $fileInfo['dirname'] . '/' . $fileInfo['filename'] . '_rollback' . $extension;
}
+
+ return $fixturePath;
}
/**
+ * Assert that specific attributes equal.
+ *
* @param \Magento\Catalog\Model\Product $expectedProduct
* @param \Magento\Catalog\Model\Product $actualProduct
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- protected function assertEqualsSpecificAttributes($expectedProduct, $actualProduct)
- {
+ protected function assertEqualsSpecificAttributes(
+ \Magento\Catalog\Model\Product $expectedProduct,
+ \Magento\Catalog\Model\Product $actualProduct
+ ): void {
// check custom options
}
/**
- * @magentoAppArea adminhtml
- * @magentoDbIsolation disabled
- * @magentoAppIsolation enabled
+ * Execute import test with replace behavior.
*
- * @param array $fixtures
- * @param string[] $skus
- * @param string[] $skippedAttributes
- * @dataProvider importReplaceDataProvider
- */
- public function testImportReplace($fixtures, $skus, $skippedAttributes = [])
- {
- $this->fixtures = $fixtures;
- $this->executeFixtures($fixtures, $skus);
- $this->modifyData($skus);
- $skippedAttributes = array_merge(self::$skippedAttributes, $skippedAttributes);
- $this->executeImportReplaceTest($skus, $skippedAttributes);
- }
-
- /**
- * @magentoAppArea adminhtml
- * @magentoDbIsolation disabled
- * @magentoAppIsolation enabled
- *
- * @param array $fixtures
- * @param string[] $skus
- * @param string[] $skippedAttributes
- * @dataProvider importReplaceDataProvider
- */
- public function testImportReplaceWithPagination($fixtures, $skus, $skippedAttributes = [])
- {
- $this->fixtures = $fixtures;
- $this->executeFixtures($fixtures, $skus);
- $this->modifyData($skus);
- $skippedAttributes = array_merge(self::$skippedAttributes, $skippedAttributes);
- $this->executeImportReplaceTest($skus, $skippedAttributes, true);
- }
-
- /**
* @param string[] $skus
* @param string[] $skippedAttributes
* @param bool $usePagination
- *
+ * @param string|null $csvfile
+ * @return void
+ * @throws \Magento\Framework\Exception\NoSuchEntityException
* @SuppressWarnings(PHPMD.NPathComplexity)
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
- protected function executeImportReplaceTest($skus, $skippedAttributes, $usePagination = false)
- {
+ protected function executeImportReplaceTest(
+ $skus,
+ $skippedAttributes,
+ $usePagination = false,
+ string $csvfile = null
+ ) {
$replacedAttributes = [
'row_id',
'entity_id',
@@ -293,6 +304,7 @@ protected function executeImportReplaceTest($skus, $skippedAttributes, $usePagin
'media_gallery'
];
$skippedAttributes = array_merge($replacedAttributes, $skippedAttributes);
+ $this->cleanAttributesCache();
$index = 0;
$ids = [];
@@ -316,15 +328,15 @@ protected function executeImportReplaceTest($skus, $skippedAttributes, $usePagin
$itemsPerPageProperty->setValue($exportProduct, 1);
}
- $csvfile = $this->exportProducts($exportProduct);
+ $csvfile = $csvfile ?? $this->exportProducts($exportProduct);
$this->importProducts($csvfile, \Magento\ImportExport\Model\Import::BEHAVIOR_REPLACE);
while ($index > 0) {
$index--;
$newProduct = $productRepository->get($skus[$index], false, Store::DEFAULT_STORE_ID, true);
// check original product is deleted
- $origProduct = $this->objectManager->create(\Magento\Catalog\Model\Product::class)->load($ids[$index]);
- $this->assertNull($origProduct->getId());
+ $productId = $this->productResource->getIdBySku($ids[$index]);
+ $this->assertFalse($productId);
// check new product data
// @todo uncomment or remove after MAGETWO-49806 resolved
@@ -342,7 +354,7 @@ protected function executeImportReplaceTest($skus, $skippedAttributes, $usePagin
array_filter($origProductData[$attribute]) :
$origProductData[$attribute];
if (!empty($expected)) {
- $actual = isset($newProductData[$attribute]) ? $newProductData[$attribute] : null;
+ $actual = $newProductData[$attribute] ?? null;
$actual = is_array($actual) ? array_filter($actual) : $actual;
$this->assertNotEquals($expected, $actual, $attribute . ' is expected to be changed');
}
@@ -352,7 +364,7 @@ protected function executeImportReplaceTest($skus, $skippedAttributes, $usePagin
}
/**
- * Export products in the system
+ * Export products in the system.
*
* @param \Magento\CatalogImportExport\Model\Export\Product|null $exportProduct
* @return string Return exported file name
@@ -371,17 +383,18 @@ private function exportProducts(\Magento\CatalogImportExport\Model\Export\Produc
)
);
$this->assertNotEmpty($exportProduct->export());
+
return $csvfile;
}
/**
- * Import products from the given file
+ * Import products from the given file.
*
* @param string $csvfile
* @param string $behavior
* @return void
*/
- private function importProducts($csvfile, $behavior)
+ private function importProducts(string $csvfile, string $behavior): void
{
/** @var \Magento\CatalogImportExport\Model\Import\Product $importModel */
$importModel = $this->objectManager->create(
@@ -437,15 +450,33 @@ private function importProducts($csvfile, $behavior)
}
/**
+ * Extract error message.
+ *
* @param \Magento\ImportExport\Model\Import\ErrorProcessing\ProcessingError[] $errors
* @return string
*/
- private function extractErrorMessage($errors)
+ private function extractErrorMessage(array $errors): string
{
$errorMessage = '';
foreach ($errors as $error) {
$errorMessage = "\n" . $error->getErrorMessage();
}
+
return $errorMessage;
}
+
+ /**
+ * Clean import attribute cache.
+ *
+ * @return void
+ */
+ private function cleanAttributesCache(): void
+ {
+ foreach (self::$attributesToRefresh as $attributeCode) {
+ $attributeId = Import\Product\Type\AbstractType::$attributeCodeToId[$attributeCode] ?? null;
+ if ($attributeId !== null) {
+ unset(Import\Product\Type\AbstractType::$commonAttributesCache[$attributeId]);
+ }
+ }
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/ProductTest.php b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/ProductTest.php
index 11cc73e2cf944..c39acbc338727 100644
--- a/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/ProductTest.php
+++ b/dev/tests/integration/testsuite/Magento/CatalogImportExport/Model/ProductTest.php
@@ -10,18 +10,10 @@
*/
class ProductTest extends AbstractProductExportImportTestCase
{
- /**
- * Set up
- */
- protected function setUp()
- {
- $this->markTestSkipped('MAGETWO-97378');
- }
-
/**
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
- public function exportImportDataProvider()
+ public function exportImportDataProvider(): array
{
return [
'product_export_data' => [
@@ -144,11 +136,6 @@ public function exportImportDataProvider()
];
}
- public function importReplaceDataProvider()
- {
- return $this->exportImportDataProvider();
- }
-
/**
* Fixing https://github.com/magento-engcom/import-export-improvements/issues/50 means that during import images
* can now get renamed for this we need to skip the attribute checking and instead check that the images contain
@@ -158,8 +145,10 @@ public function importReplaceDataProvider()
* @param \Magento\Catalog\Model\Product $expectedProduct
* @param \Magento\Catalog\Model\Product $actualProduct
*/
- protected function assertEqualsSpecificAttributes($expectedProduct, $actualProduct)
- {
+ protected function assertEqualsSpecificAttributes(
+ \Magento\Catalog\Model\Product $expectedProduct,
+ \Magento\Catalog\Model\Product $actualProduct
+ ): void {
if (!empty($actualProduct->getImage())
&& !empty($expectedProduct->getImage())
) {
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/ConfigurableTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/ConfigurableTest.php
index 5184a37563317..338daa56450d4 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/ConfigurableTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableImportExport/Model/ConfigurableTest.php
@@ -9,7 +9,10 @@
class ConfigurableTest extends AbstractProductExportImportTestCase
{
- public function exportImportDataProvider()
+ /**
+ * @return array
+ */
+ public function exportImportDataProvider(): array
{
return [
'configurable-product' => [
@@ -34,11 +37,12 @@ public function exportImportDataProvider()
}
/**
- * @param \Magento\Catalog\Model\Product $expectedProduct
- * @param \Magento\Catalog\Model\Product $actualProduct
+ * @inheritdoc
*/
- protected function assertEqualsSpecificAttributes($expectedProduct, $actualProduct)
- {
+ protected function assertEqualsSpecificAttributes(
+ \Magento\Catalog\Model\Product $expectedProduct,
+ \Magento\Catalog\Model\Product $actualProduct
+ ): void {
/** @var \Magento\ConfigurableProduct\Model\Product\Type\Configurable $productType */
$productType = $expectedProduct->getTypeInstance();
$expectedAssociatedProducts = $productType->getUsedProductCollection($expectedProduct);
@@ -95,12 +99,16 @@ protected function assertEqualsSpecificAttributes($expectedProduct, $actualProdu
}
}
- public function importReplaceDataProvider()
- {
- $data = $this->exportImportDataProvider();
- foreach ($data as $key => $value) {
- $data[$key][2] = array_merge($value[2], ['_cache_instance_product_set_attributes']);
- }
- return $data;
+ /**
+ * @inheritdoc
+ */
+ protected function executeImportReplaceTest(
+ $skus,
+ $skippedAttributes,
+ $usePagination = false,
+ string $csvfile = null
+ ) {
+ $skippedAttributes = array_merge($skippedAttributes, ['_cache_instance_product_set_attributes']);
+ parent::executeImportReplaceTest($skus, $skippedAttributes, $usePagination, $csvfile);
}
}
diff --git a/dev/tests/integration/testsuite/Magento/DownloadableImportExport/Model/DownloadableTest.php b/dev/tests/integration/testsuite/Magento/DownloadableImportExport/Model/DownloadableTest.php
index c80cd13a1683b..d0e4471e2ea68 100644
--- a/dev/tests/integration/testsuite/Magento/DownloadableImportExport/Model/DownloadableTest.php
+++ b/dev/tests/integration/testsuite/Magento/DownloadableImportExport/Model/DownloadableTest.php
@@ -9,7 +9,10 @@
class DownloadableTest extends AbstractProductExportImportTestCase
{
- public function exportImportDataProvider()
+ /**
+ * @return array
+ */
+ public function exportImportDataProvider(): array
{
return [
'downloadable-product' => [
@@ -31,79 +34,32 @@ public function exportImportDataProvider()
];
}
- public function importReplaceDataProvider()
- {
- return $this->exportImportDataProvider();
- }
-
- /**
- * @param array $fixtures
- * @param string[] $skus
- * @param string[] $skippedAttributes
- * @dataProvider exportImportDataProvider
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
- * @todo remove after MAGETWO-38240 resolved
- */
- public function testExport($fixtures, $skus, $skippedAttributes = [], $rollbackFixtures = [])
- {
- $this->markTestSkipped('Uncomment after MAGETWO-38240 resolved');
- }
-
- /**
- * @param array $fixtures
- * @param string[] $skus
- * @dataProvider exportImportDataProvider
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- *
- * @todo remove after MAGETWO-38240 resolved
- */
- public function testImportDelete($fixtures, $skus, $skippedAttributes = [], $rollbackFixtures = [])
- {
- $this->markTestSkipped('Uncomment after MAGETWO-38240 resolved');
- }
-
/**
- * @magentoAppArea adminhtml
- * @magentoDbIsolation enabled
- * @magentoAppIsolation enabled
- *
- * @param array $fixtures
- * @param string[] $skus
- * @param string[] $skippedAttributes
- * @dataProvider importReplaceDataProvider
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ * Run import/export tests.
*
- * @todo remove after MAGETWO-38240 resolved
- */
- public function testImportReplace($fixtures, $skus, $skippedAttributes = [], $rollbackFixtures = [])
- {
- $this->markTestSkipped('Uncomment after MAGETWO-38240 resolved');
- }
-
- /**
* @magentoAppArea adminhtml
- * @magentoDbIsolation enabled
+ * @magentoDbIsolation disabled
* @magentoAppIsolation enabled
*
* @param array $fixtures
* @param string[] $skus
* @param string[] $skippedAttributes
- * @dataProvider importReplaceDataProvider
- *
+ * @return void
+ * @dataProvider exportImportDataProvider
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
- public function testImportReplaceWithPagination($fixtures, $skus, $skippedAttributes = [])
+ public function testImportExport(array $fixtures, array $skus, array $skippedAttributes = []): void
{
$this->markTestSkipped('Uncomment after MAGETWO-38240 resolved');
}
/**
- * @param \Magento\Catalog\Model\Product $expectedProduct
- * @param \Magento\Catalog\Model\Product $actualProduct
+ * @inheritdoc
*/
- protected function assertEqualsSpecificAttributes($expectedProduct, $actualProduct)
- {
+ protected function assertEqualsSpecificAttributes(
+ \Magento\Catalog\Model\Product $expectedProduct,
+ \Magento\Catalog\Model\Product $actualProduct
+ ): void {
$expectedProductLinks = $expectedProduct->getExtensionAttributes()->getDownloadableProductLinks();
$expectedProductSamples = $expectedProduct->getExtensionAttributes()->getDownloadableProductSamples();
diff --git a/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/GroupedTest.php b/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/GroupedTest.php
index 67817b068ff09..afd515757ae4b 100644
--- a/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/GroupedTest.php
+++ b/dev/tests/integration/testsuite/Magento/GroupedImportExport/Model/GroupedTest.php
@@ -9,7 +9,10 @@
class GroupedTest extends AbstractProductExportImportTestCase
{
- public function exportImportDataProvider()
+ /**
+ * @return array
+ */
+ public function exportImportDataProvider(): array
{
return [
'grouped-product' => [
@@ -23,17 +26,13 @@ public function exportImportDataProvider()
];
}
- public function importReplaceDataProvider()
- {
- return $this->exportImportDataProvider();
- }
-
/**
- * @param \Magento\Catalog\Model\Product $expectedProduct
- * @param \Magento\Catalog\Model\Product $actualProduct
+ * @inheritdoc
*/
- protected function assertEqualsSpecificAttributes($expectedProduct, $actualProduct)
- {
+ protected function assertEqualsSpecificAttributes(
+ \Magento\Catalog\Model\Product $expectedProduct,
+ \Magento\Catalog\Model\Product $actualProduct
+ ): void {
$expectedAssociatedProducts = $expectedProduct->getTypeInstance()->getAssociatedProducts($expectedProduct);
$actualAssociatedProducts = $actualProduct->getTypeInstance()->getAssociatedProducts($actualProduct);
From 065e62863c547217b048537fb8b4e5fcb0d39b4a Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Thu, 17 Jan 2019 12:19:41 -0600
Subject: [PATCH 071/121] MC-6296: Update DCTRequest
Added private functions to build SoftwareName and SoftwareVersion for request
---
app/code/Magento/Dhl/Model/Carrier.php | 24 +++++++++-
.../Dhl/Test/Unit/Model/CarrierTest.php | 46 ++++++++++++++++++-
2 files changed, 66 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php
index bd129eb6111a5..769b440396fbe 100644
--- a/app/code/Magento/Dhl/Model/Carrier.php
+++ b/app/code/Magento/Dhl/Model/Carrier.php
@@ -1022,8 +1022,8 @@ protected function _buildQuotesRequestXml()
$nodeServiceHeader->addChild('Password', (string) $this->getConfigData('password'));
$nodeMetaData = $nodeRequest->addChild('MetaData');
- $nodeMetaData->addChild('SoftwareName', $this->productMetadata->getName());
- $nodeMetaData->addChild('SoftwareVersion', $this->productMetadata->getVersion());
+ $nodeMetaData->addChild('SoftwareName', $this->buildSoftwareName());
+ $nodeMetaData->addChild('SoftwareVersion', $this->buildSoftwareVersion());
$nodeFrom = $nodeGetQuote->addChild('From');
$nodeFrom->addChild('CountryCode', $rawRequest->getOrigCountryId());
@@ -2036,4 +2036,24 @@ private function buildMessageReference(string $servicePrefix): string
return str_replace('.', '', uniqid("MAGE_{$servicePrefix}_", true));
}
+
+ /**
+ * Builds a string to be used as the request SoftwareName.
+ *
+ * @return string
+ */
+ private function buildSoftwareName(): string
+ {
+ return substr($this->productMetadata->getName(), 0, 30);
+ }
+
+ /**
+ * Builds a string to be used as the request SoftwareVersion.
+ *
+ * @return string
+ */
+ private function buildSoftwareVersion(): string
+ {
+ return substr($this->productMetadata->getVersion(), 0, 10);
+ }
}
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
index 785ddb854fe7a..2fc0f1c43f949 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
@@ -566,6 +566,40 @@ public function testBuildMessageReference()
$method->invoke($this->model, 'TEST');
}
+ /**
+ * Tests that the built software name string is of the appropriate format.
+ *
+ * @throws \ReflectionException
+ */
+ public function testBuildSoftwareName()
+ {
+ $method = new \ReflectionMethod($this->model, 'buildSoftwareName');
+ $method->setAccessible(true);
+
+ $name = $method->invoke($this->model);
+ self::assertLessThanOrEqual(30, $name);
+
+ $nameExceedsLength = $method->invoke($this->model);
+ self::assertLessThanOrEqual(30, $nameExceedsLength);
+ }
+
+ /**
+ * Tests that the built software version string is of the appropriate format.
+ *
+ * @throws \ReflectionException
+ */
+ public function testBuildSoftwareVersion()
+ {
+ $method = new \ReflectionMethod($this->model, 'buildSoftwareVersion');
+ $method->setAccessible(true);
+
+ $version = $method->invoke($this->model);
+ self::assertLessThanOrEqual(10, strlen($version));
+
+ $versionExceedsLength = $method->invoke($this->model);
+ self::assertLessThanOrEqual(10, strlen($versionExceedsLength));
+ }
+
/**
* Creates mock for XML factory.
*
@@ -755,8 +789,16 @@ private function getHttpClientFactory(): MockObject
private function getProductMetadata(): MockObject
{
$productMetadata = $this->createMock(\Magento\Framework\App\ProductMetadata::class);
- $productMetadata->method('getName')->willReturn('Magento');
- $productMetadata->method('getVersion')->willReturn('2.3.1');
+
+ $productMetadata->method('getName')->willReturnOnConsecutiveCalls(
+ 'Magento',
+ str_pad('Magento', 24, '_')
+ );
+
+ $productMetadata->method('getVersion')->willReturnOnConsecutiveCalls(
+ '2.3.1',
+ 'dev-MC-1000'
+ );
return $productMetadata;
}
From ba9b12e0502baafa8dc8f67ef33935e896284472 Mon Sep 17 00:00:00 2001
From: Joan He
Date: Thu, 17 Jan 2019 15:41:39 -0600
Subject: [PATCH 072/121] MC-6295: Update ShipmentValidationRequest
---
app/code/Magento/Dhl/Model/Carrier.php | 172 ++++++++----------
.../Dhl/Test/Unit/Model/CarrierTest.php | 138 ++++++--------
.../Dhl/Test/Unit/Model/_files/countries.xml | 58 +++---
.../Unit/Model/_files/shipment_request.xml | 91 +++++++++
app/code/Magento/Dhl/etc/countries.xml | 56 +++---
5 files changed, 282 insertions(+), 233 deletions(-)
create mode 100644 app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml
diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php
index e765b33bfdba1..7e43c2dbd5d18 100644
--- a/app/code/Magento/Dhl/Model/Carrier.php
+++ b/app/code/Magento/Dhl/Model/Carrier.php
@@ -7,6 +7,7 @@
namespace Magento\Dhl\Model;
use Magento\Catalog\Model\Product\Type;
+use Magento\Framework\App\ProductMetadataInterface;
use Magento\Framework\Module\Dir;
use Magento\Sales\Exception\DocumentValidationException;
use Magento\Sales\Model\Order\Shipment;
@@ -213,6 +214,11 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin
*/
private $xmlValidator;
+ /**
+ * @var ProductMetadataInterface
+ */
+ private $productMetadata;
+
/**
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory
@@ -239,7 +245,8 @@ class Carrier extends \Magento\Dhl\Model\AbstractDhl implements \Magento\Shippin
* @param \Magento\Framework\Stdlib\DateTime $dateTime
* @param \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory
* @param array $data
- * @param \Magento\Dhl\Model\Validator\XmlValidator $xmlValidator
+ * @param \Magento\Dhl\Model\Validator\XmlValidator|null $xmlValidator
+ * @param ProductMetadataInterface|null $productMetadata
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -268,7 +275,8 @@ public function __construct(
\Magento\Framework\Stdlib\DateTime $dateTime,
\Magento\Framework\HTTP\ZendClientFactory $httpClientFactory,
array $data = [],
- \Magento\Dhl\Model\Validator\XmlValidator $xmlValidator = null
+ \Magento\Dhl\Model\Validator\XmlValidator $xmlValidator = null,
+ ProductMetadataInterface $productMetadata = null
) {
$this->readFactory = $readFactory;
$this->_carrierHelper = $carrierHelper;
@@ -302,6 +310,8 @@ public function __construct(
}
$this->xmlValidator = $xmlValidator
?: \Magento\Framework\App\ObjectManager::getInstance()->get(XmlValidator::class);
+ $this->productMetadata = $productMetadata
+ ?: \Magento\Framework\App\ObjectManager::getInstance()->get(ProductMetadataInterface::class);
}
/**
@@ -1393,44 +1403,41 @@ protected function _doRequest()
{
$rawRequest = $this->_request;
- $originRegion = $this->getCountryParams(
- $this->_scopeConfig->getValue(
- Shipment::XML_PATH_STORE_COUNTRY_ID,
- \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
- $this->getStore()
- )
- )->getRegion();
-
- if (!$originRegion) {
- throw new \Magento\Framework\Exception\LocalizedException(__('Wrong Region'));
- }
-
- if ($originRegion == 'AM') {
- $originRegion = '';
- }
-
$xmlStr = '' .
- ' ';
+ ' xsi:schemaLocation="http://www.dhl.com ship-val-global-req-6.2.xsd"' .
+ ' schemaVersion="6.2" />';
$xml = $this->_xmlElFactory->create(['data' => $xmlStr]);
$nodeRequest = $xml->addChild('Request', '', '');
$nodeServiceHeader = $nodeRequest->addChild('ServiceHeader');
+ $nodeServiceHeader->addChild('MessageTime', $this->buildMessageTimestamp());
+ // MessageReference must be 28 to 32 chars.
+ $nodeServiceHeader->addChild(
+ 'MessageReference',
+ $this->buildMessageReference(self::SERVICE_PREFIX_SHIPVAL)
+ );
$nodeServiceHeader->addChild('SiteID', (string)$this->getConfigData('id'));
$nodeServiceHeader->addChild('Password', (string)$this->getConfigData('password'));
- if (!$originRegion) {
- $xml->addChild('RequestedPickupTime', 'N', '');
- }
- if ($originRegion !== 'AP') {
- $xml->addChild('NewShipper', 'N', '');
+ $nodeMetaData = $nodeRequest->addChild('MetaData');
+ $nodeMetaData->addChild('SoftwareName', $this->productMetadata->getName());
+ $nodeMetaData->addChild('SoftwareVersion', $this->productMetadata->getVersion());
+
+ $originRegion = $this->getCountryParams(
+ $this->_scopeConfig->getValue(
+ Shipment::XML_PATH_STORE_COUNTRY_ID,
+ \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
+ $this->getStore()
+ )
+ )->getRegion();
+ if ($originRegion) {
+ $xml->addChild('RegionCode', $originRegion, '');
}
+ $xml->addChild('RequestedPickupTime', 'N', '');
+ $xml->addChild('NewShipper', 'N', '');
$xml->addChild('LanguageCode', 'EN', '');
$xml->addChild('PiecesEnabled', 'Y', '');
@@ -1472,8 +1479,9 @@ protected function _doRequest()
}
$nodeConsignee->addChild('City', $rawRequest->getRecipientAddressCity());
- if ($originRegion !== 'AP') {
- $nodeConsignee->addChild('Division', $rawRequest->getRecipientAddressStateOrProvinceCode());
+ $recipientAddressStateOrProvinceCode = $rawRequest->getRecipientAddressStateOrProvinceCode();
+ if ($recipientAddressStateOrProvinceCode) {
+ $nodeConsignee->addChild('Division', $recipientAddressStateOrProvinceCode);
}
$nodeConsignee->addChild('PostalCode', $rawRequest->getRecipientAddressPostalCode());
$nodeConsignee->addChild('CountryCode', $rawRequest->getRecipientAddressCountryCode());
@@ -1517,15 +1525,13 @@ protected function _doRequest()
$nodeReference->addChild('ReferenceType', 'St');
/** Shipment Details */
- $this->_shipmentDetails($xml, $rawRequest, $originRegion);
+ $this->_shipmentDetails($xml, $rawRequest);
/** Shipper */
$nodeShipper = $xml->addChild('Shipper', '', '');
$nodeShipper->addChild('ShipperID', (string)$this->getConfigData('account'));
$nodeShipper->addChild('CompanyName', $rawRequest->getShipperContactCompanyName());
- if ($originRegion !== 'AP') {
- $nodeShipper->addChild('RegisteredAccount', (string)$this->getConfigData('account'));
- }
+ $nodeShipper->addChild('RegisteredAccount', (string)$this->getConfigData('account'));
$address = $rawRequest->getShipperAddressStreet1() . ' ' . $rawRequest->getShipperAddressStreet2();
$address = $this->string->split($address, 35, false, true);
@@ -1538,8 +1544,9 @@ protected function _doRequest()
}
$nodeShipper->addChild('City', $rawRequest->getShipperAddressCity());
- if ($originRegion !== 'AP') {
- $nodeShipper->addChild('Division', $rawRequest->getShipperAddressStateOrProvinceCode());
+ $shipperAddressStateOrProvinceCode = $rawRequest->getShipperAddressStateOrProvinceCode();
+ if ($shipperAddressStateOrProvinceCode) {
+ $nodeShipper->addChild('Division', $shipperAddressStateOrProvinceCode);
}
$nodeShipper->addChild('PostalCode', $rawRequest->getShipperAddressPostalCode());
$nodeShipper->addChild('CountryCode', $rawRequest->getShipperAddressCountryCode());
@@ -1597,13 +1604,6 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '')
$nodeShipmentDetails = $xml->addChild('ShipmentDetails', '', '');
$nodeShipmentDetails->addChild('NumberOfPieces', count($rawRequest->getPackages()));
- if ($originRegion) {
- $nodeShipmentDetails->addChild(
- 'CurrencyCode',
- $this->_storeManager->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode()
- );
- }
-
$nodePieces = $nodeShipmentDetails->addChild('Pieces', '', '');
/*
@@ -1622,18 +1622,12 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '')
}
$nodePiece->addChild('PieceID', ++$i);
$nodePiece->addChild('PackageType', $packageType);
- $nodePiece->addChild('Weight', sprintf('%.1f', $package['params']['weight']));
+ $nodePiece->addChild('Weight', sprintf('%.3f', $package['params']['weight']));
$params = $package['params'];
if ($params['width'] && $params['length'] && $params['height']) {
- if (!$originRegion) {
- $nodePiece->addChild('Width', round($params['width']));
- $nodePiece->addChild('Height', round($params['height']));
- $nodePiece->addChild('Depth', round($params['length']));
- } else {
- $nodePiece->addChild('Depth', round($params['length']));
- $nodePiece->addChild('Width', round($params['width']));
- $nodePiece->addChild('Height', round($params['height']));
- }
+ $nodePiece->addChild('Width', round($params['width']));
+ $nodePiece->addChild('Height', round($params['height']));
+ $nodePiece->addChild('Depth', round($params['length']));
}
$content = [];
foreach ($package['items'] as $item) {
@@ -1642,51 +1636,33 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '')
$nodePiece->addChild('PieceContents', substr(implode(',', $content), 0, 34));
}
- if (!$originRegion) {
- $nodeShipmentDetails->addChild('Weight', sprintf('%.1f', $rawRequest->getPackageWeight()));
- $nodeShipmentDetails->addChild('WeightUnit', substr($this->_getWeightUnit(), 0, 1));
- $nodeShipmentDetails->addChild('GlobalProductCode', $rawRequest->getShippingMethod());
- $nodeShipmentDetails->addChild('LocalProductCode', $rawRequest->getShippingMethod());
- $nodeShipmentDetails->addChild('Date', $this->_coreDate->date('Y-m-d'));
- $nodeShipmentDetails->addChild('Contents', 'DHL Parcel');
- /**
- * The DoorTo Element defines the type of delivery service that applies to the shipment.
- * The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to
- * Door non-compliant)
- */
- $nodeShipmentDetails->addChild('DoorTo', 'DD');
- $nodeShipmentDetails->addChild('DimensionUnit', substr($this->_getDimensionUnit(), 0, 1));
- if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) {
- $packageType = 'CP';
- }
- $nodeShipmentDetails->addChild('PackageType', $packageType);
- if ($this->isDutiable($rawRequest->getOrigCountryId(), $rawRequest->getDestCountryId())) {
- $nodeShipmentDetails->addChild('IsDutiable', 'Y');
- }
- $nodeShipmentDetails->addChild(
- 'CurrencyCode',
- $this->_storeManager->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode()
- );
- } else {
- if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) {
- $packageType = 'CP';
- }
- $nodeShipmentDetails->addChild('PackageType', $packageType);
- $nodeShipmentDetails->addChild('Weight', sprintf('%.3f', $rawRequest->getPackageWeight()));
- $nodeShipmentDetails->addChild('DimensionUnit', substr($this->_getDimensionUnit(), 0, 1));
- $nodeShipmentDetails->addChild('WeightUnit', substr($this->_getWeightUnit(), 0, 1));
- $nodeShipmentDetails->addChild('GlobalProductCode', $rawRequest->getShippingMethod());
- $nodeShipmentDetails->addChild('LocalProductCode', $rawRequest->getShippingMethod());
-
- /**
- * The DoorTo Element defines the type of delivery service that applies to the shipment.
- * The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to
- * Door non-compliant)
- */
- $nodeShipmentDetails->addChild('DoorTo', 'DD');
- $nodeShipmentDetails->addChild('Date', $this->_coreDate->date('Y-m-d'));
- $nodeShipmentDetails->addChild('Contents', 'DHL Parcel TEST');
+ $nodeShipmentDetails->addChild('Weight', sprintf('%.3f', $rawRequest->getPackageWeight()));
+ $nodeShipmentDetails->addChild('WeightUnit', substr($this->_getWeightUnit(), 0, 1));
+ $nodeShipmentDetails->addChild('GlobalProductCode', $rawRequest->getShippingMethod());
+ $nodeShipmentDetails->addChild('LocalProductCode', $rawRequest->getShippingMethod());
+ $nodeShipmentDetails->addChild(
+ 'Date',
+ $this->_coreDate->date('Y-m-d', strtotime('now + 1day'))
+ );
+ $nodeShipmentDetails->addChild('Contents', 'DHL Parcel');
+ /**
+ * The DoorTo Element defines the type of delivery service that applies to the shipment.
+ * The valid values are DD (Door to Door), DA (Door to Airport) , AA and DC (Door to
+ * Door non-compliant)
+ */
+ $nodeShipmentDetails->addChild('DoorTo', 'DD');
+ $nodeShipmentDetails->addChild('DimensionUnit', substr($this->_getDimensionUnit(), 0, 1));
+ if ($package['params']['container'] == self::DHL_CONTENT_TYPE_NON_DOC) {
+ $packageType = 'CP';
}
+ $nodeShipmentDetails->addChild('PackageType', $packageType);
+ if ($this->isDutiable($rawRequest->getOrigCountryId(), $rawRequest->getDestCountryId())) {
+ $nodeShipmentDetails->addChild('IsDutiable', 'Y');
+ }
+ $nodeShipmentDetails->addChild(
+ 'CurrencyCode',
+ $this->_storeManager->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode()
+ );
}
/**
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
index 311dfe2eac736..82eb379d75be0 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
@@ -8,12 +8,14 @@
use Magento\Dhl\Model\Carrier;
use Magento\Dhl\Model\Validator\XmlValidator;
use Magento\Framework\App\Config\ScopeConfigInterface;
+use Magento\Framework\App\ProductMetadataInterface;
use Magento\Framework\Filesystem\Directory\Read;
use Magento\Framework\Filesystem\Directory\ReadFactory;
use Magento\Framework\HTTP\ZendClient;
use Magento\Framework\HTTP\ZendClientFactory;
use Magento\Framework\Locale\ResolverInterface;
use Magento\Framework\Module\Dir\Reader;
+use Magento\Framework\Stdlib\DateTime\DateTime;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use Magento\Framework\Xml\Security;
use Magento\Quote\Model\Quote\Address\RateRequest;
@@ -89,6 +91,17 @@ class CarrierTest extends \PHPUnit\Framework\TestCase
*/
private $logger;
+ /**
+ * @var DateTime|MockObject
+ */
+ private $coreDateMock;
+
+ /**
+ * @var ProductMetadataInterface
+ */
+ private $productMetadataMock;
+
+
/**
* @inheritdoc
*/
@@ -143,6 +156,20 @@ protected function setUp()
$this->logger = $this->getMockForAbstractClass(LoggerInterface::class);
+ $this->coreDateMock = $this->getMockBuilder(DateTime::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->coreDateMock->method('date')
+ ->willReturn('currentTime');
+
+ $this->productMetadataMock = $this->getMockBuilder(ProductMetadataInterface::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->productMetadataMock->method('getName')
+ ->willReturn('Software_Product_Name_30_Char_123456789');
+ $this->productMetadataMock->method('getVersion')
+ ->willReturn('10Char_Ver123456789');
+
$this->model = $this->objectManager->getObject(
Carrier::class,
[
@@ -160,6 +187,8 @@ protected function setUp()
'carrierHelper' => $carrierHelper,
'data' => ['id' => 'dhl', 'store' => '1'],
'xmlValidator' => $this->xmlValidator,
+ 'coreDate' => $this->coreDateMock,
+ 'productMetadata' => $this->productMetadataMock
]
);
}
@@ -308,11 +337,26 @@ public function testCollectRatesFail()
/**
* Test request to shipment sends valid xml values.
+ *
+ * @param string $origCountryId
+ * @param string $expectedRegionCode
+ * @dataProvider requestToShipmentDataProvider
*/
- public function testRequestToShipment()
+ public function testRequestToShipment(string $origCountryId, string $expectedRegionCode)
{
+ $expectedRequestXml = file_get_contents(__DIR__ . '/_files/shipment_request.xml');
+ $scopeConfigValueMap = [
+ ['carriers/dhl/account', 'store', null, '1234567890'],
+ ['carriers/dhl/gateway_url', 'store', null, 'https://xmlpi-ea.dhl.com/XMLShippingServlet'],
+ ['carriers/dhl/id', 'store', null, 'some ID'],
+ ['carriers/dhl/password', 'store', null, 'some password'],
+ ['carriers/dhl/content_type', 'store', null, 'N'],
+ ['carriers/dhl/nondoc_methods', 'store', null, '1,3,4,8,P,Q,E,F,H,J,M,V,Y'],
+ ['shipping/origin/country_id', 'store', null, $origCountryId],
+ ];
+
$this->scope->method('getValue')
- ->willReturnCallback([$this, 'scopeConfigGetValue']);
+ ->willReturnMap($scopeConfigValueMap);
$this->httpResponse->method('getBody')
->willReturn(utf8_encode(file_get_contents(__DIR__ . '/_files/response_shipping_label.xml')));
@@ -352,7 +396,7 @@ public function testRequestToShipment()
$this->request->method('getPackages')
->willReturn($packages);
$this->request->method('getOrigCountryId')
- ->willReturn('GB');
+ ->willReturn($origCountryId);
$this->request->method('setPackages')
->willReturnSelf();
$this->request->method('setPackageWeight')
@@ -382,7 +426,17 @@ public function testRequestToShipment()
$rawPostData->setAccessible(true);
$this->assertNotNull($result);
- $this->assertContains('0.454 ', $rawPostData->getValue($this->httpClient));
+ $requestXml = $rawPostData->getValue($this->httpClient);
+ $requestElement = new Element($requestXml);
+ $this->assertEquals($expectedRegionCode, $requestElement->RegionCode->__toString());
+ $requestElement->RegionCode = 'Checked';
+ $messageReference = $requestElement->Request->ServiceHeader->MessageReference->__toString();
+ $this->assertStringStartsWith('MAGE_SHIP_', $messageReference);
+ $this->assertGreaterThanOrEqual(28, strlen($messageReference));
+ $this->assertLessThanOrEqual(32, strlen($messageReference));
+ $requestElement->Request->ServiceHeader->MessageReference = 'MAGE_SHIP_CHECKED';
+ $expectedRequestElement = new Element($expectedRequestXml);
+ $this->assertXmlStringEqualsXmlString($expectedRequestElement->asXML(), $requestElement->asXML());
}
/**
@@ -394,86 +448,14 @@ public function requestToShipmentDataProvider()
{
return [
[
- 'GB'
+ 'GB', 'EU'
],
[
- null
+ 'SG', 'AP'
]
];
}
- /**
- * Test that shipping label request for origin country from AP region doesn't contain restricted fields.
- *
- * @return void
- */
- public function testShippingLabelRequestForAsiaPacificRegion()
- {
- $this->scope->method('getValue')
- ->willReturnMap(
- [
- ['shipping/origin/country_id', ScopeInterface::SCOPE_STORE, null, 'SG'],
- ['carriers/dhl/gateway_url', ScopeInterface::SCOPE_STORE, null, 'https://xmlpi-ea.dhl.com'],
- ]
- );
-
- $this->httpResponse->method('getBody')
- ->willReturn(utf8_encode(file_get_contents(__DIR__ . '/_files/response_shipping_label.xml')));
-
- $packages = [
- 'package' => [
- 'params' => [
- 'width' => '1',
- 'length' => '1',
- 'height' => '1',
- 'dimension_units' => 'INCH',
- 'weight_units' => 'POUND',
- 'weight' => '0.45',
- 'customs_value' => '10.00',
- 'container' => Carrier::DHL_CONTENT_TYPE_NON_DOC,
- ],
- 'items' => [
- 'item1' => [
- 'name' => 'item_name',
- ],
- ],
- ],
- ];
-
- $this->request->method('getPackages')->willReturn($packages);
- $this->request->method('getOrigCountryId')->willReturn('SG');
- $this->request->method('setPackages')->willReturnSelf();
- $this->request->method('setPackageWeight')->willReturnSelf();
- $this->request->method('setPackageValue')->willReturnSelf();
- $this->request->method('setValueWithDiscount')->willReturnSelf();
- $this->request->method('setPackageCustomsValue')->willReturnSelf();
-
- $result = $this->model->requestToShipment($this->request);
-
- $reflectionClass = new \ReflectionObject($this->httpClient);
- $rawPostData = $reflectionClass->getProperty('raw_post_data');
- $rawPostData->setAccessible(true);
-
- $this->assertNotNull($result);
- $requestXml = $rawPostData->getValue($this->httpClient);
-
- $this->assertNotContains(
- 'NewShipper',
- $requestXml,
- 'NewShipper is restricted field for AP region'
- );
- $this->assertNotContains(
- 'Division',
- $requestXml,
- 'Division is restricted field for AP region'
- );
- $this->assertNotContains(
- 'RegisteredAccount',
- $requestXml,
- 'RegisteredAccount is restricted field for AP region'
- );
- }
-
/**
* @dataProvider dhlProductsDataProvider
*
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml b/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml
index 3f28111f229d1..792465ce45942 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml
+++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml
@@ -1,4 +1,4 @@
-
+
+
+
+
+ 2018-02-27T12:59:34+01:00
+ tracking_4781585060
+ CustomerSiteID
+
+
+
+ 4781585060
+
+ No Shipments Found
+
+ 209
+ No Shipments Found for AWBNumber 6017300993
+
+
+
+ String
+
+
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/_files/Track-res-XML-Parse-Err.xml b/dev/tests/integration/testsuite/Magento/Dhl/_files/Track-res-XML-Parse-Err.xml
new file mode 100755
index 0000000000000..c2abd68d3c4ae
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Dhl/_files/Track-res-XML-Parse-Err.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+ 2018-02-27T12:55:05+01:00
+
+
+ Failure
+
+ 111
+ Error Parsing incoming request XML
+ Error: The content of element type
+ "ShipperReference" must match
+ "(ReferenceID,ReferenceType?)". at line
+ 16, column 22
+
+
+
+
+
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_MultipleAWB.xml b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_MultipleAWB.xml
new file mode 100755
index 0000000000000..f3aa662cd68fd
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_MultipleAWB.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+ 2002-06-25T11:28:56-08:00
+ MAGE_TRCK_CHECKED
+ CustomerSiteID
+ CustomerPassword
+
+
+ en
+ 4781584780
+ 4781585060
+ 5702254250
+ ALL_CHECK_POINTS
+
+
+
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_SingleAWB.xml b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_SingleAWB.xml
new file mode 100755
index 0000000000000..b45988249f665
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_SingleAWB.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+ 2002-06-25T11:28:56-08:00
+ MAGE_TRCK_CHECKED
+ CustomerSiteID
+ CustomerPassword
+
+
+ en
+ 4781585060
+ ALL_CHECK_POINTS
+
\ No newline at end of file
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_MultipleAWB.xml b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_MultipleAWB.xml
new file mode 100755
index 0000000000000..8375eaea1770d
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_MultipleAWB.xml
@@ -0,0 +1,174 @@
+
+
+
+
+
+ 2018-02-27T12:43:44+01:00
+ TrackingRequest_Multiple_AWB
+ CustomerSiteID
+
+
+
+ 4781584780
+
+ success
+
+
+
+ PEK
+ BEIJING-CHN
+
+
+ PHL
+ WEST PHILADELPHIA,PA-USA
+
+ THE EXP HIGH SCH ATT TO BNU
+ 123456789
+ HAVEFORD COLLEGE
+ 2017-12-25T14:38:00
+ 1
+ 0.5
+ K
+ D
+ DOCUMENT
+ Y
+
+ BEIJING
+ 100032
+ CN
+
+
+ HAVERFORD
+ PA
+ 19041
+ US
+
+
+ 2469
+
+
+ 2017-12-25
+ 14:38:00
+
+ SD
+ Shipment information received
+
+
+
+ PEK
+ BEIJING-CHN
+
+
+
+
+
+ 4781585060
+
+ success
+
+
+
+ HKG
+ HONG KONG-HKG
+
+
+ HKG
+ HONG KONG-HKG
+
+ NET-A-PORTER
+ 123456789
+ NICOLE LI
+ 2017-12-24T13:35:00
+ 1
+ 2.0
+ K
+ N
+ NOT RESTRICTED FOR TRANSPORT,
+ Y
+
+ HONG KONG
+ HK
+
+
+ HONG KONG
+ CH
+ HK
+
+
+ 1060571
+
+
+ 2017-12-24
+ 13:35:00
+
+ SD
+ Shipment information received
+
+
+
+ HKG
+ HONG KONG-HKG
+
+
+
+
+
+ 5702254250
+
+ success
+
+
+
+ BHX
+ BIRMINGHAM-GBR
+
+
+ AOI
+ ANCONA-ITA
+
+ AMAZON EU SARL
+ 123456789
+ MATTEO LOMBO
+ 2017-12-24T04:12:00
+ 1
+ 0.12
+ K
+ U
+ CD
+ Y
+
+ PETERBOROUGH
+ PE2 9EN
+ GB
+
+
+ ORTONA
+ 66026
+ IT
+
+
+ DGWYDy4xN_1
+
+
+ 2017-12-24
+ 04:12:00
+
+ SD
+ Shipment information received
+
+
+
+ BHX
+ BIRMINGHAM-GBR
+
+
+
+
+ en
+
+
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_SingleAWB.xml b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_SingleAWB.xml
new file mode 100755
index 0000000000000..ffa4982183851
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_SingleAWB.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+ 2018-02-27T12:27:42+01:00
+ tracking_4781585060
+ CustomerSiteID
+
+
+
+ 4781585060
+
+ success
+
+
+
+ HKG
+ HONG KONG-HKG
+
+
+ HKG
+ HONG KONG-HKG
+
+ NET-A-PORTER
+ 123456789
+ NICOLE LI
+ 2017-12-24T13:35:00
+ 1
+ 2.0
+ K
+ N
+ NOT RESTRICTED FOR TRANSPORT,
+ Y
+
+ HONG KONG
+ HK
+
+
+ HONG KONG
+ CH
+ HK
+
+
+ 1060571
+
+
+ 2017-12-24
+ 13:35:00
+
+ SD
+ Shipment information received
+
+
+
+ HKG
+ HONG KONG-HKG
+
+
+
+
+ en
+
+
From 84036d5e1738d15f436818e23119057c862abcee Mon Sep 17 00:00:00 2001
From: Joan He
Date: Fri, 18 Jan 2019 13:39:14 -0600
Subject: [PATCH 074/121] MC-6297: Update KnownTrackingRequest
- address review comments
---
.../integration/testsuite/Magento/Dhl/Model/CarrierTest.php | 2 +-
.../Dhl/_files/SingleknownTrackResponse-no-data-found.xml | 2 +-
.../Magento/Dhl/_files/TrackingRequest_MultipleAWB.xml | 2 +-
.../testsuite/Magento/Dhl/_files/TrackingRequest_SingleAWB.xml | 2 +-
.../Magento/Dhl/_files/TrackingResponse_MultipleAWB.xml | 2 +-
.../testsuite/Magento/Dhl/_files/TrackingResponse_SingleAWB.xml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php b/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php
index d5f3c30c17397..8874d880a4dd1 100644
--- a/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php
+++ b/dev/tests/integration/testsuite/Magento/Dhl/Model/CarrierTest.php
@@ -216,7 +216,7 @@ private function assertRequest(string $expectedRequestXml, string $requestXml):
$this->assertStringStartsWith('MAGE_TRCK_', $messageReference);
$this->assertGreaterThanOrEqual(28, strlen($messageReference));
$this->assertLessThanOrEqual(32, strlen($messageReference));
- $requestElement->Request->ServiceHeader->MessageReference = 'MAGE_TRCK_CHECKED';
+ $requestElement->Request->ServiceHeader->MessageReference = 'MAGE_TRCK_28TO32_Char_CHECKED';
$this->assertXmlStringEqualsXmlString($expectedRequestElement->asXML(), $requestElement->asXML());
}
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/_files/SingleknownTrackResponse-no-data-found.xml b/dev/tests/integration/testsuite/Magento/Dhl/_files/SingleknownTrackResponse-no-data-found.xml
index e3e7b93fc652b..9887cecbd2d4e 100755
--- a/dev/tests/integration/testsuite/Magento/Dhl/_files/SingleknownTrackResponse-no-data-found.xml
+++ b/dev/tests/integration/testsuite/Magento/Dhl/_files/SingleknownTrackResponse-no-data-found.xml
@@ -9,7 +9,7 @@
2018-02-27T12:59:34+01:00
- tracking_4781585060
+ 1234567890123456789012345678
CustomerSiteID
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_MultipleAWB.xml b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_MultipleAWB.xml
index f3aa662cd68fd..c0a18fcc4e2f6 100755
--- a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_MultipleAWB.xml
+++ b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_MultipleAWB.xml
@@ -9,7 +9,7 @@
2002-06-25T11:28:56-08:00
- MAGE_TRCK_CHECKED
+ MAGE_TRCK_28TO32_Char_CHECKED
CustomerSiteID
CustomerPassword
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_SingleAWB.xml b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_SingleAWB.xml
index b45988249f665..dac69a0d68c57 100755
--- a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_SingleAWB.xml
+++ b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingRequest_SingleAWB.xml
@@ -9,7 +9,7 @@
2002-06-25T11:28:56-08:00
- MAGE_TRCK_CHECKED
+ MAGE_TRCK_28TO32_Char_CHECKED
CustomerSiteID
CustomerPassword
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_MultipleAWB.xml b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_MultipleAWB.xml
index 8375eaea1770d..369236d80c614 100755
--- a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_MultipleAWB.xml
+++ b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_MultipleAWB.xml
@@ -9,7 +9,7 @@
2018-02-27T12:43:44+01:00
- TrackingRequest_Multiple_AWB
+ 1234567890123456789012345678
CustomerSiteID
diff --git a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_SingleAWB.xml b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_SingleAWB.xml
index ffa4982183851..ef303eaab64f7 100755
--- a/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_SingleAWB.xml
+++ b/dev/tests/integration/testsuite/Magento/Dhl/_files/TrackingResponse_SingleAWB.xml
@@ -9,7 +9,7 @@
2018-02-27T12:27:42+01:00
- tracking_4781585060
+ 1234567890123456789012345678
CustomerSiteID
From 5a63e6f2049d9056d89173cb2d457095f78c67f5 Mon Sep 17 00:00:00 2001
From: Joan He
Date: Fri, 18 Jan 2019 13:57:33 -0600
Subject: [PATCH 075/121] MC-6295: Update ShipmentValidationRequest
- address review comments
---
app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php | 2 +-
.../Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
index 82eb379d75be0..835ef4bf1fe28 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
@@ -434,7 +434,7 @@ public function testRequestToShipment(string $origCountryId, string $expectedReg
$this->assertStringStartsWith('MAGE_SHIP_', $messageReference);
$this->assertGreaterThanOrEqual(28, strlen($messageReference));
$this->assertLessThanOrEqual(32, strlen($messageReference));
- $requestElement->Request->ServiceHeader->MessageReference = 'MAGE_SHIP_CHECKED';
+ $requestElement->Request->ServiceHeader->MessageReference = 'MAGE_SHIP_28TO32_Char_CHECKED';
$expectedRequestElement = new Element($expectedRequestXml);
$this->assertXmlStringEqualsXmlString($expectedRequestElement->asXML(), $requestElement->asXML());
}
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml b/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml
index 7a87046b87b76..896d631f01d50 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml
+++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml
@@ -4,7 +4,7 @@
currentTime
- MAGE_SHIP_CHECKED
+ MAGE_SHIP_28TO32_Char_CHECKED
some ID
some password
From a0ad012e145876395a3277dde9702d247e070078 Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Fri, 18 Jan 2019 15:56:01 -0600
Subject: [PATCH 076/121] MC-6296: Update DCTRequest
Updated unit tests to use data providers
---
.../Dhl/Test/Unit/Model/CarrierTest.php | 132 +++++++++---------
1 file changed, 69 insertions(+), 63 deletions(-)
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
index d9eb6e04bb4da..bb402d3ebbc84 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
@@ -283,6 +283,11 @@ public function testCollectRates()
$this->httpResponse->method('getBody')
->willReturn($responseXml);
+ $this->coreDateMock->method('date')
+ ->willReturnCallback(function () {
+ return date(\DATE_RFC3339);
+ });
+
$request = $this->objectManager->getObject(RateRequest::class, $requestData);
$reflectionClass = new \ReflectionObject($this->httpClient);
@@ -516,68 +521,104 @@ public function dhlProductsDataProvider() : array
}
/**
- * Tests that the built message reference string is of the appropriate format.
+ * Tests that the built MessageReference string is of the appropriate format.
*
- * @expectedException \Magento\Framework\Exception\LocalizedException
- * @expectedExceptionMessage Invalid service prefix
+ * @dataProvider buildMessageReferenceDataProvider
+ * @param $servicePrefix
* @throws \ReflectionException
*/
- public function testBuildMessageReference()
+ public function testBuildMessageReference($servicePrefix)
{
$method = new \ReflectionMethod($this->model, 'buildMessageReference');
$method->setAccessible(true);
- $constPrefixQuote = new \ReflectionClassConstant($this->model, 'SERVICE_PREFIX_QUOTE');
- $constPrefixShipval = new \ReflectionClassConstant($this->model, 'SERVICE_PREFIX_SHIPVAL');
- $constPrefixTracking = new \ReflectionClassConstant($this->model, 'SERVICE_PREFIX_TRACKING');
-
- $msgRefQuote = $method->invoke($this->model, $constPrefixQuote->getValue());
- self::assertGreaterThanOrEqual(28, strlen($msgRefQuote));
- self::assertLessThanOrEqual(32, strlen($msgRefQuote));
+ $messageReference = $method->invoke($this->model, $servicePrefix);
+ $this->assertGreaterThanOrEqual(28, strlen($messageReference));
+ $this->assertLessThanOrEqual(32, strlen($messageReference));
+ }
- $msgRefShip = $method->invoke($this->model, $constPrefixShipval->getValue());
- self::assertGreaterThanOrEqual(28, strlen($msgRefShip));
- self::assertLessThanOrEqual(32, strlen($msgRefShip));
+ /**
+ * @return array
+ */
+ public function buildMessageReferenceDataProvider()
+ {
+ return [
+ 'quote_prefix' => ['QUOT'],
+ 'shipval_prefix' => ['SHIP'],
+ 'tracking_prefix' => ['TRCK']
+ ];
+ }
- $msgRefTrack = $method->invoke($this->model, $constPrefixTracking->getValue());
- self::assertGreaterThanOrEqual(28, strlen($msgRefTrack));
- self::assertLessThanOrEqual(32, strlen($msgRefTrack));
+ /**
+ * Tests that an exception is thrown when an invalid service prefix is provided.
+ *
+ * @expectedException \Magento\Framework\Exception\LocalizedException
+ * @expectedExceptionMessage Invalid service prefix
+ */
+ public function testBuildMessageReferenceInvalidPrefix()
+ {
+ $method = new \ReflectionMethod($this->model, 'buildMessageReference');
+ $method->setAccessible(true);
- $method->invoke($this->model, 'TEST');
+ $method->invoke($this->model, 'INVALID');
}
/**
* Tests that the built software name string is of the appropriate format.
*
+ * @dataProvider buildSoftwareNameDataProvider
+ * @param $productName
* @throws \ReflectionException
*/
- public function testBuildSoftwareName()
+ public function testBuildSoftwareName($productName)
{
$method = new \ReflectionMethod($this->model, 'buildSoftwareName');
$method->setAccessible(true);
- $name = $method->invoke($this->model);
- self::assertLessThanOrEqual(30, $name);
+ $this->productMetadataMock->method('getName')->willReturn($productName);
- $nameExceedsLength = $method->invoke($this->model);
- self::assertLessThanOrEqual(30, $nameExceedsLength);
+ $softwareName = $method->invoke($this->model);
+ $this->assertLessThanOrEqual(30, strlen($softwareName));
+ }
+
+ /**
+ * @return array
+ */
+ public function buildSoftwareNameDataProvider()
+ {
+ return [
+ 'valid_length' => ['Magento'],
+ 'exceeds_length' => ['Product_Name_Longer_Than_30_Char']
+ ];
}
/**
* Tests that the built software version string is of the appropriate format.
*
+ * @dataProvider buildSoftwareVersionProvider
+ * @param $productVersion
* @throws \ReflectionException
*/
- public function testBuildSoftwareVersion()
+ public function testBuildSoftwareVersion($productVersion)
{
$method = new \ReflectionMethod($this->model, 'buildSoftwareVersion');
$method->setAccessible(true);
- $version = $method->invoke($this->model);
- self::assertLessThanOrEqual(10, strlen($version));
+ $this->productMetadataMock->method('getVersion')->willReturn($productVersion);
- $versionExceedsLength = $method->invoke($this->model);
- self::assertLessThanOrEqual(10, strlen($versionExceedsLength));
+ $softwareVersion = $method->invoke($this->model);
+ $this->assertLessThanOrEqual(10, strlen($softwareVersion));
+ }
+
+ /**
+ * @return array
+ */
+ public function buildSoftwareVersionProvider()
+ {
+ return [
+ 'valid_length' => ['2.3.1'],
+ 'exceeds_length' => ['dev-MC-1000']
+ ];
}
/**
@@ -725,21 +766,6 @@ private function getCarrierHelper(): CarrierHelper
return $carrierHelper;
}
- /**
- * @return MockObject
- */
- private function getCoreDate(): MockObject
- {
- $coreDate = $this->getMockBuilder(\Magento\Framework\Stdlib\DateTime\DateTime::class)
- ->disableOriginalConstructor()
- ->getMock();
- $coreDate->method('date')->willReturnCallback(function () {
- return date(\DATE_RFC3339);
- });
-
- return $coreDate;
- }
-
/**
* @return MockObject
*/
@@ -762,24 +788,4 @@ private function getHttpClientFactory(): MockObject
return $httpClientFactory;
}
-
- /**
- * @return MockObject
- */
- private function getProductMetadata(): MockObject
- {
- $productMetadata = $this->createMock(\Magento\Framework\App\ProductMetadata::class);
-
- $productMetadata->method('getName')->willReturnOnConsecutiveCalls(
- 'Magento',
- str_pad('Magento', 24, '_')
- );
-
- $productMetadata->method('getVersion')->willReturnOnConsecutiveCalls(
- '2.3.1',
- 'dev-MC-1000'
- );
-
- return $productMetadata;
- }
}
From a1db46b66b3fd1ecae85fa9a97288d244782ce45 Mon Sep 17 00:00:00 2001
From: Yashwant 2jcommerce
Date: Mon, 21 Jan 2019 13:21:34 +0530
Subject: [PATCH 077/121] checkout-page-shipping-title::Shipping method title
overlapping on edit icon in mobile view on Checkout page
---
.../module/checkout/_sidebar-shipping-information.less | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_sidebar-shipping-information.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_sidebar-shipping-information.less
index b54c0a264a03a..0f2a7abcbaa18 100644
--- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_sidebar-shipping-information.less
+++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_sidebar-shipping-information.less
@@ -67,3 +67,11 @@
}
}
}
+
+.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__s) {
+ .opc-block-shipping-information {
+ .shipping-information-title {
+ font-size: 2.3rem;
+ }
+ }
+}
From 927b1b42922f5523ab146808768bafd7ce7b02a4 Mon Sep 17 00:00:00 2001
From: Yuliya Labudova
Date: Mon, 21 Jan 2019 15:00:49 +0300
Subject: [PATCH 078/121] MC-10934: Tests failures
CreationScheduledUpdateForStagingDashboardTest and
StorefrontPurchaseProductWithCustomOptions
- Fix MFTF tests.
---
.../Test/StorefrontPurchaseProductWithCustomOptionsTest.xml | 2 --
1 file changed, 2 deletions(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml
index d96399738c80a..951afa2ddb68b 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml
@@ -17,8 +17,6 @@
-
-
From d1cb6934d72123c40a83e9fce99d6ce246ca826c Mon Sep 17 00:00:00 2001
From: Yuliya Labudova
Date: Mon, 21 Jan 2019 16:14:53 +0300
Subject: [PATCH 079/121] MC-10934: Test failure
StorefrontPurchaseProductWithCustomOptions
- Fix mftf test.
---
.../Test/StorefrontPurchaseProductWithCustomOptionsTest.xml | 2 --
1 file changed, 2 deletions(-)
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml
index d96399738c80a..951afa2ddb68b 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontPurchaseProductWithCustomOptionsTest.xml
@@ -17,8 +17,6 @@
-
-
From a53a63e4631cf87570dd6fcef8045a67d5bc7c36 Mon Sep 17 00:00:00 2001
From: Yaroslav Rogoza
Date: Mon, 21 Jan 2019 16:04:06 +0100
Subject: [PATCH 080/121] API-functional tests added
---
.../Magento/GraphQl/Quote/GetCartTest.php | 171 ++++++++++++++++++
.../Magento/Checkout/_files/active_quote.php | 8 +
2 files changed, 179 insertions(+)
create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
new file mode 100644
index 0000000000000..2cd100fc0f758
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
@@ -0,0 +1,171 @@
+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 testGetOwnCartForRegisteredCustomer()
+ {
+ $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']['addresses']);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/quote_with_items_saved.php
+ */
+ public function testGetCartFromAnotherCustomer()
+ {
+ $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);
+
+ self::expectExceptionMessage("The current user cannot perform operations on cart \"$maskedQuoteId\"");
+
+ $this->graphQlQuery($query);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
+ */
+ public function testGetCartForGuest()
+ {
+ $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);
+ }
+
+ public function testGetNonExistentCart()
+ {
+ $maskedQuoteId = 'non_existent_masked_id';
+ $query = $this->prepareGetCartQuery($maskedQuoteId);
+
+ self::expectExceptionMessage("Could not find a cart with ID \"$maskedQuoteId\"");
+
+ $this->graphQlQuery($query);
+ }
+
+ /**
+ * 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);
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php
index 2d948ebeb0128..6b569f37a1a9f 100644
--- a/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php
+++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php
@@ -9,3 +9,11 @@
->setIsMultiShipping(false)
->setReservedOrderId('test_order_1')
->save();
+
+/** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */
+$quoteIdMask = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create(\Magento\Quote\Model\QuoteIdMaskFactory::class)
+ ->create();
+$quoteIdMask->setQuoteId($quote->getId());
+$quoteIdMask->setDataChanges(true);
+$quoteIdMask->save();
\ No newline at end of file
From c33a84d6d10e04aaa94d0c8e83d07a92fc484cbb Mon Sep 17 00:00:00 2001
From: Parag Chavare
Date: Tue, 22 Jan 2019 17:49:41 +0530
Subject: [PATCH 081/121]
Fixed-Product-page-tabbing-content-misalignment-in-mobile-view :: Product
Page tabbing Content Misaligned in mobile view
---
.../Magento/blank/web/css/source/_sections.less | 8 ++++++++
.../Magento/luma/web/css/source/_sections.less | 13 +++++++++++++
2 files changed, 21 insertions(+)
diff --git a/app/design/frontend/Magento/blank/web/css/source/_sections.less b/app/design/frontend/Magento/blank/web/css/source/_sections.less
index f0a3518c92a8b..25f8c71f22dd5 100644
--- a/app/design/frontend/Magento/blank/web/css/source/_sections.less
+++ b/app/design/frontend/Magento/blank/web/css/source/_sections.less
@@ -34,5 +34,13 @@
.data.item {
display: block;
}
+ .item.title {
+ >.switch{
+ padding: 1px 15px 1px;
+ }
+ }
+ >.item.content{
+ padding: 10px 15px 30px;
+ }
}
}
diff --git a/app/design/frontend/Magento/luma/web/css/source/_sections.less b/app/design/frontend/Magento/luma/web/css/source/_sections.less
index 73665fd22da23..38b936c83cb95 100644
--- a/app/design/frontend/Magento/luma/web/css/source/_sections.less
+++ b/app/design/frontend/Magento/luma/web/css/source/_sections.less
@@ -75,3 +75,16 @@
}
}
}
+
+.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
+ .product.data.items{
+ .item.title {
+ >.switch{
+ padding: 1px 15px 1px;
+ }
+ }
+ >.item.content{
+ padding: 10px 15px 30px;
+ }
+ }
+}
From 512591378c7201c173b5750d95a5971c038c86f1 Mon Sep 17 00:00:00 2001
From: Joan He
Date: Tue, 22 Jan 2019 09:32:13 -0600
Subject: [PATCH 082/121] MC-6295: Update ShipmentValidationRequest
- address review comments
---
app/code/Magento/Dhl/Model/Carrier.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php
index accdd3902529f..eda7aee826487 100644
--- a/app/code/Magento/Dhl/Model/Carrier.php
+++ b/app/code/Magento/Dhl/Model/Carrier.php
@@ -1434,8 +1434,8 @@ protected function _doRequest()
$nodeServiceHeader->addChild('Password', (string)$this->getConfigData('password'));
$nodeMetaData = $nodeRequest->addChild('MetaData');
- $nodeMetaData->addChild('SoftwareName', $this->productMetadata->getName());
- $nodeMetaData->addChild('SoftwareVersion', $this->productMetadata->getVersion());
+ $nodeMetaData->addChild('SoftwareName', $this->buildSoftwareName());
+ $nodeMetaData->addChild('SoftwareVersion', $this->buildSoftwareVersion());
$originRegion = $this->getCountryParams(
$this->_scopeConfig->getValue(
From ad74fba18416c519c42898c8195d876b7ca05073 Mon Sep 17 00:00:00 2001
From: Joan He
Date: Tue, 22 Jan 2019 11:25:04 -0600
Subject: [PATCH 083/121] MC-4245: Upgrade DHL schema to the latest
- fixed static test failures
---
app/code/Magento/Dhl/Model/Carrier.php | 1 +
app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php | 1 -
.../Dhl/Test/Unit/Model/_files/dhl_quote_response_rates.php | 2 +-
.../Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml | 6 ++++++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php
index eda7aee826487..685831138831c 100644
--- a/app/code/Magento/Dhl/Model/Carrier.php
+++ b/app/code/Magento/Dhl/Model/Carrier.php
@@ -1609,6 +1609,7 @@ protected function _doRequest()
* @return void
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _shipmentDetails($xml, $rawRequest, $originRegion = '')
{
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
index 0eb95b14d9727..ac458024fb65c 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php
@@ -101,7 +101,6 @@ class CarrierTest extends \PHPUnit\Framework\TestCase
*/
private $productMetadataMock;
-
/**
* @inheritdoc
*/
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response_rates.php b/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response_rates.php
index e623b5944ce7c..ddd7b2e4f97c5 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response_rates.php
+++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/dhl_quote_response_rates.php
@@ -28,4 +28,4 @@
'cost' => 35.26,
'method' => 'P'
]
-];
\ No newline at end of file
+];
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml b/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml
index 896d631f01d50..e93753368f834 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml
+++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml
@@ -1,4 +1,10 @@
+
From 547b80b9ba59a127744a6b2e58f7b2efbdff2720 Mon Sep 17 00:00:00 2001
From: Ranee 2Jcommerce
Date: Wed, 23 Jan 2019 11:23:42 +0530
Subject: [PATCH 084/121] tooltip-dropdown-pointer :: Tooltip dropdown pointer
not proper on tablet
---
.../css/source/module/checkout/_tooltip.less | 27 +++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less
index bf264a98f33b8..e42d8eb7a8dd7 100644
--- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less
+++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less
@@ -147,3 +147,30 @@
}
}
}
+
+//
+// Tablet
+// _____________________________________________
+@media only screen and (max-width: @screen__m) {
+ .field-tooltip .field-tooltip-content {
+ right: -10px;
+ top: 40px;
+ left: auto;
+ }
+ .field-tooltip .field-tooltip-content::before, .field-tooltip .field-tooltip-content::after {
+ border: 10px solid transparent;
+ height: 0;
+ width: 0;
+ margin-top: -21px;
+ right: 10px;
+ left: auto;
+ top: 0;
+ }
+ .field-tooltip .field-tooltip-content::before {
+ border-bottom-color: #666;
+ }
+ .field-tooltip .field-tooltip-content::after {
+ border-bottom-color: #f4f4f4;
+ top: 1px;
+ }
+}
\ No newline at end of file
From 6bac940657d1a8b428f85f7ae2e09f40bd97379a Mon Sep 17 00:00:00 2001
From: Oksana_Kremen
Date: Wed, 23 Jan 2019 18:41:26 +0200
Subject: [PATCH 085/121] MAGETWO-96406: [2.3.x] Swatch Attribute is not
displayed in the Widget CMS
- Fixes for static tests and automation test
---
.../view/frontend/layout/catalog_widget_product_list.xml | 2 +-
.../Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml | 1 -
app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml | 1 -
3 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/code/Magento/CatalogWidget/view/frontend/layout/catalog_widget_product_list.xml b/app/code/Magento/CatalogWidget/view/frontend/layout/catalog_widget_product_list.xml
index 9a6d704ecce9b..db44d8b62dc1a 100644
--- a/app/code/Magento/CatalogWidget/view/frontend/layout/catalog_widget_product_list.xml
+++ b/app/code/Magento/CatalogWidget/view/frontend/layout/catalog_widget_product_list.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml
index 7c8694a247dee..a4b88c544de88 100644
--- a/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml
+++ b/app/code/Magento/Cms/Test/Mftf/ActionGroup/CreateNewPageWithWidgetActionGroup.xml
@@ -30,7 +30,6 @@
-
diff --git a/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml b/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml
index 101e694d75f55..c7ea85e441bb9 100644
--- a/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Section/TinyMCESection.xml
@@ -101,7 +101,6 @@
-
From fce9a9d5d8cd0db8a9aa8410ffdc607b75c59188 Mon Sep 17 00:00:00 2001
From: ajay-2jcommerce
Date: Thu, 24 Jan 2019 19:04:31 +0530
Subject: [PATCH 086/121] Time-fields-misaligned-in-iPad-landscape-view ::Time
fields misaligned in iPad landscape view (1024 x 768)
---
.../web/css/source/module/main/_collapsible-blocks.less | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less
index 6420738c6fb9b..b12b4a71d5ce6 100644
--- a/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less
+++ b/app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/main/_collapsible-blocks.less
@@ -322,7 +322,7 @@
}
.value {
- padding-right: 4rem;
+ padding-right: 2rem;
}
}
From 149d9e12a12e8da0bc3066e6e97e72f66adf497c Mon Sep 17 00:00:00 2001
From: Pavel Bystritsky
Date: Thu, 24 Jan 2019 13:13:38 +0200
Subject: [PATCH 087/121] magento/magento2#14849: Nullable status code fix.
---
app/code/Magento/Sales/Model/Order/Config.php | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/app/code/Magento/Sales/Model/Order/Config.php b/app/code/Magento/Sales/Model/Order/Config.php
index 70cf8c181cf95..1b31caa573f99 100644
--- a/app/code/Magento/Sales/Model/Order/Config.php
+++ b/app/code/Magento/Sales/Model/Order/Config.php
@@ -109,7 +109,7 @@ protected function _getState($state)
* @param string $state
* @return string|null
*/
- public function getStateDefaultStatus($state)
+ public function getStateDefaultStatus($state): ?string
{
$status = false;
$stateNode = $this->_getState($state);
@@ -123,11 +123,11 @@ public function getStateDefaultStatus($state)
/**
* Get status label for a specified area
*
- * @param string $code
+ * @param string|null $code
* @param string $area
- * @return string
+ * @return string|null
*/
- private function getStatusLabelForArea(string $code, string $area): string
+ private function getStatusLabelForArea(?string $code, string $area): ?string
{
$code = $this->maskStatusForArea($area, $code);
$status = $this->orderStatusFactory->create()->load($code);
@@ -142,8 +142,8 @@ private function getStatusLabelForArea(string $code, string $area): string
/**
* Retrieve status label for detected area
*
- * @param string $code
- * @return string
+ * @param string|null $code
+ * @return string|null
* @throws LocalizedException
*/
public function getStatusLabel($code)
@@ -155,10 +155,10 @@ public function getStatusLabel($code)
/**
* Retrieve status label for area
*
- * @param string $code
- * @return string
+ * @param string|null $code
+ * @return string|null
*/
- public function getStatusFrontendLabel(string $code): string
+ public function getStatusFrontendLabel(?string $code): ?string
{
return $this->getStatusLabelForArea($code, \Magento\Framework\App\Area::AREA_FRONTEND);
}
From 12deeebc95e467bcc628bb39d2d8ec753ec20b85 Mon Sep 17 00:00:00 2001
From: Govind Sharma
Date: Sat, 26 Jan 2019 21:09:19 +0530
Subject: [PATCH 088/121] Fixed Issue #20631
---
.../Magento/Ui/view/base/web/js/form/element/post-code.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
index 911574a0fb438..5bfba724dfbe8 100644
--- a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
@@ -26,14 +26,17 @@ define([
update: function (value) {
var country = registry.get(this.parentName + '.' + 'country_id'),
options = country.indexedOptions,
- option;
+ option = null;
if (!value) {
return;
}
option = options[value];
-
+ if (!option) {
+ return;
+ }
+
if (option['is_zipcode_optional']) {
this.error(false);
this.validation = _.omit(this.validation, 'required-entry');
From d6dad52746402ad2fbe9713865a0709cafcaec3b Mon Sep 17 00:00:00 2001
From: Dominic
Date: Sun, 27 Jan 2019 22:36:06 +0530
Subject: [PATCH 089/121] reove hardcoded value
---
.../Model/ConfigurableProductTypeResolver.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php b/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php
index aae39800cdd30..e4e1c6aab6922 100644
--- a/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php
+++ b/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php
@@ -8,6 +8,7 @@
namespace Magento\ConfigurableProductGraphQl\Model;
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface;
+use Magento\ConfigurableProduct\Model\Product\Type\Configurable as Type;
/**
* {@inheritdoc}
@@ -19,7 +20,7 @@ class ConfigurableProductTypeResolver implements TypeResolverInterface
*/
public function resolveType(array $data) : string
{
- if (isset($data['type_id']) && $data['type_id'] == 'configurable') {
+ if (isset($data['type_id']) && $data['type_id'] == Type::TYPE_CODE) {
return 'ConfigurableProduct';
}
return '';
From 48a63ed446ea8e2761947ed46305cdeac6406929 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stephan=20Hochd=C3=B6rfer?=
Date: Sun, 27 Jan 2019 22:57:57 +0100
Subject: [PATCH 090/121] Fix typehint
---
app/code/Magento/Quote/Model/Quote.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Quote/Model/Quote.php b/app/code/Magento/Quote/Model/Quote.php
index ecda0dd2c0d74..17d3b9205625f 100644
--- a/app/code/Magento/Quote/Model/Quote.php
+++ b/app/code/Magento/Quote/Model/Quote.php
@@ -1399,7 +1399,7 @@ public function getAllItems()
{
$items = [];
foreach ($this->getItemsCollection() as $item) {
- /** @var \Magento\Quote\Model\ResourceModel\Quote\Item $item */
+ /** @var \Magento\Quote\Model\Quote\Item $item */
if (!$item->isDeleted()) {
$items[] = $item;
}
From e78576e382e6429296ae11835ef96472e284feaf Mon Sep 17 00:00:00 2001
From: "Leandro F. L"
Date: Sun, 27 Jan 2019 21:46:01 -0200
Subject: [PATCH 091/121] It is recommended to use the &&, || operators,
instead of and, or to prevent confusion.
---
.../Adminhtml/Product/Attribute/Validate.php | 2 +-
.../Controller/Transparent/RequestSecureToken.php | 2 +-
.../Security/Model/SecurityChecker/Quantity.php | 2 +-
app/code/Magento/SendFriend/Model/SendFriend.php | 12 ++++++------
app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php | 2 +-
.../testsuite/Magento/Test/Integrity/ClassesTest.php | 2 +-
lib/internal/Magento/Framework/Filter/Template.php | 2 +-
lib/internal/Magento/Framework/Message/Manager.php | 2 +-
.../Setup/Model/ConfigOptionsList/Session.php | 2 +-
9 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php
index 381ca5d08d82a..50f58efae7127 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php
@@ -163,7 +163,7 @@ private function isUniqueAdminValues(array $optionsValues, array $deletedOptions
{
$adminValues = [];
foreach ($optionsValues as $optionKey => $values) {
- if (!(isset($deletedOptions[$optionKey]) and $deletedOptions[$optionKey] === '1')) {
+ if (!(isset($deletedOptions[$optionKey]) && $deletedOptions[$optionKey] === '1')) {
$adminValues[] = reset($values);
}
}
diff --git a/app/code/Magento/Paypal/Controller/Transparent/RequestSecureToken.php b/app/code/Magento/Paypal/Controller/Transparent/RequestSecureToken.php
index 85907c9d371ab..b63799612a24d 100644
--- a/app/code/Magento/Paypal/Controller/Transparent/RequestSecureToken.php
+++ b/app/code/Magento/Paypal/Controller/Transparent/RequestSecureToken.php
@@ -83,7 +83,7 @@ public function execute()
/** @var Quote $quote */
$quote = $this->sessionManager->getQuote();
- if (!$quote or !$quote instanceof Quote) {
+ if (!$quote || !$quote instanceof Quote) {
return $this->getErrorResponse();
}
diff --git a/app/code/Magento/Security/Model/SecurityChecker/Quantity.php b/app/code/Magento/Security/Model/SecurityChecker/Quantity.php
index 9d86b55158be5..44538a7d8e21e 100644
--- a/app/code/Magento/Security/Model/SecurityChecker/Quantity.php
+++ b/app/code/Magento/Security/Model/SecurityChecker/Quantity.php
@@ -54,7 +54,7 @@ public function check($securityEventType, $accountReference = null, $longIp = nu
{
$isEnabled = $this->securityConfig->getPasswordResetProtectionType() != ResetMethod::OPTION_NONE;
$allowedAttemptsNumber = $this->securityConfig->getMaxNumberPasswordResetRequests();
- if ($isEnabled and $allowedAttemptsNumber) {
+ if ($isEnabled && $allowedAttemptsNumber) {
$collection = $this->prepareCollection($securityEventType, $accountReference, $longIp);
if ($collection->count() >= $allowedAttemptsNumber) {
throw new SecurityViolationException(
diff --git a/app/code/Magento/SendFriend/Model/SendFriend.php b/app/code/Magento/SendFriend/Model/SendFriend.php
index c69d6342b4892..79bac0e680952 100644
--- a/app/code/Magento/SendFriend/Model/SendFriend.php
+++ b/app/code/Magento/SendFriend/Model/SendFriend.php
@@ -236,7 +236,7 @@ public function validate()
}
$email = $this->getSender()->getEmail();
- if (empty($email) or !\Zend_Validate::is($email, \Magento\Framework\Validator\EmailAddress::class)) {
+ if (empty($email) || !\Zend_Validate::is($email, \Magento\Framework\Validator\EmailAddress::class)) {
$errors[] = __('Invalid Sender Email');
}
@@ -281,13 +281,13 @@ public function setRecipients($recipients)
// validate array
if (!is_array(
$recipients
- ) or !isset(
+ ) || !isset(
$recipients['email']
- ) or !isset(
+ ) || !isset(
$recipients['name']
- ) or !is_array(
+ ) || !is_array(
$recipients['email']
- ) or !is_array(
+ ) || !is_array(
$recipients['name']
)
) {
@@ -487,7 +487,7 @@ protected function _sentCountByCookies($increment = false)
$oldTimes = explode(',', $oldTimes);
foreach ($oldTimes as $oldTime) {
$periodTime = $time - $this->_sendfriendData->getPeriod();
- if (is_numeric($oldTime) and $oldTime >= $periodTime) {
+ if (is_numeric($oldTime) && $oldTime >= $periodTime) {
$newTimes[] = $oldTime;
}
}
diff --git a/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php b/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php
index 4aea7ab4c5a7c..cee4522903689 100755
--- a/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php
+++ b/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php
@@ -265,7 +265,7 @@ protected function processExtraTaxables(Address\Total $total, array $itemsByType
{
$extraTaxableDetails = [];
foreach ($itemsByType as $itemType => $itemTaxDetails) {
- if ($itemType != self::ITEM_TYPE_PRODUCT and $itemType != self::ITEM_TYPE_SHIPPING) {
+ if ($itemType != self::ITEM_TYPE_PRODUCT && $itemType != self::ITEM_TYPE_SHIPPING) {
foreach ($itemTaxDetails as $itemCode => $itemTaxDetail) {
/** @var \Magento\Tax\Api\Data\TaxDetailsInterface $taxDetails */
$taxDetails = $itemTaxDetail[self::KEY_ITEM];
diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php
index 6d627574a3a18..b5a4e41b63279 100644
--- a/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php
+++ b/dev/tests/static/testsuite/Magento/Test/Integrity/ClassesTest.php
@@ -194,7 +194,7 @@ private function assertClassesExist(array $classes, string $path): void
foreach ($classes as $class) {
$class = trim($class, '\\');
try {
- if (strrchr($class, '\\') === false and !Classes::isVirtual($class)) {
+ if (strrchr($class, '\\') === false && !Classes::isVirtual($class)) {
$badUsages[] = $class;
continue;
} else {
diff --git a/lib/internal/Magento/Framework/Filter/Template.php b/lib/internal/Magento/Framework/Filter/Template.php
index 3e5f9bcf0bd27..a56a4a3edf1fe 100644
--- a/lib/internal/Magento/Framework/Filter/Template.php
+++ b/lib/internal/Magento/Framework/Filter/Template.php
@@ -293,7 +293,7 @@ public function templateDirective($construction)
{
// Processing of {template config_path=... [...]} statement
$templateParameters = $this->getParameters($construction[2]);
- if (!isset($templateParameters['config_path']) or !$this->getTemplateProcessor()) {
+ if (!isset($templateParameters['config_path']) || !$this->getTemplateProcessor()) {
// Not specified template or not set include processor
$replacedValue = '{Error in template processing}';
} else {
diff --git a/lib/internal/Magento/Framework/Message/Manager.php b/lib/internal/Magento/Framework/Message/Manager.php
index c3b5701057d73..484d410181f48 100644
--- a/lib/internal/Magento/Framework/Message/Manager.php
+++ b/lib/internal/Magento/Framework/Message/Manager.php
@@ -226,7 +226,7 @@ public function addUniqueMessages(array $messages, $group = null)
$items = $this->getMessages(false, $group)->getItems();
foreach ($messages as $message) {
- if ($message instanceof MessageInterface and !in_array($message, $items, false)) {
+ if ($message instanceof MessageInterface && !in_array($message, $items, false)) {
$this->addMessage($message, $group);
}
}
diff --git a/setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php b/setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php
index c0ec78f046e23..96edca6130cdc 100644
--- a/setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php
+++ b/setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php
@@ -340,7 +340,7 @@ public function validate(array $options, DeploymentConfig $deploymentConfig)
if (isset($options[self::INPUT_KEY_SESSION_REDIS_LOG_LEVEL])) {
$level = $options[self::INPUT_KEY_SESSION_REDIS_LOG_LEVEL];
- if (($level < 0) or ($level > 7)) {
+ if (($level < 0) || ($level > 7)) {
$errors[] = "Invalid Redis log level '{$level}'. Valid range is 0-7, inclusive.";
}
}
From 0e32d5a33ab4707bb3932b71e7b08d3de0f4dd7b Mon Sep 17 00:00:00 2001
From: Yuliya Labudova
Date: Mon, 28 Jan 2019 11:38:59 +0300
Subject: [PATCH 092/121] MAGETWO-95817: Issue in Redeeming Gift Card
- Stabilize mftf test.
---
.../Shipping/Test/Mftf/Data/FreeShippingMethodData.xml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml b/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml
index 512ef8389bb7b..d700aa622c177 100644
--- a/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml
+++ b/app/code/Magento/Shipping/Test/Mftf/Data/FreeShippingMethodData.xml
@@ -13,6 +13,13 @@
1
+
+
+ freeActiveDisable
+
+
+ 0
+
freeActiveDefault
From 3b635263c112019bf631b866b916d383f61fa98c Mon Sep 17 00:00:00 2001
From: nmalevanec
Date: Mon, 28 Jan 2019 11:34:13 +0200
Subject: [PATCH 093/121] Fix static tests.
---
.../web/css/source/module/checkout/_tooltip.less | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less
index e42d8eb7a8dd7..39b9a051e6592 100644
--- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less
+++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less
@@ -151,26 +151,28 @@
//
// Tablet
// _____________________________________________
+
@media only screen and (max-width: @screen__m) {
.field-tooltip .field-tooltip-content {
+ left: auto;
right: -10px;
top: 40px;
- left: auto;
}
- .field-tooltip .field-tooltip-content::before, .field-tooltip .field-tooltip-content::after {
+ .field-tooltip .field-tooltip-content::before,
+ .field-tooltip .field-tooltip-content::after {
border: 10px solid transparent;
height: 0;
- width: 0;
+ left: auto;
margin-top: -21px;
right: 10px;
- left: auto;
top: 0;
+ width: 0;
}
.field-tooltip .field-tooltip-content::before {
- border-bottom-color: #666;
+ border-bottom-color: @color-gray40;
}
.field-tooltip .field-tooltip-content::after {
- border-bottom-color: #f4f4f4;
+ border-bottom-color: @color-gray-light01;
top: 1px;
}
-}
\ No newline at end of file
+}
From ac39ca2e54fad653d1aef3f7f2a96affcbde5c78 Mon Sep 17 00:00:00 2001
From: amol 2jcommerce
Date: Mon, 28 Jan 2019 17:09:16 +0530
Subject: [PATCH 094/121] My-account-page-title-extra-space-on-mobile
---
.../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 3ffaeb82cdc2a..a22e5baeb57fc 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
@@ -368,7 +368,7 @@
.account {
.page.messages {
- margin-bottom: @indent__xl;
+ margin-bottom: 0;
}
.toolbar {
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 d7ae6c3b28f4a..fe423a236c80e 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
@@ -551,7 +551,7 @@
.account {
.page.messages {
- margin-bottom: @indent__xl;
+ margin-bottom: 0;
}
.column.main {
From fe35a75689b5950540f2731b6b0f19ce33e21fe9 Mon Sep 17 00:00:00 2001
From: amol 2jcommerce
Date: Mon, 28 Jan 2019 19:05:37 +0530
Subject: [PATCH 095/121] My-account-page-title-extra-space-on-mobile
---
.../Magento/blank/Magento_Customer/web/css/source/_module.less | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 a22e5baeb57fc..d914f691604cd 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
@@ -367,7 +367,7 @@
}
.account {
- .page.messages {
+ .messages {
margin-bottom: 0;
}
From b208e444bf108f8d5dfd800d952376ad2e4d4c13 Mon Sep 17 00:00:00 2001
From: amol 2jcommerce
Date: Mon, 28 Jan 2019 19:20:51 +0530
Subject: [PATCH 096/121] My-account-page-title-extra-space-on-mobile
---
.../Magento/luma/Magento_Customer/web/css/source/_module.less | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 c22fd6509248d..92ff50064f3ab 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
@@ -554,7 +554,7 @@
}
.account {
- .page.messages {
+ .messages {
margin-bottom: 0;
}
From 6c2d7d973468322af2094eb5aeec7072c7f16cd9 Mon Sep 17 00:00:00 2001
From: Pavel Bystritsky
Date: Mon, 28 Jan 2019 16:50:22 +0200
Subject: [PATCH 097/121] ENGCOM-3980: Static test fix.
---
.../Paypal/Controller/Transparent/RequestSecureToken.php | 2 ++
.../Magento/Security/Model/SecurityChecker/Quantity.php | 2 +-
app/code/Magento/SendFriend/Model/SendFriend.php | 3 +++
app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php | 1 +
lib/internal/Magento/Framework/Message/Manager.php | 2 ++
setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php | 6 +++---
6 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/Paypal/Controller/Transparent/RequestSecureToken.php b/app/code/Magento/Paypal/Controller/Transparent/RequestSecureToken.php
index b63799612a24d..847388eb755a1 100644
--- a/app/code/Magento/Paypal/Controller/Transparent/RequestSecureToken.php
+++ b/app/code/Magento/Paypal/Controller/Transparent/RequestSecureToken.php
@@ -107,6 +107,8 @@ public function execute()
}
/**
+ * Get error response.
+ *
* @return Json
*/
private function getErrorResponse()
diff --git a/app/code/Magento/Security/Model/SecurityChecker/Quantity.php b/app/code/Magento/Security/Model/SecurityChecker/Quantity.php
index 44538a7d8e21e..5d72ba261f316 100644
--- a/app/code/Magento/Security/Model/SecurityChecker/Quantity.php
+++ b/app/code/Magento/Security/Model/SecurityChecker/Quantity.php
@@ -48,7 +48,7 @@ public function __construct(
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function check($securityEventType, $accountReference = null, $longIp = null)
{
diff --git a/app/code/Magento/SendFriend/Model/SendFriend.php b/app/code/Magento/SendFriend/Model/SendFriend.php
index 79bac0e680952..38525a9f83a12 100644
--- a/app/code/Magento/SendFriend/Model/SendFriend.php
+++ b/app/code/Magento/SendFriend/Model/SendFriend.php
@@ -16,6 +16,7 @@
* @method \Magento\SendFriend\Model\SendFriend setTime(int $value)
*
* @author Magento Core Team
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*
* @api
@@ -162,6 +163,8 @@ protected function _construct()
}
/**
+ * Send email.
+ *
* @return $this
* @throws CoreException
*/
diff --git a/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php b/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php
index cee4522903689..52061fd5d3882 100755
--- a/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php
+++ b/app/code/Magento/Tax/Model/Sales/Total/Quote/Tax.php
@@ -408,6 +408,7 @@ protected function enhanceTotalData(
/**
* Process model configuration array.
+ *
* This method can be used for changing totals collect sort order
*
* @param array $config
diff --git a/lib/internal/Magento/Framework/Message/Manager.php b/lib/internal/Magento/Framework/Message/Manager.php
index 484d410181f48..4ef1754b7e586 100644
--- a/lib/internal/Magento/Framework/Message/Manager.php
+++ b/lib/internal/Magento/Framework/Message/Manager.php
@@ -11,6 +11,8 @@
/**
* Message manager model
+ *
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Manager implements ManagerInterface
diff --git a/setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php b/setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php
index 96edca6130cdc..e864a81ffcc0e 100644
--- a/setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php
+++ b/setup/src/Magento/Setup/Model/ConfigOptionsList/Session.php
@@ -139,7 +139,7 @@ class Session implements ConfigOptionsListInterface
];
/**
- * {@inheritdoc}
+ * @inheritdoc
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function getOptions()
@@ -289,7 +289,7 @@ public function getOptions()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function createConfig(array $options, DeploymentConfig $deploymentConfig)
{
@@ -320,7 +320,7 @@ public function createConfig(array $options, DeploymentConfig $deploymentConfig)
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function validate(array $options, DeploymentConfig $deploymentConfig)
{
From 823e68473822fdd3125922a5a2d0a5e1bf0cd019 Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Mon, 28 Jan 2019 13:12:04 -0600
Subject: [PATCH 098/121] MC-5717 - Sub-category doesnt display after moving
categories
---
app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php
index 11c0a73a73708..77518fd9bf5cc 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/Save.php
@@ -147,6 +147,7 @@ public function execute()
$parentCategory = $this->getParentCategory($parentId, $storeId);
$category->setPath($parentCategory->getPath());
$category->setParentId($parentCategory->getId());
+ $category->setLevel(null);
}
/**
From db9a3c89e0874d0ed76fec5d96195c5a7170efd3 Mon Sep 17 00:00:00 2001
From: Andrew Molina
Date: Mon, 28 Jan 2019 16:29:06 -0600
Subject: [PATCH 099/121] MC-5717: Sub-category doesnt display after moving
categories
Fixed static test failures
---
.../Catalog/Controller/Adminhtml/Category/RefreshPath.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php
index e58a0c5b0996e..e3d40bee214d1 100644
--- a/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php
+++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category/RefreshPath.php
@@ -1,6 +1,5 @@
Date: Mon, 28 Jan 2019 16:44:17 -0600
Subject: [PATCH 100/121] Update post-code.js
---
.../Magento/Ui/view/base/web/js/form/element/post-code.js | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
index 5bfba724dfbe8..72177a1804df0 100644
--- a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
@@ -33,11 +33,8 @@ define([
}
option = options[value];
- if (!option) {
- return;
- }
- if (option['is_zipcode_optional']) {
+ if (option && option['is_zipcode_optional']) {
this.error(false);
this.validation = _.omit(this.validation, 'required-entry');
} else {
From 0902931633e350761e509a62ad66b22ff40cd093 Mon Sep 17 00:00:00 2001
From: Oleksii Korshenko
Date: Mon, 28 Jan 2019 16:51:01 -0600
Subject: [PATCH 101/121] Update post-code.js
---
.../Magento/Ui/view/base/web/js/form/element/post-code.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
index 72177a1804df0..b8bab2f72f38a 100644
--- a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
@@ -34,7 +34,11 @@ define([
option = options[value];
- if (option && option['is_zipcode_optional']) {
+ if (!option) {
+ return;
+ }
+
+ if (option['is_zipcode_optional']) {
this.error(false);
this.validation = _.omit(this.validation, 'required-entry');
} else {
From fb29ecf164c517cf415ef988b560b471594d5df0 Mon Sep 17 00:00:00 2001
From: Dominic
Date: Tue, 29 Jan 2019 10:57:41 +0530
Subject: [PATCH 102/121] add type resolve sting to const
---
.../Model/ConfigurableProductTypeResolver.php | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php b/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php
index e4e1c6aab6922..f65a331ab803c 100644
--- a/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php
+++ b/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php
@@ -15,13 +15,19 @@
*/
class ConfigurableProductTypeResolver implements TypeResolverInterface
{
+ /**
+ * Configurable product type resolver code
+ */
+ const TYPE_RESOLVER = 'ConfigurableProduct';
+
/**
* {@inheritdoc}
*/
public function resolveType(array $data) : string
{
if (isset($data['type_id']) && $data['type_id'] == Type::TYPE_CODE) {
- return 'ConfigurableProduct';
+ return self::TYPE_RESOLVER;
+
}
return '';
}
From 6401f7a1372007b1b3064044f64a462b75b517db Mon Sep 17 00:00:00 2001
From: satyaprakash
Date: Tue, 29 Jan 2019 14:46:39 +0530
Subject: [PATCH 103/121] Code Cleanup : Typo Fixed enabed -> enabled
---
.../Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml | 2 +-
.../AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml | 2 +-
...inAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml | 2 +-
...dminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml
index ded94eab92042..1adb781a67536 100644
--- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCMSPageLinkTypeTest.xml
@@ -36,7 +36,7 @@
-
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml
index 2586ffc11d086..394d79bda1ab3 100644
--- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithCatalogProductListTypeTest.xml
@@ -42,7 +42,7 @@
-
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml
index 691a99a73b90b..862f51ea72fad 100644
--- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyComparedProductsTypeTest.xml
@@ -41,7 +41,7 @@
-
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml
index 9cdbccd1f8c32..298aed917fc18 100644
--- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml
+++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddWidgetToWYSIWYGWithRecentlyViewedProductsTypeTest.xml
@@ -40,7 +40,7 @@
-
+
From ed7586ff3a83e5e87f076f678317ea1435344d55 Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Tue, 29 Jan 2019 12:40:49 +0300
Subject: [PATCH 104/121] MAGETWO-95823: Order Sales Report includes canceled
orders
- Update automated test
---
.../ActionGroup/AdminOrderActionGroup.xml | 22 -------------------
1 file changed, 22 deletions(-)
diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml
index 8732e7cd84ed6..aea04c8abfa60 100644
--- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml
+++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml
@@ -361,28 +361,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
From 040e5b5a72db21897ac599cf70b8845dcec8596d Mon Sep 17 00:00:00 2001
From: Dominic
Date: Tue, 29 Jan 2019 18:14:18 +0530
Subject: [PATCH 105/121] add missing php doc comment
---
.../Magento/BundleGraphQl/Model/Resolver/Options/Collection.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php b/app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php
index 149155c86275a..7608d6e9e4d97 100644
--- a/app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php
+++ b/app/code/Magento/BundleGraphQl/Model/Resolver/Options/Collection.php
@@ -61,6 +61,7 @@ public function __construct(
* Add parent id/sku pair to use for option filter at fetch time.
*
* @param int $parentId
+ * @param int $parentEntityId
* @param string $sku
*/
public function addParentFilterData(int $parentId, int $parentEntityId, string $sku) : void
From 2bb00c285664d0e42f68217d2ccff6f8e3397e46 Mon Sep 17 00:00:00 2001
From: DianaRusin
Date: Tue, 29 Jan 2019 15:02:50 +0200
Subject: [PATCH 106/121] MAGETWO-97952: Automate with Integration test
Confirmation email should be delivered to the customer when address contains
'+' symbol
---
.../Customer/Controller/AccountTest.php | 164 ++++++++++++------
.../customer_confirmation_config_disable.php | 21 +++
...r_confirmation_config_disable_rollback.php | 23 +++
.../customer_confirmation_config_enable.php | 21 +++
...er_confirmation_config_enable_rollback.php | 23 +++
...ation_email_address_with_special_chars.php | 37 ++++
...il_address_with_special_chars_rollback.php | 31 ++++
7 files changed, 266 insertions(+), 54 deletions(-)
create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_disable.php
create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_disable_rollback.php
create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_enable.php
create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_enable_rollback.php
create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_email_address_with_special_chars.php
create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_email_address_with_special_chars_rollback.php
diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php
index c94948e23ab4d..ea7a7710acbc3 100644
--- a/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php
+++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/AccountTest.php
@@ -17,18 +17,35 @@
use Magento\Framework\App\Http;
use Magento\Framework\Data\Form\FormKey;
use Magento\Framework\Message\MessageInterface;
-use Magento\Store\Model\ScopeInterface;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\Request;
use Magento\TestFramework\Response;
use Zend\Stdlib\Parameters;
use Magento\Framework\App\Request\Http as HttpRequest;
+use Magento\TestFramework\Mail\Template\TransportBuilderMock;
+use Magento\Framework\Serialize\Serializer\Json;
+use Magento\Framework\Stdlib\CookieManagerInterface;
+use Magento\Theme\Controller\Result\MessagePlugin;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class AccountTest extends \Magento\TestFramework\TestCase\AbstractController
{
+ /**
+ * @var TransportBuilderMock
+ */
+ private $transportBuilderMock;
+
+ /**
+ * @inheritdoc
+ */
+ protected function setUp()
+ {
+ parent::setUp();
+ $this->transportBuilderMock = $this->_objectManager->get(TransportBuilderMock::class);
+ }
+
/**
* Login the user
*
@@ -133,11 +150,7 @@ public function testForgotPasswordEmailMessageWithSpecialCharacters()
$this->dispatch('customer/account/forgotPasswordPost');
$this->assertRedirect($this->stringContains('customer/account/'));
- /** @var \Magento\TestFramework\Mail\Template\TransportBuilderMock $transportBuilder */
- $transportBuilder = $this->_objectManager->get(
- \Magento\TestFramework\Mail\Template\TransportBuilderMock::class
- );
- $subject = $transportBuilder->getSentMessage()->getSubject();
+ $subject = $this->transportBuilderMock->getSentMessage()->getSubject();
$this->assertContains(
'Test special\' characters',
$subject
@@ -260,26 +273,10 @@ public function testNoFormKeyCreatePostAction()
/**
* @magentoDbIsolation enabled
* @magentoAppIsolation enabled
+ * @magentoDataFixture Magento/Customer/_files/customer_confirmation_config_disable.php
*/
public function testNoConfirmCreatePostAction()
{
- /** @var \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableScopeConfig */
- $mutableScopeConfig = Bootstrap::getObjectManager()
- ->get(\Magento\Framework\App\Config\MutableScopeConfigInterface::class);
-
- $scopeValue = $mutableScopeConfig->getValue(
- 'customer/create_account/confirm',
- ScopeInterface::SCOPE_WEBSITES,
- null
- );
-
- $mutableScopeConfig->setValue(
- 'customer/create_account/confirm',
- 0,
- ScopeInterface::SCOPE_WEBSITES,
- null
- );
-
$this->fillRequestWithAccountDataAndFormKey('test1@email.com');
$this->dispatch('customer/account/createPost');
$this->assertRedirect($this->stringEndsWith('customer/account/'));
@@ -287,38 +284,15 @@ public function testNoConfirmCreatePostAction()
$this->equalTo(['Thank you for registering with Main Website Store.']),
MessageInterface::TYPE_SUCCESS
);
-
- $mutableScopeConfig->setValue(
- 'customer/create_account/confirm',
- $scopeValue,
- ScopeInterface::SCOPE_WEBSITES,
- null
- );
}
/**
* @magentoDbIsolation enabled
* @magentoAppIsolation enabled
+ * @magentoDataFixture Magento/Customer/_files/customer_confirmation_config_enable.php
*/
public function testWithConfirmCreatePostAction()
{
- /** @var \Magento\Framework\App\Config\MutableScopeConfigInterface $mutableScopeConfig */
- $mutableScopeConfig = Bootstrap::getObjectManager()
- ->get(\Magento\Framework\App\Config\MutableScopeConfigInterface::class);
-
- $scopeValue = $mutableScopeConfig->getValue(
- 'customer/create_account/confirm',
- ScopeInterface::SCOPE_WEBSITES,
- null
- );
-
- $mutableScopeConfig->setValue(
- 'customer/create_account/confirm',
- 1,
- ScopeInterface::SCOPE_WEBSITES,
- null
- );
-
$this->fillRequestWithAccountDataAndFormKey('test2@email.com');
$this->dispatch('customer/account/createPost');
$this->assertRedirect($this->stringContains('customer/account/index/'));
@@ -330,13 +304,6 @@ public function testWithConfirmCreatePostAction()
]),
MessageInterface::TYPE_SUCCESS
);
-
- $mutableScopeConfig->setValue(
- 'customer/create_account/confirm',
- $scopeValue,
- ScopeInterface::SCOPE_WEBSITES,
- null
- );
}
/**
@@ -730,6 +697,46 @@ public function testLoginPostRedirect($redirectDashboard, string $redirectUrl)
$this->assertTrue($this->_objectManager->get(Session::class)->isLoggedIn());
}
+ /**
+ * Test that confirmation email address displays special characters correctly.
+ *
+ * @magentoDbIsolation enabled
+ * @magentoDataFixture Magento/Customer/_files/customer_confirmation_email_address_with_special_chars.php
+ *
+ * @return void
+ */
+ public function testConfirmationEmailWithSpecialCharacters(): void
+ {
+ $email = 'customer+confirmation@example.com';
+ $this->dispatch('customer/account/confirmation/email/customer%2Bconfirmation%40email.com');
+ $this->getRequest()->setPostValue('email', $email);
+ $this->dispatch('customer/account/confirmation/email/customer%2Bconfirmation%40email.com');
+
+ $this->assertRedirect($this->stringContains('customer/account/index'));
+ $this->assertSessionMessages(
+ $this->equalTo(['Please check your email for confirmation key.']),
+ MessageInterface::TYPE_SUCCESS
+ );
+
+ /** @var $message \Magento\Framework\Mail\Message */
+ $message = $this->transportBuilderMock->getSentMessage();
+ $rawMessage = $message->getRawMessage();
+
+ $this->assertContains('To: ' . $email, $rawMessage);
+
+ $content = $message->getBody()->getPartContent(0);
+ $confirmationUrl = $this->getConfirmationUrlFromMessageContent($content);
+ $this->setRequestInfo($confirmationUrl, 'confirm');
+ $this->clearCookieMessagesList();
+ $this->dispatch($confirmationUrl);
+
+ $this->assertRedirect($this->stringContains('customer/account/index'));
+ $this->assertSessionMessages(
+ $this->equalTo(['Thank you for registering with Main Website Store.']),
+ MessageInterface::TYPE_SUCCESS
+ );
+ }
+
/**
* Data provider for testLoginPostRedirect.
*
@@ -847,4 +854,53 @@ private function assertResponseRedirect(Response $response, string $redirectUrl)
$this->assertTrue($response->isRedirect());
$this->assertSame($redirectUrl, $response->getHeader('Location')->getUri());
}
+
+ /**
+ * Add new request info (request uri, path info, action name).
+ *
+ * @param string $uri
+ * @param string $actionName
+ * @return void
+ */
+ private function setRequestInfo(string $uri, string $actionName): void
+ {
+ $this->getRequest()
+ ->setRequestUri($uri)
+ ->setPathInfo()
+ ->setActionName($actionName);
+ }
+
+ /**
+ * Clear cookie messages list.
+ *
+ * @return void
+ */
+ private function clearCookieMessagesList(): void
+ {
+ $cookieManager = $this->_objectManager->get(CookieManagerInterface::class);
+ $jsonSerializer = $this->_objectManager->get(Json::class);
+ $cookieManager->setPublicCookie(
+ MessagePlugin::MESSAGES_COOKIES_NAME,
+ $jsonSerializer->serialize([])
+ );
+ }
+
+ /**
+ * Get confirmation URL from message content.
+ *
+ * @param string $content
+ * @return string
+ */
+ private function getConfirmationUrlFromMessageContent(string $content): string
+ {
+ $confirmationUrl = '';
+
+ if (preg_match('.*?)".*>', $content, $matches)) {
+ $confirmationUrl = $matches['url'];
+ $confirmationUrl = str_replace('http://localhost/index.php/', '', $confirmationUrl);
+ $confirmationUrl = html_entity_decode($confirmationUrl);
+ }
+
+ return $confirmationUrl;
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_disable.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_disable.php
new file mode 100644
index 0000000000000..7d4e451db514b
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_disable.php
@@ -0,0 +1,21 @@
+create(MutableScopeConfigInterface::class);
+
+$mutableScopeConfig->setValue(
+ 'customer/create_account/confirm',
+ 0,
+ ScopeInterface::SCOPE_WEBSITES,
+ null
+);
diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_disable_rollback.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_disable_rollback.php
new file mode 100644
index 0000000000000..36743b4a20e9a
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_disable_rollback.php
@@ -0,0 +1,23 @@
+get(Registry::class);
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+/** @var Config $config */
+$config = Bootstrap::getObjectManager()->create(Config::class);
+$config->deleteConfig('customer/create_account/confirm');
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_enable.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_enable.php
new file mode 100644
index 0000000000000..c8deb7ec2a536
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_enable.php
@@ -0,0 +1,21 @@
+create(MutableScopeConfigInterface::class);
+
+$mutableScopeConfig->setValue(
+ 'customer/create_account/confirm',
+ 1,
+ ScopeInterface::SCOPE_WEBSITES,
+ null
+);
diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_enable_rollback.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_enable_rollback.php
new file mode 100644
index 0000000000000..36743b4a20e9a
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_config_enable_rollback.php
@@ -0,0 +1,23 @@
+get(Registry::class);
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+/** @var Config $config */
+$config = Bootstrap::getObjectManager()->create(Config::class);
+$config->deleteConfig('customer/create_account/confirm');
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_email_address_with_special_chars.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_email_address_with_special_chars.php
new file mode 100644
index 0000000000000..c4f046bac57a6
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_email_address_with_special_chars.php
@@ -0,0 +1,37 @@
+create(Customer::class);
+/** @var CustomerRepositoryInterface $customerRepository */
+$customerRepository = $objectManager->create(CustomerRepositoryInterface::class);
+/** @var CustomerInterface $customerInterface */
+$customerInterface = $objectManager->create(CustomerInterface::class);
+
+$customerInterface->setWebsiteId(1)
+ ->setEmail('customer+confirmation@example.com')
+ ->setConfirmation($customer->getRandomConfirmationKey())
+ ->setGroupId(1)
+ ->setStoreId(1)
+ ->setFirstname('John')
+ ->setLastname('Smith')
+ ->setDefaultBilling(1)
+ ->setDefaultShipping(1)
+ ->setTaxvat('12')
+ ->setGender(0);
+
+$customerRepository->save($customerInterface, 'password');
diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_email_address_with_special_chars_rollback.php b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_email_address_with_special_chars_rollback.php
new file mode 100644
index 0000000000000..7a0ebf74ed8a0
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Customer/_files/customer_confirmation_email_address_with_special_chars_rollback.php
@@ -0,0 +1,31 @@
+get(Registry::class);
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+/** @var CustomerRepositoryInterface $customerRepository */
+$customerRepository = Bootstrap::getObjectManager()->create(CustomerRepositoryInterface::class);
+
+try {
+ $customer = $customerRepository->get('customer+confirmation@example.com');
+ $customerRepository->delete($customer);
+} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
+ // Customer with the specified email does not exist
+}
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
From 3167a47c17643582832637a976cb624bdd90cdf7 Mon Sep 17 00:00:00 2001
From: Andrii Meysar
Date: Tue, 29 Jan 2019 16:59:53 +0200
Subject: [PATCH 107/121] MAGETWO-97953: Automate with Integration test Verify
Email functionality for order
---
.../TestCase/AbstractBackendController.php | 4 +-
.../Adminhtml/Order/Create/SaveTest.php | 160 +++++++++++++++++-
.../AbstractCreditmemoControllerTest.php | 92 ++++++++++
.../Order/Creditmemo/AddCommentTest.php | 102 +++++++++++
.../Adminhtml/Order/Creditmemo/SaveTest.php | 99 +++++++++++
.../Controller/Adminhtml/Order/EmailTest.php | 136 +++++++++++++++
.../Invoice/AbstractInvoiceControllerTest.php | 92 ++++++++++
.../Order/Invoice/AddCommentTest.php | 103 +++++++++++
.../Adminhtml/Order/Invoice/EmailTest.php | 88 ++++++++++
.../Adminhtml/Order/Invoice/SaveTest.php | 97 +++++++++++
.../Magento/Sales/Model/Order/CreateTest.php | 100 +++++++++++
.../_files/guest_quote_with_addresses.php | 68 ++++++++
.../guest_quote_with_addresses_rollback.php | 32 ++++
.../AbstractShipmentControllerTest.php | 92 ++++++++++
.../Order/Shipment/AddCommentTest.php | 102 +++++++++++
.../Adminhtml/Order/Shipment/SaveTest.php | 97 +++++++++++
16 files changed, 1458 insertions(+), 6 deletions(-)
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AbstractCreditmemoControllerTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/EmailTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AbstractInvoiceControllerTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AddCommentTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/EmailTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreateTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/guest_quote_with_addresses.php
create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/guest_quote_with_addresses_rollback.php
create mode 100644 dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AbstractShipmentControllerTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AddCommentTest.php
create mode 100644 dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php
diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php
index b2e0b57bae729..7a387bd41eec2 100644
--- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php
+++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractBackendController.php
@@ -5,8 +5,6 @@
*/
namespace Magento\TestFramework\TestCase;
-use Magento\Framework\App\Request\Http as HttpRequest;
-
/**
* A parent class for backend controllers - contains directives for admin user creation and authentication.
*
@@ -122,7 +120,7 @@ public function testAclHasAccess()
*/
public function testAclNoAccess()
{
- if ($this->resource === null) {
+ if ($this->resource === null || $this->uri === null) {
$this->markTestIncomplete('Acl test is not complete');
}
if ($this->httpMethod) {
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php
index e2638b5df1f88..f863edd049258 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Create/SaveTest.php
@@ -9,21 +9,61 @@
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Framework\Api\SearchCriteriaBuilder;
use Magento\Framework\App\Request\Http;
+use Magento\Framework\Data\Form\FormKey;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Message\MessageInterface;
use Magento\Quote\Api\CartRepositoryInterface;
+use Magento\Sales\Api\Data\OrderInterface;
+use Magento\Sales\Model\OrderRepository;
use Magento\Sales\Model\Service\OrderService;
+use Magento\TestFramework\Mail\Template\TransportBuilderMock;
use Magento\TestFramework\TestCase\AbstractBackendController;
+use PHPUnit\Framework\Constraint\StringContains;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
+/**
+ * Class test backend order save.
+ *
+ * @magentoAppArea adminhtml
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ */
class SaveTest extends AbstractBackendController
{
+ /**
+ * @var TransportBuilderMock
+ */
+ private $transportBuilder;
+
+ /**
+ * @var FormKey
+ */
+ private $formKey;
+
+ /**
+ * @var string
+ */
+ protected $resource = 'Magento_Sales::create';
+
+ /**
+ * @var string
+ */
+ protected $uri = 'backend/sales/order_create/save';
+
+ /**
+ * @inheritdoc
+ */
+ protected function setUp()
+ {
+ parent::setUp();
+ $this->transportBuilder = $this->_objectManager->get(TransportBuilderMock::class);
+ $this->formKey = $this->_objectManager->get(FormKey::class);
+ }
+
/**
* Checks a case when order creation is failed on payment method processing but new customer already created
* in the database and after new controller dispatching the customer should be already loaded in session
* to prevent invalid validation.
*
- * @magentoAppArea adminhtml
* @magentoDataFixture Magento/Sales/_files/quote_with_new_customer.php
*/
public function testExecuteWithPaymentOperation()
@@ -36,7 +76,7 @@ public function testExecuteWithPaymentOperation()
$email = 'john.doe001@test.com';
$data = [
'account' => [
- 'email' => $email
+ 'email' => $email,
]
];
$this->getRequest()->setMethod(Http::METHOD_POST);
@@ -66,13 +106,52 @@ public function testExecuteWithPaymentOperation()
$this->_objectManager->removeSharedInstance(OrderService::class);
}
+ /**
+ * @magentoDbIsolation enabled
+ * @magentoDataFixture Magento/Sales/_files/guest_quote_with_addresses.php
+ *
+ * @return void
+ */
+ public function testSendEmailOnOrderSave(): void
+ {
+ $this->prepareRequest(['send_confirmation' => true]);
+ $this->dispatch('backend/sales/order_create/save');
+ $this->assertSessionMessages(
+ $this->equalTo([(string)__('You created the order.')]),
+ MessageInterface::TYPE_SUCCESS
+ );
+
+ $this->assertRedirect($this->stringContains('sales/order/view/'));
+
+ $orderId = $this->getOrderId();
+ if ($orderId === false) {
+ $this->fail('Order is not created.');
+ }
+ $order = $this->getOrder($orderId);
+
+ $message = $this->transportBuilder->getSentMessage();
+ $subject = __('Your %1 order confirmation', $order->getStore()->getFrontendName())->render();
+ $assert = $this->logicalAnd(
+ new StringContains($order->getBillingAddress()->getName()),
+ new StringContains(
+ 'Thank you for your order from ' . $order->getStore()->getFrontendName()
+ ),
+ new StringContains(
+ "Your Order #{$order->getIncrementId()} "
+ )
+ );
+
+ $this->assertEquals($message->getSubject(), $subject);
+ $this->assertThat($message->getRawMessage(), $assert);
+ }
+
/**
* Gets quote by reserved order id.
*
* @param string $reservedOrderId
* @return \Magento\Quote\Api\Data\CartInterface
*/
- private function getQuote($reservedOrderId)
+ private function getQuote(string $reservedOrderId): \Magento\Quote\Api\Data\CartInterface
{
/** @var SearchCriteriaBuilder $searchCriteriaBuilder */
$searchCriteriaBuilder = $this->_objectManager->get(SearchCriteriaBuilder::class);
@@ -82,6 +161,81 @@ private function getQuote($reservedOrderId)
/** @var CartRepositoryInterface $quoteRepository */
$quoteRepository = $this->_objectManager->get(CartRepositoryInterface::class);
$items = $quoteRepository->getList($searchCriteria)->getItems();
+
return array_pop($items);
}
+
+ /**
+ * @inheritdoc
+ * @magentoDbIsolation enabled
+ * @magentoDataFixture Magento/Sales/_files/guest_quote_with_addresses.php
+ */
+ public function testAclHasAccess()
+ {
+ $this->prepareRequest();
+
+ parent::testAclHasAccess();
+ }
+
+ /**
+ * @inheritdoc
+ * @magentoDbIsolation enabled
+ * @magentoDataFixture Magento/Sales/_files/guest_quote_with_addresses.php
+ */
+ public function testAclNoAccess()
+ {
+ $this->prepareRequest();
+
+ parent::testAclNoAccess();
+ }
+
+ /**
+ * @param int $orderId
+ * @return OrderInterface
+ */
+ private function getOrder(int $orderId): OrderInterface
+ {
+ return $this->_objectManager->get(OrderRepository::class)->get($orderId);
+ }
+
+ /**
+ * @param array $params
+ * @return void
+ */
+ private function prepareRequest(array $params = []): void
+ {
+ $quote = $this->getQuote('guest_quote');
+ $session = $this->_objectManager->get(Quote::class);
+ $session->setQuoteId($quote->getId());
+ $session->setCustomerId(0);
+
+ $email = 'john.doe001@test.com';
+ $data = [
+ 'account' => [
+ 'email' => $email,
+ ],
+ ];
+
+ $data = array_replace_recursive($data, $params);
+
+ $this->getRequest()
+ ->setMethod('POST')
+ ->setParams(['form_key' => $this->formKey->getFormKey()])
+ ->setPostValue(['order' => $data]);
+ }
+
+ /**
+ * @return string|bool
+ */
+ protected function getOrderId()
+ {
+ $currentUrl = $this->getResponse()->getHeader('Location');
+ $orderId = false;
+
+ if (preg_match('/order_id\/(?\d+)/', $currentUrl, $matches)) {
+ $orderId = $matches['order_id'] ?? '';
+ }
+
+ return $orderId;
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AbstractCreditmemoControllerTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AbstractCreditmemoControllerTest.php
new file mode 100644
index 0000000000000..2a7731715021b
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AbstractCreditmemoControllerTest.php
@@ -0,0 +1,92 @@
+transportBuilder = $this->_objectManager->get(TransportBuilderMock::class);
+ $this->orderRepository = $this->_objectManager->get(OrderRepository::class);
+ $this->formKey = $this->_objectManager->get(FormKey::class);
+ }
+
+ /**
+ * @param string $incrementalId
+ * @return OrderInterface|null
+ */
+ protected function getOrder(string $incrementalId)
+ {
+ /** @var SearchCriteria $searchCriteria */
+ $searchCriteria = $this->_objectManager->create(SearchCriteriaBuilder::class)
+ ->addFilter(OrderInterface::INCREMENT_ID, $incrementalId)
+ ->create();
+
+ $orders = $this->orderRepository->getList($searchCriteria)->getItems();
+ /** @var OrderInterface|null $order */
+ $order = reset($orders);
+
+ return $order;
+ }
+
+ /**
+ * @param OrderInterface $order
+ * @return CreditmemoInterface
+ */
+ protected function getCreditMemo(OrderInterface $order): CreditmemoInterface
+ {
+ /** @var \Magento\Sales\Model\ResourceModel\Order\Creditmemo\Collection $creditMemoCollection */
+ $creditMemoCollection = $this->_objectManager->create(
+ \Magento\Sales\Model\ResourceModel\Order\Creditmemo\CollectionFactory::class
+ )->create();
+
+ /** @var CreditmemoInterface $creditMemo */
+ $creditMemo = $creditMemoCollection
+ ->setOrderFilter($order)
+ ->setPageSize(1)
+ ->getFirstItem();
+
+ return $creditMemo;
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php
new file mode 100644
index 0000000000000..2f23da8b3db87
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/AddCommentTest.php
@@ -0,0 +1,102 @@
+prepareRequest(
+ [
+ 'comment' => ['comment' => $comment, 'is_customer_notified' => true],
+ ]
+ );
+ $this->dispatch('backend/sales/order_creditmemo/addComment');
+ $html = $this->getResponse()->getBody();
+ $this->assertContains($comment, $html);
+
+ $message = $this->transportBuilder->getSentMessage();
+ $subject =__('Update to your %1 credit memo', $order->getStore()->getFrontendName())->render();
+ $messageConstraint = $this->logicalAnd(
+ new StringContains($order->getBillingAddress()->getName()),
+ new RegularExpression(
+ sprintf(
+ "/Your order #%s has been updated with a status of.*%s/",
+ $order->getIncrementId(),
+ $order->getFrontendStatusLabel()
+ )
+ ),
+ new StringContains($comment)
+ );
+
+ $this->assertEquals($message->getSubject(), $subject);
+ $this->assertThat($message->getRawMessage(), $messageConstraint);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclHasAccess()
+ {
+ $this->prepareRequest(['comment' => ['comment' => 'Comment']]);
+
+ parent::testAclHasAccess();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclNoAccess()
+ {
+ $this->prepareRequest(['comment' => ['comment' => 'Comment']]);
+
+ parent::testAclNoAccess();
+ }
+
+ /**
+ * @param array $params
+ * @return \Magento\Sales\Api\Data\OrderInterface|null
+ */
+ private function prepareRequest(array $params = [])
+ {
+ $order = $this->getOrder('100000001');
+ $creditmemo = $this->getCreditMemo($order);
+
+ $this->getRequest()->setMethod('POST');
+ $this->getRequest()->setParams(
+ [
+ 'id' => $creditmemo->getEntityId(),
+ 'form_key' => $this->formKey->getFormKey(),
+ ]
+ );
+
+ $data = $params ?? [];
+ $this->getRequest()->setPostValue($data);
+
+ return $order;
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php
new file mode 100644
index 0000000000000..fa5da2e0e50d1
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Creditmemo/SaveTest.php
@@ -0,0 +1,99 @@
+prepareRequest(['creditmemo' => ['send_email' => true]]);
+ $this->dispatch('backend/sales/order_creditmemo/save');
+
+ $this->assertSessionMessages(
+ $this->equalTo([(string)__('You created the credit memo.')]),
+ \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
+ );
+ $this->assertRedirect($this->stringContains('sales/order/view/order_id/' . $order->getEntityId()));
+
+ $creditMemo = $this->getCreditMemo($order);
+ $message = $this->transportBuilder->getSentMessage();
+ $subject = __('Credit memo for your %1 order', $order->getStore()->getFrontendName())->render();
+ $messageConstraint = $this->logicalAnd(
+ new StringContains($order->getBillingAddress()->getName()),
+ new StringContains(
+ 'Thank you for your order from ' . $creditMemo->getStore()->getFrontendName()
+ ),
+ new StringContains(
+ "Your Credit Memo #{$creditMemo->getIncrementId()} for Order #{$order->getIncrementId()}"
+ )
+ );
+
+ $this->assertEquals($message->getSubject(), $subject);
+ $this->assertThat($message->getRawMessage(), $messageConstraint);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclHasAccess()
+ {
+ $this->prepareRequest();
+
+ parent::testAclHasAccess();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclNoAccess()
+ {
+ $this->prepareRequest();
+
+ parent::testAclNoAccess();
+ }
+
+ /**
+ * @param array $params
+ * @return \Magento\Sales\Api\Data\OrderInterface|null
+ */
+ private function prepareRequest(array $params = [])
+ {
+ $order = $this->getOrder('100000001');
+ $this->getRequest()->setMethod('POST');
+ $this->getRequest()->setParams(
+ [
+ 'order_id' => $order->getEntityId(),
+ 'form_key' => $this->formKey->getFormKey(),
+ ]
+ );
+
+ $data = ['creditmemo' => ['do_offline' => true]];
+ $data = array_replace_recursive($data, $params);
+
+ $this->getRequest()->setPostValue($data);
+
+ return $order;
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/EmailTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/EmailTest.php
new file mode 100644
index 0000000000000..4d19106ad8e51
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/EmailTest.php
@@ -0,0 +1,136 @@
+orderRepository = $this->_objectManager->get(OrderRepository::class);
+ $this->transportBuilder = $this->_objectManager->get(TransportBuilderMock::class);
+ }
+
+ /**
+ * @return void
+ */
+ public function testSendOrderEmail(): void
+ {
+ $order = $this->prepareRequest();
+ $this->dispatch('backend/sales/order/email');
+
+ $this->assertSessionMessages(
+ $this->equalTo([(string)__('You sent the order email.')]),
+ \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
+ );
+
+ $redirectUrl = 'sales/order/view/order_id/' . $order->getEntityId();
+ $this->assertRedirect($this->stringContains($redirectUrl));
+
+ $message = $this->transportBuilder->getSentMessage();
+ $subject = __('Your %1 order confirmation', $order->getStore()->getFrontendName())->render();
+ $assert = $this->logicalAnd(
+ new StringContains($order->getBillingAddress()->getName()),
+ new StringContains(
+ 'Thank you for your order from ' . $order->getStore()->getFrontendName()
+ ),
+ new StringContains(
+ "Your Order #{$order->getIncrementId()} "
+ )
+ );
+
+ $this->assertEquals($message->getSubject(), $subject);
+ $this->assertThat($message->getRawMessage(), $assert);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclHasAccess()
+ {
+ $this->prepareRequest();
+
+ parent::testAclHasAccess();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclNoAccess()
+ {
+ $this->prepareRequest();
+
+ parent::testAclNoAccess();
+ }
+
+ /**
+ * @param string $incrementalId
+ * @return OrderInterface|null
+ */
+ private function getOrder(string $incrementalId)
+ {
+ /** @var SearchCriteria $searchCriteria */
+ $searchCriteria = $this->_objectManager->create(SearchCriteriaBuilder::class)
+ ->addFilter(OrderInterface::INCREMENT_ID, $incrementalId)
+ ->create();
+
+ $orders = $this->orderRepository->getList($searchCriteria)->getItems();
+ /** @var OrderInterface|null $order */
+ $order = reset($orders);
+
+ return $order;
+ }
+
+ /**
+ * @return OrderInterface|null
+ */
+ private function prepareRequest()
+ {
+ $order = $this->getOrder('100000001');
+ $this->getRequest()->setParams(['order_id' => $order->getEntityId()]);
+
+ return $order;
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AbstractInvoiceControllerTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AbstractInvoiceControllerTest.php
new file mode 100644
index 0000000000000..3ba54418b6c26
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AbstractInvoiceControllerTest.php
@@ -0,0 +1,92 @@
+transportBuilder = $this->_objectManager->get(TransportBuilderMock::class);
+ $this->orderRepository = $this->_objectManager->get(OrderRepository::class);
+ $this->formKey = $this->_objectManager->get(FormKey::class);
+ }
+
+ /**
+ * @param string $incrementalId
+ * @return OrderInterface|null
+ */
+ protected function getOrder(string $incrementalId)
+ {
+ /** @var SearchCriteria $searchCriteria */
+ $searchCriteria = $this->_objectManager->create(SearchCriteriaBuilder::class)
+ ->addFilter(OrderInterface::INCREMENT_ID, $incrementalId)
+ ->create();
+
+ $orders = $this->orderRepository->getList($searchCriteria)->getItems();
+ /** @var OrderInterface $order */
+ $order = reset($orders);
+
+ return $order;
+ }
+
+ /**
+ * @param OrderInterface $order
+ * @return InvoiceInterface
+ */
+ protected function getInvoiceByOrder(OrderInterface $order): InvoiceInterface
+ {
+ /** @var \Magento\Sales\Model\ResourceModel\Order\Invoice\Collection $invoiceCollection */
+ $invoiceCollection = $this->_objectManager->create(
+ \Magento\Sales\Model\ResourceModel\Order\Invoice\CollectionFactory::class
+ )->create();
+
+ /** @var InvoiceInterface $invoice */
+ $invoice = $invoiceCollection
+ ->setOrderFilter($order)
+ ->setPageSize(1)
+ ->getFirstItem();
+
+ return $invoice;
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AddCommentTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AddCommentTest.php
new file mode 100644
index 0000000000000..81e1dd7afc496
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/AddCommentTest.php
@@ -0,0 +1,103 @@
+prepareRequest(
+ [
+ 'comment' => ['comment' => $comment, 'is_customer_notified' => true],
+ ]
+ );
+ $this->dispatch('backend/sales/order_invoice/addComment');
+
+ $html = $this->getResponse()->getBody();
+ $this->assertContains($comment, $html);
+
+ $message = $this->transportBuilder->getSentMessage();
+ $subject = __('Update to your %1 invoice', $order->getStore()->getFrontendName())->render();
+ $messageConstraint = $this->logicalAnd(
+ new StringContains($order->getBillingAddress()->getName()),
+ new RegularExpression(
+ sprintf(
+ "/Your order #%s has been updated with a status of.*%s/",
+ $order->getIncrementId(),
+ $order->getFrontendStatusLabel()
+ )
+ ),
+ new StringContains($comment)
+ );
+
+ $this->assertEquals($message->getSubject(), $subject);
+ $this->assertThat($message->getRawMessage(), $messageConstraint);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclHasAccess()
+ {
+ $this->prepareRequest(['comment' => ['comment' => 'Comment']]);
+
+ parent::testAclHasAccess();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclNoAccess()
+ {
+ $this->prepareRequest(['comment' => ['comment' => 'Comment']]);
+
+ parent::testAclNoAccess();
+ }
+
+ /**
+ * @param array $params
+ * @return \Magento\Sales\Api\Data\OrderInterface|null
+ */
+ private function prepareRequest(array $params = [])
+ {
+ $order = $this->getOrder('100000001');
+ $invoice = $this->getInvoiceByOrder($order);
+
+ $this->getRequest()->setMethod('POST');
+ $this->getRequest()->setParams(
+ [
+ 'id' => $invoice->getEntityId(),
+ 'form_key' => $this->formKey->getFormKey(),
+ ]
+ );
+
+ $data = $params ?? [];
+ $this->getRequest()->setPostValue($data);
+
+ return $order;
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/EmailTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/EmailTest.php
new file mode 100644
index 0000000000000..85223528ec82a
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/EmailTest.php
@@ -0,0 +1,88 @@
+getOrder('100000001');
+ $invoice = $this->getInvoiceByOrder($order);
+
+ $this->getRequest()->setParams(['invoice_id' => $invoice->getEntityId()]);
+ $this->dispatch('backend/sales/order_invoice/email');
+
+ $this->assertSessionMessages(
+ $this->equalTo([(string)__('You sent the message.')]),
+ \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
+ );
+
+ $redirectUrl = sprintf(
+ 'sales/invoice/view/order_id/%s/invoice_id/%s',
+ $order->getEntityId(),
+ $invoice->getEntityId()
+ );
+ $this->assertRedirect($this->stringContains($redirectUrl));
+
+ $message = $this->transportBuilder->getSentMessage();
+ $subject = __('Invoice for your %1 order', $order->getStore()->getFrontendName())->render();
+ $messageConstraint = $this->logicalAnd(
+ new StringContains($invoice->getBillingAddress()->getName()),
+ new StringContains(
+ 'Thank you for your order from ' . $invoice->getStore()->getFrontendName()
+ ),
+ new StringContains(
+ "Your Invoice #{$invoice->getIncrementId()} for Order #{$order->getIncrementId()}"
+ )
+ );
+
+ $this->assertEquals($message->getSubject(), $subject);
+ $this->assertThat($message->getRawMessage(), $messageConstraint);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclHasAccess()
+ {
+ $order = $this->getOrder('100000001');
+ $invoice = $this->getInvoiceByOrder($order);
+ $this->uri .= '/invoice_id/' . $invoice->getEntityId();
+
+ parent::testAclHasAccess();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclNoAccess()
+ {
+ $order = $this->getOrder('100000001');
+ $invoice = $this->getInvoiceByOrder($order);
+ $this->uri .= '/invoice_id/' . $invoice->getEntityId();
+
+ parent::testAclNoAccess();
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php
new file mode 100644
index 0000000000000..68074e38d9a39
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Controller/Adminhtml/Order/Invoice/SaveTest.php
@@ -0,0 +1,97 @@
+prepareRequest(['invoice' => ['send_email' => true]]);
+ $this->dispatch('backend/sales/order_invoice/save');
+
+ $this->assertSessionMessages(
+ $this->equalTo([(string)__('The invoice has been created.')]),
+ \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
+ );
+ $this->assertRedirect($this->stringContains('sales/order/view/order_id/' . $order->getEntityId()));
+
+ $invoice = $this->getInvoiceByOrder($order);
+ $message = $this->transportBuilder->getSentMessage();
+ $subject = __('Invoice for your %1 order', $order->getStore()->getFrontendName())->render();
+ $messageConstraint = $this->logicalAnd(
+ new StringContains($invoice->getBillingAddress()->getName()),
+ new StringContains(
+ 'Thank you for your order from ' . $invoice->getStore()->getFrontendName()
+ ),
+ new StringContains(
+ "Your Invoice #{$invoice->getIncrementId()} for Order #{$order->getIncrementId()}"
+ )
+ );
+
+ $this->assertEquals($message->getSubject(), $subject);
+ $this->assertThat($message->getRawMessage(), $messageConstraint);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclHasAccess()
+ {
+ $this->prepareRequest();
+
+ parent::testAclHasAccess();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclNoAccess()
+ {
+ $this->prepareRequest();
+
+ parent::testAclNoAccess();
+ }
+
+ /**
+ * @param array $params
+ * @return \Magento\Sales\Api\Data\OrderInterface|null
+ */
+ private function prepareRequest(array $params = [])
+ {
+ $order = $this->getOrder('100000001');
+ $this->getRequest()->setMethod('POST');
+ $this->getRequest()->setParams(
+ [
+ 'order_id' => $order->getEntityId(),
+ 'form_key' => $this->formKey->getFormKey(),
+ ]
+ );
+
+ $data = $params ?? [];
+ $this->getRequest()->setPostValue($data);
+
+ return $order;
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreateTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreateTest.php
new file mode 100644
index 0000000000000..1035ce1592314
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Order/CreateTest.php
@@ -0,0 +1,100 @@
+objectManager = Bootstrap::getObjectManager();
+ $this->transportBuilder = $this->objectManager->get(TransportBuilderMock::class);
+ $this->quoteIdMaskFactory = $this->objectManager->get(QuoteIdMaskFactory::class);
+ $this->formKey = $this->objectManager->get(FormKey::class);
+ }
+
+ /**
+ * @magentoDataFixture Magento/Sales/_files/guest_quote_with_addresses.php
+ * @return void
+ */
+ public function testSendEmailOnOrderPlace(): void
+ {
+ /** @var Quote $quote */
+ $quote = $this->objectManager->create(Quote::class);
+ $quote->load('guest_quote', 'reserved_order_id');
+
+ $checkoutSession = $this->objectManager->get(CheckoutSession::class);
+ $checkoutSession->setQuoteId($quote->getId());
+
+ /** @var QuoteIdMask $quoteIdMask */
+ $quoteIdMask = $this->quoteIdMaskFactory->create();
+ $quoteIdMask->load($quote->getId(), 'quote_id');
+ $cartId = $quoteIdMask->getMaskedId();
+
+ /** @var GuestCartManagementInterface $cartManagement */
+ $cartManagement = $this->objectManager->get(GuestCartManagementInterface::class);
+ $orderId = $cartManagement->placeOrder($cartId);
+ $order = $this->objectManager->get(OrderRepository::class)->get($orderId);
+
+ $message = $this->transportBuilder->getSentMessage();
+ $subject = __('Your %1 order confirmation', $order->getStore()->getFrontendName())->render();
+ $assert = $this->logicalAnd(
+ new StringContains($order->getBillingAddress()->getName()),
+ new StringContains(
+ 'Thank you for your order from ' . $order->getStore()->getFrontendName()
+ ),
+ new StringContains(
+ "Your Order #{$order->getIncrementId()} "
+ )
+ );
+
+ $this->assertEquals($message->getSubject(), $subject);
+ $this->assertThat($message->getRawMessage(), $assert);
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/guest_quote_with_addresses.php b/dev/tests/integration/testsuite/Magento/Sales/_files/guest_quote_with_addresses.php
new file mode 100644
index 0000000000000..b8f2ca38e2489
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/_files/guest_quote_with_addresses.php
@@ -0,0 +1,68 @@
+loadArea(\Magento\Framework\App\Area::AREA_FRONTEND);
+
+$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
+/** @var \Magento\Catalog\Model\Product $product */
+$product = $objectManager->create(\Magento\Catalog\Model\Product::class);
+$product->setTypeId('simple')
+ ->setAttributeSetId($product->getDefaultAttributeSetId())
+ ->setName('Simple Product')
+ ->setSku('simple-product-guest-quote')
+ ->setPrice(10)
+ ->setTaxClassId(0)
+ ->setMetaTitle('meta title')
+ ->setMetaKeyword('meta keyword')
+ ->setMetaDescription('meta description')
+ ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
+ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
+ ->setStockData(
+ [
+ 'qty' => 100,
+ 'is_in_stock' => 1,
+ ]
+ )->save();
+
+$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+$product = $productRepository->get('simple-product-guest-quote');
+
+$addressData = reset($addresses);
+
+$billingAddress = $objectManager->create(
+ \Magento\Quote\Model\Quote\Address::class,
+ ['data' => $addressData]
+);
+$billingAddress->setAddressType('billing');
+
+$shippingAddress = clone $billingAddress;
+$shippingAddress->setId(null)->setAddressType('shipping');
+
+$store = $objectManager->get(\Magento\Store\Model\StoreManagerInterface::class)->getStore();
+
+/** @var \Magento\Quote\Model\Quote $quote */
+$quote = $objectManager->create(\Magento\Quote\Model\Quote::class);
+$quote->setCustomerIsGuest(true)
+ ->setStoreId($store->getId())
+ ->setReservedOrderId('guest_quote')
+ ->setBillingAddress($billingAddress)
+ ->setShippingAddress($shippingAddress)
+ ->addProduct($product);
+$quote->getPayment()->setMethod('checkmo');
+$quote->getShippingAddress()->setShippingMethod('flatrate_flatrate')->setCollectShippingRates(true);
+$quote->collectTotals();
+
+$quoteRepository = $objectManager->create(\Magento\Quote\Api\CartRepositoryInterface::class);
+$quoteRepository->save($quote);
+
+/** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */
+$quoteIdMask = $objectManager->create(\Magento\Quote\Model\QuoteIdMaskFactory::class)->create();
+$quoteIdMask->setQuoteId($quote->getId());
+$quoteIdMask->setDataChanges(true);
+$quoteIdMask->save();
diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/guest_quote_with_addresses_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/guest_quote_with_addresses_rollback.php
new file mode 100644
index 0000000000000..02c42153b72c3
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Sales/_files/guest_quote_with_addresses_rollback.php
@@ -0,0 +1,32 @@
+get(\Magento\Framework\Registry::class);
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+/** @var $quote \Magento\Quote\Model\Quote */
+$quote = $objectManager->create(\Magento\Quote\Model\Quote::class);
+$quote->load('guest_quote', 'reserved_order_id');
+if ($quote->getId()) {
+ $quote->delete();
+}
+
+/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
+$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+
+try {
+ $product = $productRepository->get('simple-product-guest-quote', false, null, true);
+ $productRepository->delete($product);
+} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
+ //Product already removed
+}
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AbstractShipmentControllerTest.php b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AbstractShipmentControllerTest.php
new file mode 100644
index 0000000000000..0a1926d58624c
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AbstractShipmentControllerTest.php
@@ -0,0 +1,92 @@
+transportBuilder = $this->_objectManager->get(TransportBuilderMock::class);
+ $this->orderRepository = $this->_objectManager->get(OrderRepository::class);
+ $this->formKey = $this->_objectManager->get(FormKey::class);
+ }
+
+ /**
+ * @param string $incrementalId
+ * @return OrderInterface|null
+ */
+ protected function getOrder(string $incrementalId)
+ {
+ /** @var SearchCriteria $searchCriteria */
+ $searchCriteria = $this->_objectManager->create(SearchCriteriaBuilder::class)
+ ->addFilter(OrderInterface::INCREMENT_ID, $incrementalId)
+ ->create();
+
+ $orders = $this->orderRepository->getList($searchCriteria)->getItems();
+ /** @var OrderInterface|null $order */
+ $order = reset($orders);
+
+ return $order;
+ }
+
+ /**
+ * @param OrderInterface $order
+ * @return ShipmentInterface
+ */
+ protected function getShipment(OrderInterface $order): ShipmentInterface
+ {
+ /** @var \Magento\Sales\Model\ResourceModel\Order\Shipment\Collection $shipmentCollection */
+ $shipmentCollection = $this->_objectManager->create(
+ \Magento\Sales\Model\ResourceModel\Order\Shipment\CollectionFactory::class
+ )->create();
+
+ /** @var ShipmentInterface $shipment */
+ $shipment = $shipmentCollection
+ ->setOrderFilter($order)
+ ->setPageSize(1)
+ ->getFirstItem();
+
+ return $shipment;
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AddCommentTest.php b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AddCommentTest.php
new file mode 100644
index 0000000000000..25a44bab62994
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/AddCommentTest.php
@@ -0,0 +1,102 @@
+prepareRequest(
+ [
+ 'comment' => ['comment' => $comment, 'is_customer_notified' => true],
+ ]
+ );
+ $this->dispatch('backend/admin/order_shipment/addComment');
+ $html = $this->getResponse()->getBody();
+ $this->assertContains($comment, $html);
+
+ $message = $this->transportBuilder->getSentMessage();
+ $subject =__('Update to your %1 shipment', $order->getStore()->getFrontendName())->render();
+ $messageConstraint = $this->logicalAnd(
+ new StringContains($order->getBillingAddress()->getName()),
+ new RegularExpression(
+ sprintf(
+ "/Your order #%s has been updated with a status of.*%s/",
+ $order->getIncrementId(),
+ $order->getFrontendStatusLabel()
+ )
+ ),
+ new StringContains($comment)
+ );
+
+ $this->assertEquals($message->getSubject(), $subject);
+ $this->assertThat($message->getRawMessage(), $messageConstraint);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclHasAccess()
+ {
+ $this->prepareRequest(['comment', ['comment' => 'Comment']]);
+
+ parent::testAclHasAccess();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclNoAccess()
+ {
+ $this->prepareRequest(['comment', ['comment' => 'Comment']]);
+
+ parent::testAclNoAccess();
+ }
+
+ /**
+ * @param array $params
+ * @return \Magento\Sales\Api\Data\OrderInterface|null
+ */
+ private function prepareRequest(array $params = [])
+ {
+ $order = $this->getOrder('100000001');
+ $shipment = $this->getShipment($order);
+
+ $this->getRequest()->setMethod('POST');
+ $this->getRequest()->setParams(
+ [
+ 'id' => $shipment->getEntityId(),
+ 'form_key' => $this->formKey->getFormKey(),
+ ]
+ );
+
+ $data = $params ?? [];
+ $this->getRequest()->setPostValue($data);
+
+ return $order;
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php
new file mode 100644
index 0000000000000..27b5bb02d4b22
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Shipping/Controller/Adminhtml/Order/Shipment/SaveTest.php
@@ -0,0 +1,97 @@
+prepareRequest(['shipment' => ['send_email' => true]]);
+ $this->dispatch('backend/admin/order_shipment/save');
+
+ $this->assertSessionMessages(
+ $this->equalTo([(string)__('The shipment has been created.')]),
+ \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
+ );
+ $this->assertRedirect($this->stringContains('sales/order/view/order_id/' . $order->getEntityId()));
+
+ $shipment = $this->getShipment($order);
+ $message = $this->transportBuilder->getSentMessage();
+ $subject = __('Your %1 order has shipped', $order->getStore()->getFrontendName())->render();
+ $messageConstraint = $this->logicalAnd(
+ new StringContains($order->getBillingAddress()->getName()),
+ new StringContains(
+ 'Thank you for your order from ' . $shipment->getStore()->getFrontendName()
+ ),
+ new StringContains(
+ "Your Shipment #{$shipment->getIncrementId()} for Order #{$order->getIncrementId()}"
+ )
+ );
+
+ $this->assertEquals($message->getSubject(), $subject);
+ $this->assertThat($message->getRawMessage(), $messageConstraint);
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclHasAccess()
+ {
+ $this->prepareRequest();
+
+ parent::testAclHasAccess();
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function testAclNoAccess()
+ {
+ $this->prepareRequest();
+
+ parent::testAclNoAccess();
+ }
+
+ /**
+ * @param array $params
+ * @return \Magento\Sales\Api\Data\OrderInterface|null
+ */
+ private function prepareRequest(array $params = [])
+ {
+ $order = $this->getOrder('100000001');
+ $this->getRequest()->setMethod('POST');
+ $this->getRequest()->setParams(
+ [
+ 'order_id' => $order->getEntityId(),
+ 'form_key' => $this->formKey->getFormKey(),
+ ]
+ );
+
+ $data = $params ?? [];
+ $this->getRequest()->setPostValue($data);
+
+ return $order;
+ }
+}
From 4c56bf0d06f43b5bb9aee51b5b4f3b9ed956c6a2 Mon Sep 17 00:00:00 2001
From: Joan He
Date: Tue, 29 Jan 2019 11:53:28 -0600
Subject: [PATCH 108/121] MC-13747: Update ShipmentValidationRequest to DHL 6.0
version
---
app/code/Magento/Dhl/Model/Carrier.php | 8 ++------
.../Dhl/Test/Unit/Model/_files/shipment_request.xml | 6 +-----
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php
index 685831138831c..42716d73373a2 100644
--- a/app/code/Magento/Dhl/Model/Carrier.php
+++ b/app/code/Magento/Dhl/Model/Carrier.php
@@ -1418,8 +1418,8 @@ protected function _doRequest()
' ';
+ ' xsi:schemaLocation="http://www.dhl.com ship-val-global-req-6.0.xsd"' .
+ ' schemaVersion="6.0" />';
$xml = $this->_xmlElFactory->create(['data' => $xmlStr]);
$nodeRequest = $xml->addChild('Request', '', '');
@@ -1433,10 +1433,6 @@ protected function _doRequest()
$nodeServiceHeader->addChild('SiteID', (string)$this->getConfigData('id'));
$nodeServiceHeader->addChild('Password', (string)$this->getConfigData('password'));
- $nodeMetaData = $nodeRequest->addChild('MetaData');
- $nodeMetaData->addChild('SoftwareName', $this->buildSoftwareName());
- $nodeMetaData->addChild('SoftwareVersion', $this->buildSoftwareVersion());
-
$originRegion = $this->getCountryParams(
$this->_scopeConfig->getValue(
Shipment::XML_PATH_STORE_COUNTRY_ID,
diff --git a/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml b/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml
index e93753368f834..d411041c96072 100644
--- a/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml
+++ b/app/code/Magento/Dhl/Test/Unit/Model/_files/shipment_request.xml
@@ -6,7 +6,7 @@
*/
-->
+ xsi:schemaLocation="http://www.dhl.com ship-val-global-req-6.0.xsd" schemaVersion="6.0">
currentTime
@@ -14,10 +14,6 @@
some ID
some password
-
- Software_Product_Name_30_Char_
- 10Char_Ver
-
CHECKED
N
From 6e2f29c2946806478586b8f94ef37d63d392715f Mon Sep 17 00:00:00 2001
From: Yaroslav Rogoza
Date: Wed, 30 Jan 2019 15:38:56 +0100
Subject: [PATCH 109/121] Removed unnecessary annotation
---
.../testsuite/Magento/GraphQl/Quote/GetCartTest.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 2cd100fc0f758..e837afc65481e 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
@@ -1,4 +1,4 @@
-
Date: Wed, 30 Jan 2019 10:30:26 -0600
Subject: [PATCH 110/121] magento-engcom/magento2ce#2518: Fixed code style
issue
---
.../base/web/js/form/element/post-code.js | 4 +-
.../blank/web/css/source/_sections.less | 17 ++++----
.../luma/web/css/source/_sections.less | 39 ++++++++++---------
3 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
index b8bab2f72f38a..1b6dd9f1c57ec 100644
--- a/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
+++ b/app/code/Magento/Ui/view/base/web/js/form/element/post-code.js
@@ -33,11 +33,11 @@ define([
}
option = options[value];
-
+
if (!option) {
return;
}
-
+
if (option['is_zipcode_optional']) {
this.error(false);
this.validation = _.omit(this.validation, 'required-entry');
diff --git a/app/design/frontend/Magento/blank/web/css/source/_sections.less b/app/design/frontend/Magento/blank/web/css/source/_sections.less
index 25f8c71f22dd5..1eee47bda817c 100644
--- a/app/design/frontend/Magento/blank/web/css/source/_sections.less
+++ b/app/design/frontend/Magento/blank/web/css/source/_sections.less
@@ -31,16 +31,19 @@
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
.product.data.items {
.lib-data-accordion();
+
.data.item {
display: block;
}
- .item.title {
- >.switch{
- padding: 1px 15px 1px;
+
+ .item.title {
+ > .switch {
+ padding: 1px 15px 1px;
+ }
+ }
+
+ > .item.content {
+ padding: 10px 15px 30px;
}
- }
- >.item.content{
- padding: 10px 15px 30px;
- }
}
}
diff --git a/app/design/frontend/Magento/luma/web/css/source/_sections.less b/app/design/frontend/Magento/luma/web/css/source/_sections.less
index 38b936c83cb95..95769c4f4b6ba 100644
--- a/app/design/frontend/Magento/luma/web/css/source/_sections.less
+++ b/app/design/frontend/Magento/luma/web/css/source/_sections.less
@@ -19,16 +19,16 @@
a {
position: relative;
.lib-icon-font(
- @_icon-font-content: @icon-down,
- @_icon-font-size: @font-size__base,
- @_icon-font-line-height: @icon-font__line-height,
- @_icon-font-color: @icon-font__color,
- @_icon-font-color-hover: @icon-font__color-hover,
- @_icon-font-color-active: @icon-font__color-active,
- @_icon-font-margin: @icon-font__margin,
- @_icon-font-vertical-align: @icon-font__vertical-align,
- @_icon-font-position: after,
- @_icon-font-display: false
+ @_icon-font-content: @icon-down,
+ @_icon-font-size: @font-size__base,
+ @_icon-font-line-height: @icon-font__line-height,
+ @_icon-font-color: @icon-font__color,
+ @_icon-font-color-hover: @icon-font__color-hover,
+ @_icon-font-color-active: @icon-font__color-active,
+ @_icon-font-margin: @icon-font__margin,
+ @_icon-font-vertical-align: @icon-font__vertical-align,
+ @_icon-font-position: after,
+ @_icon-font-display: false
);
&:after {
@@ -77,14 +77,15 @@
}
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
- .product.data.items{
- .item.title {
- >.switch{
- padding: 1px 15px 1px;
- }
- }
- >.item.content{
- padding: 10px 15px 30px;
+ .product.data.items {
+ .item.title {
+ > .switch {
+ padding: 1px 15px 1px;
+ }
+ }
+
+ > .item.content {
+ padding: 10px 15px 30px;
+ }
}
- }
}
From 69308c00554bba262883763d4ccbe180b10c0719 Mon Sep 17 00:00:00 2001
From: Oleksandr Miroshnichenko
Date: Wed, 30 Jan 2019 16:40:30 -0600
Subject: [PATCH 111/121] MC-11043: Flaky MFTF Test - MAGETWO-93767: Use saved
for Braintree credit card on checkout with selecting billing address
---
.../Mftf/ActionGroup/StorefrontFillCartDataActionGroup.xml | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/StorefrontFillCartDataActionGroup.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/StorefrontFillCartDataActionGroup.xml
index bc6d6c2b46dc9..bf06bc7df5201 100644
--- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/StorefrontFillCartDataActionGroup.xml
+++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/StorefrontFillCartDataActionGroup.xml
@@ -6,24 +6,27 @@
*/
-->
+ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
+
+
+
+
-
\ No newline at end of file
From d6a23379f7594e5189f93671181672c5add3e02d Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Wed, 30 Jan 2019 17:29:05 +0300
Subject: [PATCH 112/121] MAGETWO-96411: [2.3.x] Default addresses not selected
when checking out from cart
- Fixed MFTF test;
---
.../Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml
index 2cc21df85ab67..4b3e18fb31877 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/ZeroSubtotalOrdersWithProcessingStatusTest.xml
@@ -36,7 +36,6 @@
-
@@ -99,5 +98,6 @@
+
From 21fb25a6ee34e5842c0d05997c6e2054a87ebb83 Mon Sep 17 00:00:00 2001
From: Yauhen_Lyskavets
Date: Fri, 28 Sep 2018 14:03:50 +0300
Subject: [PATCH 113/121] MAGETWO-91676: Model related data missing in order
rest api
- Fix added
- Fix unit tests added
---
app/code/Magento/Sales/Model/Order.php | 31 ++++-
.../Sales/Test/Unit/Model/OrderTest.php | 116 +++++++++++++++++-
2 files changed, 137 insertions(+), 10 deletions(-)
diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php
index a9c14be8675ab..e71b60427e9f2 100644
--- a/app/code/Magento/Sales/Model/Order.php
+++ b/app/code/Magento/Sales/Model/Order.php
@@ -23,6 +23,8 @@
use Magento\Sales\Model\ResourceModel\Order\Shipment\Collection as ShipmentCollection;
use Magento\Sales\Model\ResourceModel\Order\Shipment\Track\Collection as TrackCollection;
use Magento\Sales\Model\ResourceModel\Order\Status\History\Collection as HistoryCollection;
+use Magento\Sales\Api\OrderItemRepositoryInterface;
+use Magento\Framework\Api\SearchCriteriaBuilder;
/**
* Order model
@@ -286,6 +288,16 @@ class Order extends AbstractModel implements EntityInterface, OrderInterface
*/
private $productOption;
+ /**
+ * @var OrderItemRepositoryInterface
+ */
+ private $itemRepository;
+
+ /**
+ * @var SearchCriteriaBuilder
+ */
+ private $searchCriteriaBuilder;
+
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
@@ -316,6 +328,8 @@ class Order extends AbstractModel implements EntityInterface, OrderInterface
* @param array $data
* @param ResolverInterface $localeResolver
* @param ProductOption|null $productOption
+ * @param OrderItemRepositoryInterface $itemRepository
+ * @param SearchCriteriaBuilder $searchCriteriaBuilder
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
@@ -347,7 +361,9 @@ public function __construct(
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = [],
ResolverInterface $localeResolver = null,
- ProductOption $productOption = null
+ ProductOption $productOption = null,
+ OrderItemRepositoryInterface $itemRepository = null,
+ SearchCriteriaBuilder $searchCriteriaBuilder = null
) {
$this->_storeManager = $storeManager;
$this->_orderConfig = $orderConfig;
@@ -371,6 +387,10 @@ public function __construct(
$this->priceCurrency = $priceCurrency;
$this->localeResolver = $localeResolver ?: ObjectManager::getInstance()->get(ResolverInterface::class);
$this->productOption = $productOption ?: ObjectManager::getInstance()->get(ProductOption::class);
+ $this->itemRepository = $itemRepository ?: ObjectManager::getInstance()
+ ->get(OrderItemRepositoryInterface::class);
+ $this->searchCriteriaBuilder = $searchCriteriaBuilder ?: ObjectManager::getInstance()
+ ->get(SearchCriteriaBuilder::class);
parent::__construct(
$context,
@@ -668,7 +688,7 @@ private function canCreditmemoForZeroTotalRefunded($totalRefunded)
return true;
}
-
+
/**
* Retrieve credit memo for zero total availability.
*
@@ -2076,9 +2096,12 @@ public function getIncrementId()
public function getItems()
{
if ($this->getData(OrderInterface::ITEMS) == null) {
+ $this->searchCriteriaBuilder->addFilter(OrderItemInterface::ORDER_ID, $this->getId());
+
+ $searchCriteria = $this->searchCriteriaBuilder->create();
$this->setData(
OrderInterface::ITEMS,
- $this->getItemsCollection()->getItems()
+ $this->itemRepository->getList($searchCriteria)->getItems()
);
}
return $this->getData(OrderInterface::ITEMS);
@@ -2919,7 +2942,7 @@ public function getDiscountTaxCompensationRefunded()
}
/**
- * Return hold_before_state
+ * Returns hold_before_state
*
* @return string|null
*/
diff --git a/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php b/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php
index f724136eb5154..faee759273295 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php
@@ -12,6 +12,10 @@
use Magento\Sales\Api\Data\OrderInterface;
use Magento\Sales\Model\Order;
use Magento\Sales\Model\ResourceModel\Order\Status\History\CollectionFactory as HistoryCollectionFactory;
+use Magento\Sales\Api\OrderItemRepositoryInterface;
+use Magento\Framework\Api\SearchCriteriaBuilder;
+use Magento\Framework\Api\SearchCriteria;
+use Magento\Sales\Api\Data\OrderItemSearchResultInterface;
/**
* Test class for \Magento\Sales\Model\Order
@@ -87,6 +91,16 @@ class OrderTest extends \PHPUnit\Framework\TestCase
*/
private $timezone;
+ /**
+ * @var OrderItemRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $itemRepository;
+
+ /**
+ * @var SearchCriteriaBuilder|\PHPUnit_Framework_MockObject_MockObject
+ */
+ private $searchCriteriaBuilder;
+
protected function setUp()
{
$helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
@@ -144,6 +158,15 @@ protected function setUp()
$this->eventManager = $this->createMock(\Magento\Framework\Event\Manager::class);
$context = $this->createPartialMock(\Magento\Framework\Model\Context::class, ['getEventDispatcher']);
$context->expects($this->any())->method('getEventDispatcher')->willReturn($this->eventManager);
+
+ $this->itemRepository = $this->getMockBuilder(OrderItemRepositoryInterface::class)
+ ->setMethods(['getList'])
+ ->disableOriginalConstructor()->getMockForAbstractClass();
+
+ $this->searchCriteriaBuilder = $this->getMockBuilder(SearchCriteriaBuilder::class)
+ ->setMethods(['addFilter', 'create'])
+ ->disableOriginalConstructor()->getMockForAbstractClass();
+
$this->order = $helper->getObject(
\Magento\Sales\Model\Order::class,
[
@@ -157,37 +180,80 @@ protected function setUp()
'productListFactory' => $this->productCollectionFactoryMock,
'localeResolver' => $this->localeResolver,
'timezone' => $this->timezone,
+ 'itemRepository' => $this->itemRepository,
+ 'searchCriteriaBuilder' => $this->searchCriteriaBuilder
]
);
}
- public function testGetItemById()
+ /**
+ * Test testGetItems method.
+ */
+ public function testGetItems()
{
- $realOrderItemId = 1;
- $fakeOrderItemId = 2;
+ $orderItems = [$this->item];
+
+ $this->searchCriteriaBuilder->expects($this->once())->method('addFilter')->willReturnSelf();
+
+ $searchCriteria = $this->getMockBuilder(SearchCriteria::class)
+ ->disableOriginalConstructor()->getMockForAbstractClass();
+ $this->searchCriteriaBuilder->expects($this->once())->method('create')->willReturn($searchCriteria);
- $orderItem = $this->createMock(\Magento\Sales\Model\Order\Item::class);
+ $itemsCollection = $this->getMockBuilder(OrderItemSearchResultInterface::class)
+ ->setMethods(['getItems'])
+ ->disableOriginalConstructor()->getMockForAbstractClass();
+ $itemsCollection->expects($this->once())->method('getItems')->willReturn($orderItems);
+ $this->itemRepository->expects($this->once())->method('getList')->willReturn($itemsCollection);
+ $this->assertEquals($orderItems, $this->order->getItems());
+ }
+
+ /**
+ * Prepare order item mock.
+ *
+ * @param int $orderId
+ * @return void
+ */
+ private function prepareOrderItem(int $orderId = 0)
+ {
$this->order->setData(
\Magento\Sales\Api\Data\OrderInterface::ITEMS,
[
- $realOrderItemId => $orderItem
+ $orderId => $this->item
]
);
+ }
- $this->assertEquals($orderItem, $this->order->getItemById($realOrderItemId));
+ /**
+ * Test GetItemById method.
+ *
+ * @return void
+ */
+ public function testGetItemById()
+ {
+ $realOrderItemId = 1;
+ $fakeOrderItemId = 2;
+
+ $this->prepareOrderItem($realOrderItemId);
+
+ $this->assertEquals($this->item, $this->order->getItemById($realOrderItemId));
$this->assertEquals(null, $this->order->getItemById($fakeOrderItemId));
}
/**
+ * Test GetItemByQuoteItemId method.
+ *
* @param int|null $gettingQuoteItemId
* @param int|null $quoteItemId
* @param string|null $result
*
* @dataProvider dataProviderGetItemByQuoteItemId
+ * @return void
*/
public function testGetItemByQuoteItemId($gettingQuoteItemId, $quoteItemId, $result)
{
+ $this->prepareOrderItem();
+
$this->item->expects($this->any())
->method('getQuoteItemId')
->willReturn($gettingQuoteItemId);
@@ -212,14 +278,19 @@ public function dataProviderGetItemByQuoteItemId()
}
/**
+ * Test getAllVisibleItems method.
+ *
* @param bool $isDeleted
* @param int|null $parentItemId
* @param array $result
*
* @dataProvider dataProviderGetAllVisibleItems
+ * @return void
*/
public function testGetAllVisibleItems($isDeleted, $parentItemId, array $result)
{
+ $this->prepareOrderItem();
+
$this->item->expects($this->once())
->method('isDeleted')
->willReturn($isDeleted);
@@ -263,8 +334,15 @@ public function testCanCancelIsPaymentReview()
$this->assertFalse($this->order->canCancel());
}
+ /**
+ * Test CanInvoice method.
+ *
+ * @return void
+ */
public function testCanInvoice()
{
+ $this->prepareOrderItem();
+
$this->item->expects($this->any())
->method('getQtyToInvoice')
->willReturn(42);
@@ -304,8 +382,15 @@ public function testCanNotInvoiceWhenActionInvoiceFlagIsFalse()
$this->assertFalse($this->order->canInvoice());
}
+ /**
+ * Test CanNotInvoice method when invoice is locked.
+ *
+ * @return void
+ */
public function testCanNotInvoiceWhenLockedInvoice()
{
+ $this->prepareOrderItem();
+
$this->item->expects($this->any())
->method('getQtyToInvoice')
->willReturn(42);
@@ -315,8 +400,15 @@ public function testCanNotInvoiceWhenLockedInvoice()
$this->assertFalse($this->order->canInvoice());
}
+ /**
+ * Test CanNotInvoice method when didn't have qty to invoice.
+ *
+ * @return void
+ */
public function testCanNotInvoiceWhenDidNotHaveQtyToInvoice()
{
+ $this->prepareOrderItem();
+
$this->item->expects($this->any())
->method('getQtyToInvoice')
->willReturn(0);
@@ -601,8 +693,15 @@ public function testCanCancelCanReviewPayment()
$this->assertFalse($this->order->canCancel());
}
+ /**
+ * Test CanCancelAllInvoiced method.
+ *
+ * @return void
+ */
public function testCanCancelAllInvoiced()
{
+ $this->prepareOrderItem();
+
$paymentMock = $this->getMockBuilder(\Magento\Sales\Model\ResourceModel\Order\Payment::class)
->disableOriginalConstructor()
->setMethods(['isDeleted', 'canReviewPayment', 'canFetchTransactionInfo', '__wakeUp'])
@@ -662,11 +761,16 @@ public function testCanCancelState()
}
/**
+ * Test CanCancelActionFlag method.
+ *
* @param bool $cancelActionFlag
* @dataProvider dataProviderActionFlag
+ * @return void
*/
public function testCanCancelActionFlag($cancelActionFlag)
{
+ $this->prepareOrderItem();
+
$paymentMock = $this->getMockBuilder(\Magento\Sales\Model\ResourceModel\Order\Payment::class)
->disableOriginalConstructor()
->setMethods(['isDeleted', 'canReviewPayment', 'canFetchTransactionInfo', '__wakeUp'])
From d17a99f22f274af0136530227b77b1ec8829d3ef Mon Sep 17 00:00:00 2001
From: Oksana_Kremen
Date: Thu, 24 Jan 2019 19:04:08 +0200
Subject: [PATCH 114/121] MAGETWO-91676: Model related data missing in order
rest api
- Fix for unit tests
---
app/code/Magento/Sales/Test/Unit/Model/OrderTest.php | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php b/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php
index faee759273295..61ae9ae45e12f 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/OrderTest.php
@@ -11,6 +11,7 @@
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
use Magento\Sales\Api\Data\OrderInterface;
use Magento\Sales\Model\Order;
+use Magento\Sales\Model\ResourceModel\Order\Item\Collection;
use Magento\Sales\Model\ResourceModel\Order\Status\History\CollectionFactory as HistoryCollectionFactory;
use Magento\Sales\Api\OrderItemRepositoryInterface;
use Magento\Framework\Api\SearchCriteriaBuilder;
@@ -421,6 +422,7 @@ public function testCanNotInvoiceWhenDidNotHaveQtyToInvoice()
public function testCanCreditMemo()
{
$totalPaid = 10;
+ $this->prepareOrderItem();
$this->order->setTotalPaid($totalPaid);
$this->priceCurrency->expects($this->once())->method('round')->with($totalPaid)->willReturnArgument(0);
$this->assertTrue($this->order->canCreditmemo());
@@ -436,6 +438,7 @@ public function testCanCreditMemoForZeroTotal()
$grandTotal = 0;
$totalPaid = 0;
$totalRefunded = 0;
+ $this->prepareOrderItem();
$this->order->setGrandTotal($grandTotal);
$this->order->setTotalPaid($totalPaid);
$this->assertFalse($this->order->canCreditmemoForZeroTotal($totalRefunded));
@@ -444,6 +447,7 @@ public function testCanCreditMemoForZeroTotal()
public function testCanNotCreditMemoWithTotalNull()
{
$totalPaid = 0;
+ $this->prepareOrderItem();
$this->order->setTotalPaid($totalPaid);
$this->priceCurrency->expects($this->once())->method('round')->with($totalPaid)->willReturnArgument(0);
$this->assertFalse($this->order->canCreditmemo());
@@ -455,6 +459,7 @@ public function testCanNotCreditMemoWithAdjustmentNegative()
$adjustmentNegative = 10;
$totalRefunded = 90;
+ $this->prepareOrderItem();
$this->order->setTotalPaid($totalPaid);
$this->order->setTotalRefunded($totalRefunded);
$this->order->setAdjustmentNegative($adjustmentNegative);
@@ -469,6 +474,7 @@ public function testCanCreditMemoWithAdjustmentNegativeLowerThanTotalPaid()
$adjustmentNegative = 9;
$totalRefunded = 90;
+ $this->prepareOrderItem();
$this->order->setTotalPaid($totalPaid);
$this->order->setTotalRefunded($totalRefunded);
$this->order->setAdjustmentNegative($adjustmentNegative);
From 230e0840eae8832d65f6ef5c9a39cdc8f3c91c6d Mon Sep 17 00:00:00 2001
From: RomanKis
Date: Thu, 31 Jan 2019 17:19:30 +0200
Subject: [PATCH 115/121] graphQl-336:
Magento/CatalogGraphQl/Model/Category/LevelCalculator class has fields
declared dynamically
---
.../CatalogGraphQl/Model/Category/LevelCalculator.php | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/LevelCalculator.php b/app/code/Magento/CatalogGraphQl/Model/Category/LevelCalculator.php
index 0401e1c42331e..f587be245c99d 100644
--- a/app/code/Magento/CatalogGraphQl/Model/Category/LevelCalculator.php
+++ b/app/code/Magento/CatalogGraphQl/Model/Category/LevelCalculator.php
@@ -15,6 +15,16 @@
*/
class LevelCalculator
{
+ /**
+ * @var ResourceConnection
+ */
+ private $resourceConnection;
+
+ /**
+ * @var Category
+ */
+ private $resourceCategory;
+
/**
* @param ResourceConnection $resourceConnection
* @param Category $resourceCategory
@@ -39,6 +49,7 @@ public function calculate(int $rootCategoryId) : int
$select = $connection->select()
->from($this->resourceConnection->getTableName('catalog_category_entity'), 'level')
->where($this->resourceCategory->getLinkField() . " = ?", $rootCategoryId);
+
return (int) $connection->fetchOne($select);
}
}
From cc1cadf00e16c34fb4e313bc7bacfcdbb143aaf0 Mon Sep 17 00:00:00 2001
From: Joan He
Date: Thu, 31 Jan 2019 15:56:06 -0600
Subject: [PATCH 116/121] MC-13644: Default billing and default shipping
address lose their status after edit
---
.../Customer/Controller/Address/FormPost.php | 14 ++++++++--
.../StorefrontUpdateCustomerAddressTest.xml | 3 ---
.../Unit/Controller/Address/FormPostTest.php | 26 ++++++++++++-------
3 files changed, 28 insertions(+), 15 deletions(-)
diff --git a/app/code/Magento/Customer/Controller/Address/FormPost.php b/app/code/Magento/Customer/Controller/Address/FormPost.php
index 217af0abd7592..0fc0c4611ab9c 100644
--- a/app/code/Magento/Customer/Controller/Address/FormPost.php
+++ b/app/code/Magento/Customer/Controller/Address/FormPost.php
@@ -120,8 +120,18 @@ protected function _extractAddress()
\Magento\Customer\Api\Data\AddressInterface::class
);
$addressDataObject->setCustomerId($this->_getSession()->getCustomerId())
- ->setIsDefaultBilling($this->getRequest()->getParam('default_billing', false))
- ->setIsDefaultShipping($this->getRequest()->getParam('default_shipping', false));
+ ->setIsDefaultBilling(
+ $this->getRequest()->getParam(
+ 'default_billing',
+ isset($existingAddressData['default_billing']) ? $existingAddressData['default_billing'] : false
+ )
+ )
+ ->setIsDefaultShipping(
+ $this->getRequest()->getParam(
+ 'default_shipping',
+ isset($existingAddressData['default_shipping']) ? $existingAddressData['default_shipping'] : false
+ )
+ );
return $addressDataObject;
}
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest.xml
index d1b5fb2aa7d11..d9d1c9f2e05a0 100644
--- a/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Test/StorefrontUpdateCustomerAddressTest.xml
@@ -18,9 +18,6 @@
-
-
-
diff --git a/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php b/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php
index c2a795fc95016..7ae55f44421c7 100644
--- a/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Controller/Address/FormPostTest.php
@@ -455,14 +455,20 @@ public function testExecute(
$regionCode,
$newRegionId,
$newRegion,
- $newRegionCode
+ $newRegionCode,
+ $existingDefaultBilling = false,
+ $existingDefaultShipping = false,
+ $setDefaultBilling = false,
+ $setDefaultShipping = false
): void {
$existingAddressData = [
'country_id' => $countryId,
'region_id' => $regionId,
'region' => $region,
'region_code' => $regionCode,
- 'customer_id' => $customerId
+ 'customer_id' => $customerId,
+ 'default_billing' => $existingDefaultBilling,
+ 'default_shipping' => $existingDefaultShipping,
];
$newAddressData = [
'country_id' => $countryId,
@@ -486,8 +492,8 @@ public function testExecute(
->method('getParam')
->willReturnMap([
['id', null, $addressId],
- ['default_billing', false, $addressId],
- ['default_shipping', false, $addressId],
+ ['default_billing', $existingDefaultBilling, $setDefaultBilling],
+ ['default_shipping', $existingDefaultShipping, $setDefaultShipping],
]);
$this->addressRepository->expects($this->once())
@@ -565,11 +571,11 @@ public function testExecute(
->willReturnSelf();
$this->addressData->expects($this->once())
->method('setIsDefaultBilling')
- ->with()
+ ->with($setDefaultBilling)
->willReturnSelf();
$this->addressData->expects($this->once())
->method('setIsDefaultShipping')
- ->with()
+ ->with($setDefaultShipping)
->willReturnSelf();
$this->messageManager->expects($this->once())
@@ -628,11 +634,11 @@ public function dataProviderTestExecute(): array
[1, 1, 1, 2, null, null, 12, null, null],
[1, 1, 1, 2, 'Alaska', null, 12, null, 'CA'],
- [1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null],
+ [1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null, true, true, true, false],
- [1, 1, 1, 2, null, null, 12, null, null],
- [1, 1, 1, 2, 'Alaska', null, 12, null, 'CA'],
- [1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null],
+ [1, 1, 1, 2, null, null, 12, null, null, false, false, true, false],
+ [1, 1, 1, 2, 'Alaska', null, 12, null, 'CA', true, false, true, false],
+ [1, 1, 1, 2, 'Alaska', 'AK', 12, 'California', null, true, true, true, true],
];
}
From 9551799d2237337ec15c92238c27d85800d4ae0f Mon Sep 17 00:00:00 2001
From: Valerii Naida
Date: Thu, 31 Jan 2019 17:59:21 -0600
Subject: [PATCH 117/121] GraphQL-248: [My Account] Create customer account
---
.../Magento/CustomerGraphQl/Model/Customer/CreateAccount.php | 5 +++++
.../CustomerGraphQl/Model/Customer/SetUpUserContext.php | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php b/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php
index 355bd1c6ec853..e21e0330bc5a2 100644
--- a/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php
+++ b/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php
@@ -1,4 +1,9 @@
Date: Thu, 31 Jan 2019 19:27:03 -0600
Subject: [PATCH 118/121] GraphQL-248: [My Account] Create customer account
-- fix static tests
---
.../Model/ConfigurableProductTypeResolver.php | 7 +++----
.../CustomerGraphQl/Model/Customer/CreateAccount.php | 4 +++-
.../CustomerGraphQl/Model/Customer/SetUpUserContext.php | 2 ++
.../testsuite/Magento/GraphQl/Quote/GetCartTest.php | 1 -
.../testsuite/Magento/Checkout/_files/active_quote.php | 2 +-
5 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php b/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php
index f65a331ab803c..eda2ce11daaf6 100644
--- a/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php
+++ b/app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php
@@ -11,7 +11,7 @@
use Magento\ConfigurableProduct\Model\Product\Type\Configurable as Type;
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
class ConfigurableProductTypeResolver implements TypeResolverInterface
{
@@ -21,13 +21,12 @@ class ConfigurableProductTypeResolver implements TypeResolverInterface
const TYPE_RESOLVER = 'ConfigurableProduct';
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
- public function resolveType(array $data) : string
+ public function resolveType(array $data): string
{
if (isset($data['type_id']) && $data['type_id'] == Type::TYPE_CODE) {
return self::TYPE_RESOLVER;
-
}
return '';
}
diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php b/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php
index e21e0330bc5a2..4a4b5c863528b 100644
--- a/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php
+++ b/app/code/Magento/CustomerGraphQl/Model/Customer/CreateAccount.php
@@ -59,12 +59,14 @@ public function __construct(
}
/**
+ * Creates new customer account
+ *
* @param array $args
* @return CustomerInterface
* @throws LocalizedException
* @throws NoSuchEntityException
*/
- public function execute($args)
+ public function execute(array $args): CustomerInterface
{
$customerDataObject = $this->customerFactory->create();
$this->dataObjectHelper->populateWithArray(
diff --git a/app/code/Magento/CustomerGraphQl/Model/Customer/SetUpUserContext.php b/app/code/Magento/CustomerGraphQl/Model/Customer/SetUpUserContext.php
index 720034e06c331..1fcf1c0d7c1c3 100644
--- a/app/code/Magento/CustomerGraphQl/Model/Customer/SetUpUserContext.php
+++ b/app/code/Magento/CustomerGraphQl/Model/Customer/SetUpUserContext.php
@@ -17,6 +17,8 @@
class SetUpUserContext
{
/**
+ * Set up user context after creating new customer account
+ *
* @param ContextInterface $context
* @param CustomerInterface $customer
*/
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 e837afc65481e..78204aaa567b0 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/GetCartTest.php
@@ -85,7 +85,6 @@ public function testGetCartFromAnotherCustomer()
'reserved_order_id'
);
-
$maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
$query = $this->prepareGetCartQuery($maskedQuoteId);
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php
index 6b569f37a1a9f..52437ef828afd 100644
--- a/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php
+++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/active_quote.php
@@ -16,4 +16,4 @@
->create();
$quoteIdMask->setQuoteId($quote->getId());
$quoteIdMask->setDataChanges(true);
-$quoteIdMask->save();
\ No newline at end of file
+$quoteIdMask->save();
From ed37f5ba3c669f14ed7613cbd9ac00770e481658 Mon Sep 17 00:00:00 2001
From: Joan He
Date: Thu, 31 Jan 2019 20:47:10 -0600
Subject: [PATCH 119/121] MC-13644: Default billing and default shipping
address lose their status after edit
- Fix static test failure
---
app/code/Magento/Customer/Controller/Address/FormPost.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/code/Magento/Customer/Controller/Address/FormPost.php b/app/code/Magento/Customer/Controller/Address/FormPost.php
index 0fc0c4611ab9c..25618e3129160 100644
--- a/app/code/Magento/Customer/Controller/Address/FormPost.php
+++ b/app/code/Magento/Customer/Controller/Address/FormPost.php
@@ -26,6 +26,8 @@
use Magento\Framework\View\Result\PageFactory;
/**
+ * Customer Address Form Post Controller
+ *
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class FormPost extends \Magento\Customer\Controller\Address implements HttpPostActionInterface
From 45df4a71d2a96a3cb00822509b1b11fa48c12fd3 Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Fri, 1 Feb 2019 15:49:56 +0300
Subject: [PATCH 120/121] MAGETWO-96406: [2.3.x] Swatch Attribute is not
displayed in the Widget CMS
- Update fixes based on comments
---
.../Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml
index b45339edecd86..674b2b66cd0c0 100644
--- a/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml
+++ b/app/code/Magento/Swatches/Test/Mftf/Test/StorefrontSwatchAttributesDisplayInWidgetCMSTest.xml
@@ -28,6 +28,9 @@
+
+
+
From 30e84d398230d8b2cc2aaada731636a97f9dd974 Mon Sep 17 00:00:00 2001
From: Veronika Kurochkina
Date: Fri, 1 Feb 2019 21:40:03 +0300
Subject: [PATCH 121/121] MC-13779: [MFTF]
CreateAnAdminOrderUsingBraintreePaymentTest1 randomly fails on jenkins
---
.../Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml
index 2376fe9f8006f..88bcf22a4b79f 100644
--- a/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml
+++ b/app/code/Magento/Braintree/Test/Mftf/Test/CreateAnAdminOrderUsingBraintreePaymentTest1.xml
@@ -17,6 +17,9 @@
+
+
+