From 38dbbe2b4653a6372bb68ca90686b39927614d40 Mon Sep 17 00:00:00 2001 From: Yevhen Sentiabov Date: Wed, 26 Sep 2018 15:46:24 +0300 Subject: [PATCH 001/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - Fixed discounts deltas calculation --- .../Model/Order/Creditmemo/Total/Shipping.php | 11 ++- .../Model/Order/Creditmemo/Total/Tax.php | 13 ++-- .../Sales/Model/Order/Invoice/Total/Tax.php | 28 +++++--- .../Sales/Model/Service/CreditmemoService.php | 16 +++-- .../Model/Service/CreditmemoServiceTest.php | 70 +++++++++++-------- 5 files changed, 79 insertions(+), 59 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Shipping.php b/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Shipping.php index f00334f496b..f644d0c3a5a 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Shipping.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Shipping.php @@ -37,6 +37,8 @@ public function __construct( } /** + * Collects credit memo shipping totals. + * * @param \Magento\Sales\Model\Order\Creditmemo $creditmemo * @return $this * @throws \Magento\Framework\Exception\LocalizedException @@ -55,12 +57,10 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo) $orderShippingInclTax = $order->getShippingInclTax(); $orderBaseShippingInclTax = $order->getBaseShippingInclTax(); $allowedTaxAmount = $order->getShippingTaxAmount() - $order->getShippingTaxRefunded(); - $baseAllowedTaxAmount = $order->getBaseShippingTaxAmount() - $order->getBaseShippingTaxRefunded(); $allowedAmountInclTax = $allowedAmount + $allowedTaxAmount; - $baseAllowedAmountInclTax = $baseAllowedAmount + $baseAllowedTaxAmount; - - // for the credit memo - $shippingAmount = $baseShippingAmount = $shippingInclTax = $baseShippingInclTax = 0; + $baseAllowedAmountInclTax = $orderBaseShippingInclTax + - $order->getBaseShippingRefunded() + - $order->getBaseShippingTaxRefunded(); // Check if the desired shipping amount to refund was specified (from invoice or another source). if ($creditmemo->hasBaseShippingAmount()) { @@ -128,7 +128,6 @@ private function isSuppliedShippingAmountInclTax($order) /** * Get the Tax Config. - * In a future release, will become a constructor parameter. * * @return \Magento\Tax\Model\Config * diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php b/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php index a842c0470ad..5ab9469441b 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo/Total/Tax.php @@ -5,9 +5,14 @@ */ namespace Magento\Sales\Model\Order\Creditmemo\Total; +/** + * Collects credit memo taxes. + */ class Tax extends AbstractTotal { /** + * Collects credit memo taxes. + * * @param \Magento\Sales\Model\Order\Creditmemo $creditmemo * @return $this * @@ -79,18 +84,10 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo) $totalDiscountTaxCompensation += $invoice->getShippingDiscountTaxCompensationAmount() * $taxFactor; $baseTotalDiscountTaxCompensation += $invoice->getBaseShippingDiscountTaxCompensationAmnt() * $taxFactor; - $shippingDiscountTaxCompensationAmount = - $invoice->getShippingDiscountTaxCompensationAmount() * $taxFactor; - $baseShippingDiscountTaxCompensationAmount = - $invoice->getBaseShippingDiscountTaxCompensationAmnt() * $taxFactor; $shippingTaxAmount = $creditmemo->roundPrice($shippingTaxAmount); $baseShippingTaxAmount = $creditmemo->roundPrice($baseShippingTaxAmount, 'base'); $totalDiscountTaxCompensation = $creditmemo->roundPrice($totalDiscountTaxCompensation); $baseTotalDiscountTaxCompensation = $creditmemo->roundPrice($baseTotalDiscountTaxCompensation, 'base'); - $shippingDiscountTaxCompensationAmount = - $creditmemo->roundPrice($shippingDiscountTaxCompensationAmount); - $baseShippingDiscountTaxCompensationAmount = - $creditmemo->roundPrice($baseShippingDiscountTaxCompensationAmount, 'base'); if ($taxFactor < 1 && $invoice->getShippingTaxAmount() > 0) { $isPartialShippingRefunded = true; } diff --git a/app/code/Magento/Sales/Model/Order/Invoice/Total/Tax.php b/app/code/Magento/Sales/Model/Order/Invoice/Total/Tax.php index fd5c015d9db..6e12f10f0c6 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice/Total/Tax.php +++ b/app/code/Magento/Sales/Model/Order/Invoice/Total/Tax.php @@ -5,6 +5,9 @@ */ namespace Magento\Sales\Model\Order\Invoice\Total; +/** + * Collects invoice taxes. + */ class Tax extends AbstractTotal { /** @@ -69,11 +72,24 @@ public function collect(\Magento\Sales\Model\Order\Invoice $invoice) } } + $taxDiscountCompensationAmt = $totalDiscountTaxCompensation; + $baseTaxDiscountCompensationAmt = $baseTotalDiscountTaxCompensation; + $allowedDiscountTaxCompensation = $order->getDiscountTaxCompensationAmount() - + $order->getDiscountTaxCompensationInvoiced(); + $allowedBaseDiscountTaxCompensation = $order->getBaseDiscountTaxCompensationAmount() - + $order->getBaseDiscountTaxCompensationInvoiced(); + if ($this->_canIncludeShipping($invoice)) { $totalTax += $order->getShippingTaxAmount(); $baseTotalTax += $order->getBaseShippingTaxAmount(); $totalDiscountTaxCompensation += $order->getShippingDiscountTaxCompensationAmount(); $baseTotalDiscountTaxCompensation += $order->getBaseShippingDiscountTaxCompensationAmnt(); + + $allowedDiscountTaxCompensation += $order->getShippingDiscountTaxCompensationAmount() - + $order->getShippingDiscountTaxCompensationInvoiced(); + $allowedBaseDiscountTaxCompensation += $order->getBaseShippingDiscountTaxCompensationAmnt() - + $order->getBaseShippingDiscountTaxCompensationInvoiced(); + $invoice->setShippingTaxAmount($order->getShippingTaxAmount()); $invoice->setBaseShippingTaxAmount($order->getBaseShippingTaxAmount()); $invoice->setShippingDiscountTaxCompensationAmount($order->getShippingDiscountTaxCompensationAmount()); @@ -81,14 +97,6 @@ public function collect(\Magento\Sales\Model\Order\Invoice $invoice) } $allowedTax = $order->getTaxAmount() - $order->getTaxInvoiced(); $allowedBaseTax = $order->getBaseTaxAmount() - $order->getBaseTaxInvoiced(); - $allowedDiscountTaxCompensation = $order->getDiscountTaxCompensationAmount() + - $order->getShippingDiscountTaxCompensationAmount() - - $order->getDiscountTaxCompensationInvoiced() - - $order->getShippingDiscountTaxCompensationInvoiced(); - $allowedBaseDiscountTaxCompensation = $order->getBaseDiscountTaxCompensationAmount() + - $order->getBaseShippingDiscountTaxCompensationAmnt() - - $order->getBaseDiscountTaxCompensationInvoiced() - - $order->getBaseShippingDiscountTaxCompensationInvoiced(); if ($invoice->isLast()) { $totalTax = $allowedTax; @@ -107,8 +115,8 @@ public function collect(\Magento\Sales\Model\Order\Invoice $invoice) $invoice->setTaxAmount($totalTax); $invoice->setBaseTaxAmount($baseTotalTax); - $invoice->setDiscountTaxCompensationAmount($totalDiscountTaxCompensation); - $invoice->setBaseDiscountTaxCompensationAmount($baseTotalDiscountTaxCompensation); + $invoice->setDiscountTaxCompensationAmount($taxDiscountCompensationAmt); + $invoice->setBaseDiscountTaxCompensationAmount($baseTaxDiscountCompensationAmt); $invoice->setGrandTotal($invoice->getGrandTotal() + $totalTax + $totalDiscountTaxCompensation); $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $baseTotalTax + $baseTotalDiscountTaxCompensation); diff --git a/app/code/Magento/Sales/Model/Service/CreditmemoService.php b/app/code/Magento/Sales/Model/Service/CreditmemoService.php index e8f2e6e5305..a1bff966753 100644 --- a/app/code/Magento/Sales/Model/Service/CreditmemoService.php +++ b/app/code/Magento/Sales/Model/Service/CreditmemoService.php @@ -178,6 +178,8 @@ public function refund( } /** + * Checks if credit memo is available for refund. + * * @param \Magento\Sales\Api\Data\CreditmemoInterface $creditmemo * @return bool * @throws \Magento\Framework\Exception\LocalizedException @@ -200,7 +202,7 @@ protected function validateForRefund(\Magento\Sales\Api\Data\CreditmemoInterface throw new \Magento\Framework\Exception\LocalizedException( __( 'The most money available to refund is %1.', - $creditmemo->getOrder()->formatBasePrice($baseAvailableRefund) + $creditmemo->getOrder()->formatPriceTxt($baseAvailableRefund) ) ); } @@ -208,8 +210,9 @@ protected function validateForRefund(\Magento\Sales\Api\Data\CreditmemoInterface } /** - * @return \Magento\Sales\Model\Order\RefundAdapterInterface + * Initializes RefundAdapterInterface dependency. * + * @return \Magento\Sales\Model\Order\RefundAdapterInterface * @deprecated 100.1.3 */ private function getRefundAdapter() @@ -222,8 +225,9 @@ private function getRefundAdapter() } /** - * @return \Magento\Framework\App\ResourceConnection|mixed + * Initializes ResourceConnection dependency. * + * @return \Magento\Framework\App\ResourceConnection|mixed * @deprecated 100.1.3 */ private function getResource() @@ -236,8 +240,9 @@ private function getResource() } /** - * @return \Magento\Sales\Api\OrderRepositoryInterface + * Initializes OrderRepositoryInterface dependency. * + * @return \Magento\Sales\Api\OrderRepositoryInterface * @deprecated 100.1.3 */ private function getOrderRepository() @@ -250,8 +255,9 @@ private function getOrderRepository() } /** - * @return \Magento\Sales\Api\InvoiceRepositoryInterface + * Initializes InvoiceRepositoryInterface dependency. * + * @return \Magento\Sales\Api\InvoiceRepositoryInterface * @deprecated 100.1.3 */ private function getInvoiceRepository() diff --git a/app/code/Magento/Sales/Test/Unit/Model/Service/CreditmemoServiceTest.php b/app/code/Magento/Sales/Test/Unit/Model/Service/CreditmemoServiceTest.php index 2e668f0b0d6..68681c6c5a6 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Service/CreditmemoServiceTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Service/CreditmemoServiceTest.php @@ -3,10 +3,15 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Sales\Test\Unit\Model\Service; use Magento\Sales\Model\Order; +use Magento\Sales\Api\Data\CreditmemoInterface; +use PHPUnit_Framework_MockObject_MockObject as MockObject; + /** * Class CreditmemoServiceTest * @SuppressWarnings(PHPMD.CouplingBetweenObjects) @@ -14,34 +19,34 @@ class CreditmemoServiceTest extends \PHPUnit\Framework\TestCase { /** - * @var \Magento\Sales\Api\CreditmemoRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Sales\Api\CreditmemoRepositoryInterface|MockObject */ protected $creditmemoRepositoryMock; /** - * @var \Magento\Sales\Api\CreditmemoCommentRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Sales\Api\CreditmemoCommentRepositoryInterface|MockObject */ protected $creditmemoCommentRepositoryMock; /** - * @var \Magento\Framework\Api\SearchCriteriaBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Api\SearchCriteriaBuilder|MockObject */ protected $searchCriteriaBuilderMock; /** - * @var \Magento\Framework\Api\FilterBuilder|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Api\FilterBuilder|MockObject */ protected $filterBuilderMock; /** - * @var \Magento\Sales\Model\Order\CreditmemoNotifier|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Sales\Model\Order\CreditmemoNotifier|MockObject */ protected $creditmemoNotifierMock; /** - * @var \Magento\Framework\Pricing\PriceCurrencyInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Framework\Pricing\PriceCurrencyInterface|MockObject */ - private $priceCurrencyMock; + private $priceCurrency; /** * @var \Magento\Sales\Model\Service\CreditmemoService @@ -79,7 +84,7 @@ protected function setUp() ['setField', 'setValue', 'setConditionType', 'create'] ); $this->creditmemoNotifierMock = $this->createMock(\Magento\Sales\Model\Order\CreditmemoNotifier::class); - $this->priceCurrencyMock = $this->getMockBuilder(\Magento\Framework\Pricing\PriceCurrencyInterface::class) + $this->priceCurrency = $this->getMockBuilder(\Magento\Framework\Pricing\PriceCurrencyInterface::class) ->getMockForAbstractClass(); $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); @@ -91,7 +96,7 @@ protected function setUp() 'searchCriteriaBuilder' => $this->searchCriteriaBuilderMock, 'filterBuilder' => $this->filterBuilderMock, 'creditmemoNotifier' => $this->creditmemoNotifierMock, - 'priceCurrency' => $this->priceCurrencyMock, + 'priceCurrency' => $this->priceCurrency, ] ); } @@ -187,7 +192,7 @@ public function testRefund() $orderMock->expects($this->once())->method('getBaseTotalPaid')->willReturn(10); $creditMemoMock->expects($this->once())->method('getBaseGrandTotal')->willReturn(10); - $this->priceCurrencyMock->expects($this->any()) + $this->priceCurrency->expects($this->any()) ->method('round') ->willReturnArgument(0); @@ -259,7 +264,7 @@ public function testRefundPendingCreditMemo() $orderMock->expects($this->once())->method('getBaseTotalPaid')->willReturn(10); $creditMemoMock->expects($this->once())->method('getBaseGrandTotal')->willReturn(10); - $this->priceCurrencyMock->expects($this->any()) + $this->priceCurrency->expects($this->any()) ->method('round') ->willReturnArgument(0); @@ -324,27 +329,32 @@ public function testRefundExpectsMoneyAvailableToReturn() $baseGrandTotal = 10; $baseTotalRefunded = 9; $baseTotalPaid = 10; - $creditMemoMock = $this->getMockBuilder(\Magento\Sales\Api\Data\CreditmemoInterface::class) - ->setMethods(['getId', 'getOrder', 'formatBasePrice']) + /** @var CreditmemoInterface|MockObject $creditMemo */ + $creditMemo = $this->getMockBuilder(CreditmemoInterface::class) + ->setMethods(['getId', 'getOrder']) ->getMockForAbstractClass(); - $creditMemoMock->expects($this->once())->method('getId')->willReturn(null); - $orderMock = $this->getMockBuilder(Order::class)->disableOriginalConstructor()->getMock(); - $creditMemoMock->expects($this->atLeastOnce())->method('getOrder')->willReturn($orderMock); - $creditMemoMock->expects($this->once())->method('getBaseGrandTotal')->willReturn($baseGrandTotal); - $orderMock->expects($this->atLeastOnce())->method('getBaseTotalRefunded')->willReturn($baseTotalRefunded); - $this->priceCurrencyMock->expects($this->exactly(2))->method('round')->withConsecutive( - [$baseTotalRefunded + $baseGrandTotal], - [$baseTotalPaid] - )->willReturnOnConsecutiveCalls( - $baseTotalRefunded + $baseGrandTotal, - $baseTotalPaid - ); - $orderMock->expects($this->atLeastOnce())->method('getBaseTotalPaid')->willReturn($baseTotalPaid); + $creditMemo->method('getId') + ->willReturn(null); + /** @var Order|MockObject $order */ + $order = $this->getMockBuilder(Order::class) + ->disableOriginalConstructor() + ->getMock(); + $creditMemo->method('getOrder') + ->willReturn($order); + $creditMemo->method('getBaseGrandTotal') + ->willReturn($baseGrandTotal); + $order->method('getBaseTotalRefunded') + ->willReturn($baseTotalRefunded); + $this->priceCurrency->method('round') + ->withConsecutive([$baseTotalRefunded + $baseGrandTotal], [$baseTotalPaid]) + ->willReturnOnConsecutiveCalls($baseTotalRefunded + $baseGrandTotal, $baseTotalPaid); + $order->method('getBaseTotalPaid') + ->willReturn($baseTotalPaid); $baseAvailableRefund = $baseTotalPaid - $baseTotalRefunded; - $orderMock->expects($this->once())->method('formatBasePrice')->with( - $baseAvailableRefund - )->willReturn($baseAvailableRefund); - $this->creditmemoService->refund($creditMemoMock, true); + $order->method('formatPriceTxt') + ->with($baseAvailableRefund) + ->willReturn($baseAvailableRefund); + $this->creditmemoService->refund($creditMemo, true); } /** From b4181a0795e56c9954f6c03454af5e765727c597 Mon Sep 17 00:00:00 2001 From: Nick Shatilo Date: Thu, 4 Oct 2018 12:29:02 +0300 Subject: [PATCH 002/131] fix(Webapi Xml Renderer - 18361): removed the not needed ampersand replacement, covered by tests --- .../Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php | 4 ++-- .../Webapi/Test/Unit/Rest/Response/Renderer/XmlTest.php | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php b/lib/internal/Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php index b4cfc61611a..62b0d30b294 100644 --- a/lib/internal/Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php +++ b/lib/internal/Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php @@ -111,8 +111,7 @@ protected function _formatValue($value) /** Without the following transformation boolean values are rendered incorrectly */ $value = $value ? 'true' : 'false'; } - $replacementMap = ['&' => '&']; - return str_replace(array_keys($replacementMap), array_values($replacementMap), $value); + return (string) $value; } /** @@ -166,3 +165,4 @@ protected function _prepareKey($key) return $key; } } + diff --git a/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/Response/Renderer/XmlTest.php b/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/Response/Renderer/XmlTest.php index 396fbcdb197..71fb41491cc 100644 --- a/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/Response/Renderer/XmlTest.php +++ b/lib/internal/Magento/Framework/Webapi/Test/Unit/Rest/Response/Renderer/XmlTest.php @@ -76,6 +76,11 @@ public function providerXmlRender() 'value', 'Invalid XML render with numeric symbol in data index.' ], + [ + ['key' => 'test & foo'], + 'test & foo', + 'Invalid XML render with ampersand symbol in data index.' + ], [ ['.key' => 'value'], 'value', From 3f9784e3ee8c4b1f1e9df0a47ad91a6e4628024b Mon Sep 17 00:00:00 2001 From: Ian Date: Mon, 15 Oct 2018 13:38:33 +0100 Subject: [PATCH 003/131] 18615 updates structure for last_trans_id to be varchar 255 which is inline with klarna_core_order order_id and amazon_sales_order amazon_order_reference_id. Limit was 32 characters where as a klarna_order reference is 36 characters at present --- app/code/Magento/Sales/etc/db_schema.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/etc/db_schema.xml b/app/code/Magento/Sales/etc/db_schema.xml index fda6e75cf00..452247e5451 100644 --- a/app/code/Magento/Sales/etc/db_schema.xml +++ b/app/code/Magento/Sales/etc/db_schema.xml @@ -663,7 +663,7 @@ - + From c58ac50f9f090e2094639b006dca414b13a225d5 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Thu, 25 Oct 2018 16:29:39 -0500 Subject: [PATCH 004/131] Issue #14571 - Wrong column type when creating temporary tables for flat catalog --- .../Indexer/Product/Flat/TableBuilder.php | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php index a32379b8c0a..a3d958ea537 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php @@ -7,6 +7,9 @@ use Magento\Catalog\Model\Indexer\Product\Flat\Table\BuilderInterfaceFactory; +/** + * Class TableBuilder + */ class TableBuilder { /** @@ -137,13 +140,23 @@ protected function _createTemporaryTable($tableName, array $columns, $valueField ); $flatColumns = $this->_productIndexerHelper->getFlatColumns(); - $temporaryTableBuilder->addColumn('entity_id', \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER); + $temporaryTableBuilder->addColumn( + 'entity_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned'=>true] + ); $temporaryTableBuilder->addColumn('type_id', \Magento\Framework\DB\Ddl\Table::TYPE_TEXT); $temporaryTableBuilder->addColumn('attribute_set_id', \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER); - $valueTemporaryTableBuilder->addColumn('entity_id', \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER); + $valueTemporaryTableBuilder->addColumn( + 'entity_id', + \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER, + null, + ['unsigned'=>true] + ); /** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */ foreach ($columns as $columnName => $attribute) { @@ -198,9 +211,10 @@ protected function _getTemporaryTableName($tableName) * Fill temporary entity table * * @param string $tableName - * @param array $columns - * @param array $changedIds + * @param array $columns + * @param array $changedIds * @return void + * @throws \Exception */ protected function _fillTemporaryEntityTable($tableName, array $columns, array $changedIds = []) { @@ -244,11 +258,12 @@ protected function _addPrimaryKeyToTable($tableName, $columnName = 'entity_id') * Fill temporary table by data from products EAV attributes by type * * @param string $tableName - * @param array $tableColumns - * @param array $changedIds + * @param array $tableColumns + * @param array $changedIds * @param string $valueFieldSuffix * @param int $storeId * @return void + * @throws \Exception */ protected function _fillTemporaryTable( $tableName, @@ -345,6 +360,8 @@ protected function _fillTemporaryTable( } /** + * Get Metadata Pool + * * @return \Magento\Framework\EntityManager\MetadataPool * @deprecated 101.1.0 */ From 86a30b6295fec501b0ecaa27e173bcdefc8fa95b Mon Sep 17 00:00:00 2001 From: Patrick McLain Date: Tue, 16 Oct 2018 09:04:53 -0400 Subject: [PATCH 005/131] Write intercepted mapping to generated/metadata during compilation This prevents the intercepted cache from being cleared following compilation. The mapping is stored in the frontend cache when the mapping metadata file is not present, ie developer, default modes. Fixes #17680 --- .../Framework/Interception/Config/Config.php | 111 ++++++++++++++---- 1 file changed, 89 insertions(+), 22 deletions(-) diff --git a/lib/internal/Magento/Framework/Interception/Config/Config.php b/lib/internal/Magento/Framework/Interception/Config/Config.php index 7c80051537b..9011ddac769 100644 --- a/lib/internal/Magento/Framework/Interception/Config/Config.php +++ b/lib/internal/Magento/Framework/Interception/Config/Config.php @@ -78,6 +78,16 @@ class Config implements \Magento\Framework\Interception\ConfigInterface */ private $serializer; + /** + * @var \Magento\Setup\Module\Di\Compiler\Config\Writer\Filesystem + */ + private $configWriter; + + /** + * @var \Magento\Framework\App\ObjectManager\ConfigLoader\Compiled + */ + private $compiledLoader; + /** * Config constructor * @@ -89,6 +99,8 @@ class Config implements \Magento\Framework\Interception\ConfigInterface * @param \Magento\Framework\ObjectManager\DefinitionInterface $classDefinitions * @param string $cacheId * @param SerializerInterface|null $serializer + * @param \Magento\Setup\Module\Di\Compiler\Config\Writer\Filesystem $configWriter + * @param \Magento\Framework\App\ObjectManager\ConfigLoader\Compiled $compiledLoader */ public function __construct( \Magento\Framework\Config\ReaderInterface $reader, @@ -98,7 +110,9 @@ public function __construct( \Magento\Framework\Interception\ObjectManager\ConfigInterface $omConfig, \Magento\Framework\ObjectManager\DefinitionInterface $classDefinitions, $cacheId = 'interception', - SerializerInterface $serializer = null + SerializerInterface $serializer = null, + \Magento\Setup\Module\Di\Compiler\Config\Writer\Filesystem $configWriter = null, + \Magento\Framework\App\ObjectManager\ConfigLoader\Compiled $compiledLoader = null ) { $this->_omConfig = $omConfig; $this->_relations = $relations; @@ -109,11 +123,15 @@ public function __construct( $this->_scopeList = $scopeList; $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance() ->get(Serialize::class); - $intercepted = $this->_cache->load($this->_cacheId); + $this->configWriter = $configWriter ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Setup\Module\Di\Compiler\Config\Writer\Filesystem::class); + $this->compiledLoader = $compiledLoader ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::class); + $intercepted = $this->loadIntercepted(); if ($intercepted !== false) { - $this->_intercepted = $this->serializer->unserialize($intercepted); + $this->_intercepted = $intercepted; } else { - $this->initialize($this->_classDefinitions->getClasses()); + $this->initializeUncompiled($this->_classDefinitions->getClasses()); } } @@ -125,24 +143,9 @@ public function __construct( */ public function initialize($classDefinitions = []) { - $this->_cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [$this->_cacheId]); - $config = []; - foreach ($this->_scopeList->getAllScopes() as $scope) { - $config = array_replace_recursive($config, $this->_reader->read($scope)); - } - unset($config['preferences']); - foreach ($config as $typeName => $typeConfig) { - if (!empty($typeConfig['plugins'])) { - $this->_intercepted[ltrim($typeName, '\\')] = true; - } - } - foreach ($config as $typeName => $typeConfig) { - $this->hasPlugins($typeName); - } - foreach ($classDefinitions as $class) { - $this->hasPlugins($class); - } - $this->_cache->save($this->serializer->serialize($this->_intercepted), $this->_cacheId); + $this->generateIntercepted($classDefinitions); + + $this->configWriter->write($this->_cacheId, $this->_intercepted); } /** @@ -188,4 +191,68 @@ public function hasPlugins($type) } return $this->_inheritInterception($type); } + + /** + * Write interception config to cache + * + * @param array $classDefinitions + */ + private function initializeUncompiled($classDefinitions = []) + { + $this->_cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [$this->_cacheId]); + + $this->generateIntercepted($classDefinitions); + + $this->_cache->save($this->serializer->serialize($this->_intercepted), $this->_cacheId); + } + + /** + * Generate intercepted array to store in compiled metadata or frontend cache + * + * @param $classDefinitions + */ + private function generateIntercepted($classDefinitions) + { + $config = []; + foreach ($this->_scopeList->getAllScopes() as $scope) { + $config = array_replace_recursive($config, $this->_reader->read($scope)); + } + unset($config['preferences']); + foreach ($config as $typeName => $typeConfig) { + if (!empty($typeConfig['plugins'])) { + $this->_intercepted[ltrim($typeName, '\\')] = true; + } + } + foreach ($config as $typeName => $typeConfig) { + $this->hasPlugins($typeName); + } + foreach ($classDefinitions as $class) { + $this->hasPlugins($class); + } + } + + /** + * Load the interception config from cache + * + * @return array|false + */ + private function loadIntercepted() + { + if ($this->isCompiled()) { + return $this->compiledLoader->load($this->_cacheId); + } + + $intercepted = $this->_cache->load($this->_cacheId); + return $intercepted ? $this->serializer->unserialize($intercepted) : false; + } + + /** + * Check for the compiled config with the generated metadata + * + * @return bool + */ + private function isCompiled() + { + return file_exists(\Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::getFilePath($this->_cacheId)); + } } From 32191691b5e66da54c422b4968590b7c581c0e58 Mon Sep 17 00:00:00 2001 From: Patrick McLain Date: Thu, 18 Oct 2018 08:59:30 -0400 Subject: [PATCH 006/131] Move ObjectManager Config Writer to Framework The ObjectManager Config Writer class currently lives in the Setup module and is needed in the Framework when writing the interception config to the filesystem during compilation. This commit adds the classes to the Framework and replaces any existing usage with the new interface/class. --- .../ConfigWriter/FilesystemTest.php | 59 ++++++++++++++++++ .../ObjectManager/ConfigWriter/Filesystem.php | 61 +++++++++++++++++++ .../ObjectManager/ConfigWriterInterface.php | 24 ++++++++ .../Framework/Interception/Config/Config.php | 8 +-- .../Console/Command/DiCompileCommand.php | 4 +- .../Module/Di/App/Task/Operation/Area.php | 6 +- .../Di/Compiler/Config/Writer/Filesystem.php | 4 ++ .../Di/Compiler/Config/WriterInterface.php | 3 +- .../Test/Unit/Module/Di/App/Task/AreaTest.php | 2 +- 9 files changed, 160 insertions(+), 11 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigWriter/FilesystemTest.php create mode 100644 lib/internal/Magento/Framework/App/ObjectManager/ConfigWriter/Filesystem.php create mode 100644 lib/internal/Magento/Framework/App/ObjectManager/ConfigWriterInterface.php diff --git a/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigWriter/FilesystemTest.php b/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigWriter/FilesystemTest.php new file mode 100644 index 00000000000..843be22c57d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/App/ObjectManager/ConfigWriter/FilesystemTest.php @@ -0,0 +1,59 @@ +configWriter = $objectManager->create( + \Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem::class + ); + $this->configReader = $objectManager->create( + \Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::class + ); + } + + public function testWrite() + { + $sampleData = [ + 'classA' => true, + 'classB' => false, + ]; + + $this->configWriter->write(self::CACHE_KEY, $sampleData); + $this->assertEquals($sampleData, $this->configReader->load(self::CACHE_KEY)); + } + + public function testOverwrite() + { + $this->configWriter->write(self::CACHE_KEY, ['hello' => 'world']); + + $sampleData = [ + 'classC' => false, + 'classD' => true, + ]; + + $this->configWriter->write(self::CACHE_KEY, $sampleData); + $this->assertEquals($sampleData, $this->configReader->load(self::CACHE_KEY)); + } +} diff --git a/lib/internal/Magento/Framework/App/ObjectManager/ConfigWriter/Filesystem.php b/lib/internal/Magento/Framework/App/ObjectManager/ConfigWriter/Filesystem.php new file mode 100644 index 00000000000..2b1cdd2a9c1 --- /dev/null +++ b/lib/internal/Magento/Framework/App/ObjectManager/ConfigWriter/Filesystem.php @@ -0,0 +1,61 @@ +directoryList = $directoryList; + } + + /** + * Writes config in storage + * + * @param string $key + * @param array $config + * @return void + */ + public function write(string $key, array $config) + { + $this->initialize(); + $configuration = sprintf('directoryList->getPath(DirectoryList::GENERATED_METADATA) . '/' . $key . '.php', + $configuration + ); + } + + /** + * Initializes writer + * + * @return void + */ + private function initialize() + { + if (!file_exists($this->directoryList->getPath(DirectoryList::GENERATED_METADATA))) { + mkdir($this->directoryList->getPath(DirectoryList::GENERATED_METADATA)); + } + } +} diff --git a/lib/internal/Magento/Framework/App/ObjectManager/ConfigWriterInterface.php b/lib/internal/Magento/Framework/App/ObjectManager/ConfigWriterInterface.php new file mode 100644 index 00000000000..cccbb0ae30b --- /dev/null +++ b/lib/internal/Magento/Framework/App/ObjectManager/ConfigWriterInterface.php @@ -0,0 +1,24 @@ +_omConfig = $omConfig; @@ -124,7 +124,7 @@ public function __construct( $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance() ->get(Serialize::class); $this->configWriter = $configWriter ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Setup\Module\Di\Compiler\Config\Writer\Filesystem::class); + ->get(\Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem::class); $this->compiledLoader = $compiledLoader ?: \Magento\Framework\App\ObjectManager::getInstance() ->get(\Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::class); $intercepted = $this->loadIntercepted(); diff --git a/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php b/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php index 68e26ec83c3..ee26e71d94f 100644 --- a/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php +++ b/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php @@ -307,8 +307,8 @@ private function configureObjectManager(OutputInterface $output) { $this->objectManager->configure( [ - 'preferences' => [\Magento\Setup\Module\Di\Compiler\Config\WriterInterface::class => - \Magento\Setup\Module\Di\Compiler\Config\Writer\Filesystem::class, + 'preferences' => [\Magento\Framework\App\ObjectManager\ConfigWriterInterface::class => + \Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem::class, ], \Magento\Setup\Module\Di\Compiler\Config\ModificationChain::class => [ 'arguments' => [ 'modificationsList' => [ diff --git a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php index ec5fb3f94e4..7acc84e356c 100644 --- a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php +++ b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php @@ -28,7 +28,7 @@ class Area implements OperationInterface private $configReader; /** - * @var Config\WriterInterface + * @var \Magento\Framework\App\ObjectManager\ConfigWriterInterface */ private $configWriter; @@ -46,7 +46,7 @@ class Area implements OperationInterface * @param App\AreaList $areaList * @param \Magento\Setup\Module\Di\Code\Reader\Decorator\Area $areaInstancesNamesList * @param Config\Reader $configReader - * @param Config\WriterInterface $configWriter + * @param \Magento\Framework\App\ObjectManager\ConfigWriterInterface $configWriter * @param \Magento\Setup\Module\Di\Compiler\Config\ModificationChain $modificationChain * @param array $data */ @@ -54,7 +54,7 @@ public function __construct( App\AreaList $areaList, \Magento\Setup\Module\Di\Code\Reader\Decorator\Area $areaInstancesNamesList, Config\Reader $configReader, - Config\WriterInterface $configWriter, + \Magento\Framework\App\ObjectManager\ConfigWriterInterface $configWriter, Config\ModificationChain $modificationChain, $data = [] ) { diff --git a/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php b/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php index b4601a970de..ee9321c5d41 100644 --- a/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php +++ b/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php @@ -10,6 +10,10 @@ use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Setup\Module\Di\Compiler\Config\WriterInterface; +/** + * @deprecated Moved to Framework to allow broader reuse + * @see \Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem + */ class Filesystem implements WriterInterface { /** diff --git a/setup/src/Magento/Setup/Module/Di/Compiler/Config/WriterInterface.php b/setup/src/Magento/Setup/Module/Di/Compiler/Config/WriterInterface.php index 9e6a3008283..1ff5524529c 100644 --- a/setup/src/Magento/Setup/Module/Di/Compiler/Config/WriterInterface.php +++ b/setup/src/Magento/Setup/Module/Di/Compiler/Config/WriterInterface.php @@ -9,7 +9,8 @@ /** * Interface \Magento\Setup\Module\Di\Compiler\Config\WriterInterface - * + * @deprecated Moved to Framework to allow broader reuse + * @see \Magento\Framework\App\ObjectManager\ConfigWriterInterface */ interface WriterInterface { diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php index 39e67401760..03b423bb32b 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php @@ -48,7 +48,7 @@ protected function setUp() $this->configReaderMock = $this->getMockBuilder(\Magento\Setup\Module\Di\Compiler\Config\Reader::class) ->disableOriginalConstructor() ->getMock(); - $this->configWriterMock = $this->getMockBuilder(\Magento\Setup\Module\Di\Compiler\Config\WriterInterface::class) + $this->configWriterMock = $this->getMockBuilder(\Magento\Framework\App\ObjectManager\ConfigWriterInterface::class) ->disableOriginalConstructor() ->getMock(); $this->configChain = $this->getMockBuilder(\Magento\Setup\Module\Di\Compiler\Config\ModificationChain::class) From a901ad3fd5390c455409d1b8e09af8190debd26c Mon Sep 17 00:00:00 2001 From: Patrick McLain Date: Fri, 19 Oct 2018 16:52:03 -0400 Subject: [PATCH 007/131] Add Interception Config Integration Test Test load logic added for persisting compiled cache data in `generated/metadata` --- .../Interception/Config/ConfigTest.php | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php new file mode 100644 index 00000000000..5221b8bb422 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php @@ -0,0 +1,136 @@ +objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + $this->serializer = $this->objectManager->get(\Magento\Framework\Serialize\Serializer\Serialize::class); + $this->cache = $this->objectManager->get(\Magento\Framework\App\CacheInterface::class); + $this->configWriter = $this->objectManager->get(\Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem::class); + + $this->initializeMetadataDirectory(); + } + + /** + * Delete compiled file if it was created and clear cache data + */ + protected function tearDown() + { + $compiledPath = \Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::getFilePath(self::CACHE_ID); + if (file_exists($compiledPath)) { + unlink($compiledPath); + } + + $this->cache->remove(self::CACHE_ID); + } + + /** + * Test load interception cache from generated/metadata + * @dataProvider interceptionCompiledConfigDataProvider + * @param array $testConfig + */ + public function testInstantiateFromCompiled(array $testConfig) + { + $this->configWriter->write(self::CACHE_ID, $testConfig); + $config = $this->getConfig(); + + foreach ($testConfig as $className => $hasPlugins) { + $this->assertEquals($hasPlugins, $config->hasPlugins($className)); + } + } + + /** + * Test load interception cache from backend cache + * @dataProvider interceptionCacheConfigDataProvider + * @param array $testConfig + */ + public function testInstantiateFromCache(array $testConfig) + { + $this->cache->save($this->serializer->serialize($testConfig), self::CACHE_ID); + $config = $this->getConfig(); + + foreach ($testConfig as $className => $hasPlugins) { + $this->assertEquals($hasPlugins, $config->hasPlugins($className)); + } + } + + public function interceptionCompiledConfigDataProvider() + { + return [ + [['classA' => true, 'classB' => false]], + [['classA' => false, 'classB' => true]], + ]; + } + + public function interceptionCacheConfigDataProvider() + { + return [ + [['classC' => true, 'classD' => false]], + [['classC' => false, 'classD' => true]], + ]; + } + + /** + * Ensure generated/metadata exists + */ + private function initializeMetadataDirectory() + { + $diPath = DirectoryList::getDefaultConfig()[DirectoryList::GENERATED_METADATA][DirectoryList::PATH]; + $fullPath = BP . DIRECTORY_SEPARATOR . $diPath; + if (!file_exists($fullPath)) { + mkdir($fullPath); + } + } + + /** + * Create instance of Config class with specific cacheId. This is done to prevent our test + * from altering the interception config that may have been generated during application + * installation. Inject a new instance of the compileLoaded to bypass it's caching. + * + * @return \Magento\Framework\Interception\Config\Config + */ + private function getConfig() + { + return $this->objectManager->create( + \Magento\Framework\Interception\Config\Config::class, + [ + 'cacheId' => self::CACHE_ID, + 'compiledLoader' => $this->objectManager->create(\Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::class), + ] + ); + } +} From 7dae4c185b01b621cd51841ecb67521d8b745298 Mon Sep 17 00:00:00 2001 From: Patrick McLain Date: Wed, 24 Oct 2018 16:39:34 -0400 Subject: [PATCH 008/131] Update serializer used in integration test Replace serialize with it's interface. Also passes the serializer when instantiating the test subject. This ensures the correct implementation is used becuase the interface preference and fallback in the constructor do not match. --- .../Magento/Framework/Interception/Config/ConfigTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php index 5221b8bb422..1ece9189169 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php @@ -38,7 +38,7 @@ protected function setUp() { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - $this->serializer = $this->objectManager->get(\Magento\Framework\Serialize\Serializer\Serialize::class); + $this->serializer = $this->objectManager->get(\Magento\Framework\Serialize\SerializerInterface::class); $this->cache = $this->objectManager->get(\Magento\Framework\App\CacheInterface::class); $this->configWriter = $this->objectManager->get(\Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem::class); @@ -130,6 +130,7 @@ private function getConfig() [ 'cacheId' => self::CACHE_ID, 'compiledLoader' => $this->objectManager->create(\Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::class), + 'serializer' => $this->serializer, ] ); } From ac90f7a0be57d6d4240e64ac7fd98aeafeb80045 Mon Sep 17 00:00:00 2001 From: Max Almonte Date: Fri, 26 Oct 2018 12:52:10 -0400 Subject: [PATCH 009/131] Added $connection property to class --- .../Magento/DownloadableImportExport/Helper/Uploader.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/code/Magento/DownloadableImportExport/Helper/Uploader.php b/app/code/Magento/DownloadableImportExport/Helper/Uploader.php index 46081f77cc6..9420aeb51d4 100644 --- a/app/code/Magento/DownloadableImportExport/Helper/Uploader.php +++ b/app/code/Magento/DownloadableImportExport/Helper/Uploader.php @@ -38,6 +38,13 @@ class Uploader extends \Magento\Framework\App\Helper\AbstractHelper */ protected $parameters = []; + /** + * Connection resource. + * + * @var \Magento\Framework\DB\Adapter\AdapterInterface + */ + protected $connection = []; + /** * Construct * From 5181674d525cc5e39482ac443ea3ac2b1a6c9bd0 Mon Sep 17 00:00:00 2001 From: Max Almonte Date: Fri, 26 Oct 2018 13:28:40 -0400 Subject: [PATCH 010/131] Added $_customerCollection property to Storage class --- .../Model/ResourceModel/Import/Customer/Storage.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php index f779505a380..38890de6432 100644 --- a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php +++ b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php @@ -48,6 +48,13 @@ class Storage */ private $customerCollectionFactory; + /** + * Customer collection. + * + * @var \Magento\Customer\Model\ResourceModel\Customer\Collection + */ + private $_customerCollection; + /** * @param CustomerCollectionFactory $collectionFactory * @param CollectionByPagesIteratorFactory $colIteratorFactory From 2054fab1731a63728a6b4e573cefbbf3e64d6c85 Mon Sep 17 00:00:00 2001 From: Rus0 Date: Fri, 26 Oct 2018 16:25:02 -0500 Subject: [PATCH 011/131] Autoload for root folders --- app/autoload.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/autoload.php b/app/autoload.php index 54087d02554..d6407083dc0 100644 --- a/app/autoload.php +++ b/app/autoload.php @@ -28,6 +28,9 @@ /* 'composer install' validation */ if (file_exists($vendorAutoload)) { $composerAutoloader = include $vendorAutoload; +} else if (file_exists("{$vendorDir}/autoload.php")) { + $vendorAutoload = "{$vendorDir}/autoload.php"; + $composerAutoloader = include $vendorAutoload; } else { throw new \Exception( 'Vendor autoload is not found. Please run \'composer install\' under application root directory.' From c8e0a4f796123b3b4b155bf97a6933d89e0794ae Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Mon, 29 Oct 2018 11:48:29 -0500 Subject: [PATCH 012/131] MAGETWO-95212: block call to getCurrentUrl method is returning ajax request value - Product list widget can be configured to use a base url for add to cart buttons - Added test section for this scenario --- .../Catalog/Block/Product/AbstractProduct.php | 8 +++++- .../Block/Product/ProductsList.php | 28 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index 4102c82a0a3..fb45246ea34 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -125,6 +125,7 @@ public function __construct(\Magento\Catalog\Block\Product\Context $context, arr /** * Retrieve url for add product to cart + * * Will return product view page URL if product has required options * * @param \Magento\Catalog\Model\Product $product @@ -265,6 +266,7 @@ public function getProductUrl($product, $additional = []) if (!isset($additional['_escape'])) { $additional['_escape'] = true; } + $additional['useUencPlaceholder'] = true; return $product->getUrlModel()->getUrl($product, $additional); } @@ -473,7 +475,9 @@ public function getProductDetailsHtml(\Magento\Catalog\Model\Product $product) } /** - * @param null $type + * Get the renderer that will be used to render the details block + * + * @param string|null $type * @return bool|\Magento\Framework\View\Element\AbstractBlock */ public function getDetailsRenderer($type = null) @@ -489,6 +493,8 @@ public function getDetailsRenderer($type = null) } /** + * Return the list of details + * * @return \Magento\Framework\View\Element\RendererList */ protected function getDetailsRendererList() diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index ed17634aa48..2681381c5d7 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -11,11 +11,13 @@ use Magento\Framework\Pricing\PriceCurrencyInterface; use Magento\Framework\Serialize\Serializer\Json; use Magento\Widget\Block\BlockInterface; +use Magento\Framework\Url\EncoderInterface; /** * Catalog Products List widget block * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implements BlockInterface, IdentityInterface { @@ -94,6 +96,11 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem */ private $json; + /** + * @var \Magento\Framework\Url\EncoderInterface|null + */ + private $urlEncoder; + /** * @param \Magento\Catalog\Block\Product\Context $context * @param \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory @@ -104,6 +111,7 @@ class ProductsList extends \Magento\Catalog\Block\Product\AbstractProduct implem * @param \Magento\Widget\Helper\Conditions $conditionsHelper * @param array $data * @param Json|null $json + * @param \Magento\Framework\Url\EncoderInterface|null $urlEncoder */ public function __construct( \Magento\Catalog\Block\Product\Context $context, @@ -114,7 +122,8 @@ public function __construct( \Magento\CatalogWidget\Model\Rule $rule, \Magento\Widget\Helper\Conditions $conditionsHelper, array $data = [], - Json $json = null + Json $json = null, + EncoderInterface $urlEncoder = null ) { $this->productCollectionFactory = $productCollectionFactory; $this->catalogProductVisibility = $catalogProductVisibility; @@ -123,6 +132,7 @@ public function __construct( $this->rule = $rule; $this->conditionsHelper = $conditionsHelper; $this->json = $json ?: ObjectManager::getInstance()->get(Json::class); + $this->urlEncoder = $urlEncoder ?: ObjectManager::getInstance()->get(EncoderInterface::class); parent::__construct( $context, $data @@ -417,4 +427,20 @@ private function getPriceCurrency() } return $this->priceCurrency; } + + /** + * @inheritdoc + */ + public function getAddToCartUrl($product, $additional = []) + { + $requestingPageUrl = $this->getRequest()->getParam('requesting_page_url'); + + if (!empty($requestingPageUrl)) { + $additional['useUencPlaceholder'] = true; + $url = parent::getAddToCartUrl($product, $additional); + return str_replace('%25uenc%25', $this->urlEncoder->encode($requestingPageUrl), $url); + } + + return parent::getAddToCartUrl($product, $additional); + } } From 659e5ffc37c226e21c896a2db4a7e5fbafff8d75 Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Mon, 29 Oct 2018 13:37:04 -0500 Subject: [PATCH 013/131] MAGETWO-95212: block call to getCurrentUrl method is returning ajax request value - Added missing section --- .../Test/Mftf/Section/ProductListWidgetSection.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/code/Magento/CatalogWidget/Test/Mftf/Section/ProductListWidgetSection.xml diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Section/ProductListWidgetSection.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Section/ProductListWidgetSection.xml new file mode 100644 index 00000000000..4e79334a94c --- /dev/null +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Section/ProductListWidgetSection.xml @@ -0,0 +1,14 @@ + + + + +
+ +
+
From b272c4e4bf5e3ee39ecc6376ee425f4e7ae5d27a Mon Sep 17 00:00:00 2001 From: Max Almonte Date: Tue, 30 Oct 2018 08:44:10 -0400 Subject: [PATCH 014/131] Removed unused properties --- .../ResourceModel/Import/Customer/Storage.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php index 38890de6432..58af2c5c1ca 100644 --- a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php +++ b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php @@ -44,30 +44,13 @@ class Storage protected $_byPagesIterator; /** - * @var CustomerCollectionFactory - */ - private $customerCollectionFactory; - - /** - * Customer collection. - * - * @var \Magento\Customer\Model\ResourceModel\Customer\Collection - */ - private $_customerCollection; - - /** - * @param CustomerCollectionFactory $collectionFactory * @param CollectionByPagesIteratorFactory $colIteratorFactory * @param array $data */ public function __construct( - CustomerCollectionFactory $collectionFactory, CollectionByPagesIteratorFactory $colIteratorFactory, array $data = [] ) { - $this->_customerCollection = isset( - $data['customer_collection'] - ) ? $data['customer_collection'] : $collectionFactory->create(); $this->_pageSize = isset($data['page_size']) ? $data['page_size'] : 0; $this->_byPagesIterator = isset( $data['collection_by_pages_iterator'] From 6789eb495f0ab9c8e7c532a20826e43da518f2a5 Mon Sep 17 00:00:00 2001 From: Max Almonte Date: Tue, 30 Oct 2018 09:09:04 -0400 Subject: [PATCH 015/131] Removed unused connection property, added PHPMD.UnusedFormalParameter directive --- .../DownloadableImportExport/Helper/Uploader.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/DownloadableImportExport/Helper/Uploader.php b/app/code/Magento/DownloadableImportExport/Helper/Uploader.php index 9420aeb51d4..5fc4df1d03c 100644 --- a/app/code/Magento/DownloadableImportExport/Helper/Uploader.php +++ b/app/code/Magento/DownloadableImportExport/Helper/Uploader.php @@ -38,13 +38,6 @@ class Uploader extends \Magento\Framework\App\Helper\AbstractHelper */ protected $parameters = []; - /** - * Connection resource. - * - * @var \Magento\Framework\DB\Adapter\AdapterInterface - */ - protected $connection = []; - /** * Construct * @@ -53,6 +46,8 @@ class Uploader extends \Magento\Framework\App\Helper\AbstractHelper * @param \Magento\CatalogImportExport\Model\Import\UploaderFactory $uploaderFactory * @param \Magento\Framework\App\ResourceConnection $resource * @param \Magento\Framework\Filesystem $filesystem + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( \Magento\Framework\App\Helper\Context $context, @@ -67,7 +62,6 @@ public function __construct( $this->fileUploader->init(); $this->fileUploader->setAllowedExtensions($this->getAllowedExtensions()); $this->fileUploader->removeValidateCallback('catalog_product_image'); - $this->connection = $resource->getConnection('write'); $this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); } From e9730955a3029c4f75f0a80bad31e9f2cc2480cd Mon Sep 17 00:00:00 2001 From: Max Almonte Date: Tue, 30 Oct 2018 09:21:07 -0400 Subject: [PATCH 016/131] Added back customerCollectionFactory property --- .../Model/ResourceModel/Import/Customer/Storage.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php index 58af2c5c1ca..c5d28240c30 100644 --- a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php +++ b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php @@ -44,10 +44,17 @@ class Storage protected $_byPagesIterator; /** + * @var CustomerCollectionFactory + */ + private $customerCollectionFactory; + + /** + * @param CustomerCollectionFactory $collectionFactory * @param CollectionByPagesIteratorFactory $colIteratorFactory * @param array $data */ public function __construct( + CustomerCollectionFactory $collectionFactory, CollectionByPagesIteratorFactory $colIteratorFactory, array $data = [] ) { From cbf828a00a9a2287d7c7bb640f3c1078410b4de4 Mon Sep 17 00:00:00 2001 From: Patrick McLain Date: Wed, 24 Oct 2018 20:55:30 -0400 Subject: [PATCH 017/131] Separate interception config logic Moves the logic responsible for loading, saving, clearing the interception config cache into it's own class --- app/etc/di.xml | 6 + .../Framework/Interception/AbstractPlugin.php | 8 +- .../{ConfigTest.php => CacheManagerTest.php} | 15 +-- .../Interception/Config/CacheManager.php | 113 ++++++++++++++++++ .../Framework/Interception/Config/Config.php | 71 +++-------- .../Test/Unit/Config/ConfigTest.php | 42 ++----- 6 files changed, 157 insertions(+), 98 deletions(-) rename dev/tests/integration/testsuite/Magento/Framework/Interception/Config/{ConfigTest.php => CacheManagerTest.php} (87%) create mode 100644 lib/internal/Magento/Framework/Interception/Config/CacheManager.php diff --git a/app/etc/di.xml b/app/etc/di.xml index b374645240f..acdd48a393b 100755 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -28,6 +28,7 @@ + @@ -412,6 +413,11 @@ interception + + + Magento\Framework\App\Cache\Type\Config + + Magento\Framework\App\Cache\Type\Config diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php index a85e5e7c894..60eb511dcb6 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php @@ -59,7 +59,8 @@ public function setUpInterceptionConfig($pluginConfig) $areaList->expects($this->any())->method('getCodes')->will($this->returnValue([])); $configScope = new \Magento\Framework\Config\Scope($areaList, 'global'); $cache = $this->createMock(\Magento\Framework\Config\CacheInterface::class); - $cache->expects($this->any())->method('load')->will($this->returnValue(false)); + $cacheManager = $this->createMock(\Magento\Framework\Interception\Config\CacheManager::class); + $cacheManager->method('load')->willReturn(null); $definitions = new \Magento\Framework\ObjectManager\Definition\Runtime(); $relations = new \Magento\Framework\ObjectManager\Relations\Runtime(); $interceptionConfig = new Config\Config( @@ -68,7 +69,10 @@ public function setUpInterceptionConfig($pluginConfig) $cache, $relations, $config, - $definitions + $definitions, + 'interception', + null, + $cacheManager ); $interceptionDefinitions = new Definition\Runtime(); $json = new \Magento\Framework\Serialize\Serializer\Json(); diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php similarity index 87% rename from dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php rename to dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php index 1ece9189169..9d5abd1a8a6 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php @@ -10,7 +10,7 @@ use Magento\Framework\App\Filesystem\DirectoryList; -class ConfigTest extends \PHPUnit\Framework\TestCase +class CacheManagerTest extends \PHPUnit\Framework\TestCase { const CACHE_ID = 'interceptiontest'; @@ -68,9 +68,7 @@ public function testInstantiateFromCompiled(array $testConfig) $this->configWriter->write(self::CACHE_ID, $testConfig); $config = $this->getConfig(); - foreach ($testConfig as $className => $hasPlugins) { - $this->assertEquals($hasPlugins, $config->hasPlugins($className)); - } + $this->assertEquals($testConfig, $config->load(self::CACHE_ID)); } /** @@ -83,9 +81,7 @@ public function testInstantiateFromCache(array $testConfig) $this->cache->save($this->serializer->serialize($testConfig), self::CACHE_ID); $config = $this->getConfig(); - foreach ($testConfig as $className => $hasPlugins) { - $this->assertEquals($hasPlugins, $config->hasPlugins($className)); - } + $this->assertEquals($testConfig, $config->load(self::CACHE_ID)); } public function interceptionCompiledConfigDataProvider() @@ -121,16 +117,15 @@ private function initializeMetadataDirectory() * from altering the interception config that may have been generated during application * installation. Inject a new instance of the compileLoaded to bypass it's caching. * - * @return \Magento\Framework\Interception\Config\Config + * @return \Magento\Framework\Interception\Config\CacheManager */ private function getConfig() { return $this->objectManager->create( - \Magento\Framework\Interception\Config\Config::class, + \Magento\Framework\Interception\Config\CacheManager::class, [ 'cacheId' => self::CACHE_ID, 'compiledLoader' => $this->objectManager->create(\Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::class), - 'serializer' => $this->serializer, ] ); } diff --git a/lib/internal/Magento/Framework/Interception/Config/CacheManager.php b/lib/internal/Magento/Framework/Interception/Config/CacheManager.php new file mode 100644 index 00000000000..cd16e2277d8 --- /dev/null +++ b/lib/internal/Magento/Framework/Interception/Config/CacheManager.php @@ -0,0 +1,113 @@ +cache = $cache; + $this->serializer = $serializer; + $this->configWriter = $configWriter; + $this->compiledLoader = $compiledLoader; + } + + /** + * Load the interception config from cache + * + * @param string $key + * @return array|null + */ + public function load(string $key): ?array + { + if ($this->isCompiled($key)) { + return $this->compiledLoader->load($key); + } + + $intercepted = $this->cache->load($key); + return $intercepted ? $this->serializer->unserialize($intercepted) : null; + } + + /** + * Save config to cache backend + * + * @param string $key + * @param array $data + */ + public function save(string $key, array $data) + { + $this->cache->save($this->serializer->serialize($data), $key); + } + + /** + * Save config to filesystem + * + * @param string $key + * @param array $data + */ + public function saveCompiled(string $key, array $data) + { + $this->configWriter->write($key, $data); + } + + /** + * Purge interception cache + * + * @param string $key + */ + public function clean(string $key) + { + $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [$key]); + } + + /** + * Check for the compiled config with the generated metadata + * + * @param string $key + * @return bool + */ + private function isCompiled(string $key): bool + { + return file_exists(\Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::getFilePath($key)); + } +} diff --git a/lib/internal/Magento/Framework/Interception/Config/Config.php b/lib/internal/Magento/Framework/Interception/Config/Config.php index 9a7845e9600..4eeed4788a0 100644 --- a/lib/internal/Magento/Framework/Interception/Config/Config.php +++ b/lib/internal/Magento/Framework/Interception/Config/Config.php @@ -8,7 +8,6 @@ namespace Magento\Framework\Interception\Config; use Magento\Framework\Serialize\SerializerInterface; -use Magento\Framework\Serialize\Serializer\Serialize; class Config implements \Magento\Framework\Interception\ConfigInterface { @@ -35,7 +34,7 @@ class Config implements \Magento\Framework\Interception\ConfigInterface /** * Cache - * + * @deprecated * @var \Magento\Framework\Cache\FrontendInterface */ protected $_cache; @@ -74,33 +73,24 @@ class Config implements \Magento\Framework\Interception\ConfigInterface protected $_scopeList; /** - * @var SerializerInterface - */ - private $serializer; - - /** - * @var \Magento\Framework\App\ObjectManager\ConfigWriterInterface - */ - private $configWriter; - - /** - * @var \Magento\Framework\App\ObjectManager\ConfigLoader\Compiled + * @var CacheManager */ - private $compiledLoader; + private $cacheManager; /** * Config constructor * * @param \Magento\Framework\Config\ReaderInterface $reader * @param \Magento\Framework\Config\ScopeListInterface $scopeList - * @param \Magento\Framework\Cache\FrontendInterface $cache + * @param \Magento\Framework\Cache\FrontendInterface $cache @deprecated * @param \Magento\Framework\ObjectManager\RelationsInterface $relations * @param \Magento\Framework\Interception\ObjectManager\ConfigInterface $omConfig * @param \Magento\Framework\ObjectManager\DefinitionInterface $classDefinitions * @param string $cacheId - * @param SerializerInterface|null $serializer - * @param \Magento\Framework\App\ObjectManager\ConfigWriterInterface $configWriter - * @param \Magento\Framework\App\ObjectManager\ConfigLoader\Compiled $compiledLoader + * @param SerializerInterface|null $serializer @deprecated + * @param CacheManager $cacheManager + * + * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( \Magento\Framework\Config\ReaderInterface $reader, @@ -111,8 +101,7 @@ public function __construct( \Magento\Framework\ObjectManager\DefinitionInterface $classDefinitions, $cacheId = 'interception', SerializerInterface $serializer = null, - \Magento\Framework\App\ObjectManager\ConfigWriterInterface $configWriter = null, - \Magento\Framework\App\ObjectManager\ConfigLoader\Compiled $compiledLoader = null + CacheManager $cacheManager = null ) { $this->_omConfig = $omConfig; $this->_relations = $relations; @@ -121,14 +110,9 @@ public function __construct( $this->_cacheId = $cacheId; $this->_reader = $reader; $this->_scopeList = $scopeList; - $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(Serialize::class); - $this->configWriter = $configWriter ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem::class); - $this->compiledLoader = $compiledLoader ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::class); - $intercepted = $this->loadIntercepted(); - if ($intercepted !== false) { + $this->cacheManager = $cacheManager ?? \Magento\Framework\App\ObjectManager::getInstance()->get(CacheManager::class); + $intercepted = $this->cacheManager->load($cacheId); + if ($intercepted !== null) { $this->_intercepted = $intercepted; } else { $this->initializeUncompiled($this->_classDefinitions->getClasses()); @@ -145,7 +129,7 @@ public function initialize($classDefinitions = []) { $this->generateIntercepted($classDefinitions); - $this->configWriter->write($this->_cacheId, $this->_intercepted); + $this->cacheManager->saveCompiled($this->_cacheId, $this->_intercepted); } /** @@ -199,11 +183,11 @@ public function hasPlugins($type) */ private function initializeUncompiled($classDefinitions = []) { - $this->_cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [$this->_cacheId]); + $this->cacheManager->clean($this->_cacheId); $this->generateIntercepted($classDefinitions); - $this->_cache->save($this->serializer->serialize($this->_intercepted), $this->_cacheId); + $this->cacheManager->save($this->_cacheId, $this->_intercepted); } /** @@ -230,29 +214,4 @@ private function generateIntercepted($classDefinitions) $this->hasPlugins($class); } } - - /** - * Load the interception config from cache - * - * @return array|false - */ - private function loadIntercepted() - { - if ($this->isCompiled()) { - return $this->compiledLoader->load($this->_cacheId); - } - - $intercepted = $this->_cache->load($this->_cacheId); - return $intercepted ? $this->serializer->unserialize($intercepted) : false; - } - - /** - * Check for the compiled config with the generated metadata - * - * @return bool - */ - private function isCompiled() - { - return file_exists(\Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::getFilePath($this->_cacheId)); - } } diff --git a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php index fe8d29bd0d5..61eb2e62091 100644 --- a/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php +++ b/lib/internal/Magento/Framework/Interception/Test/Unit/Config/ConfigTest.php @@ -31,11 +31,6 @@ class ConfigTest extends \PHPUnit\Framework\TestCase */ private $readerMock; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - private $cacheMock; - /** * @var \PHPUnit_Framework_MockObject_MockObject */ @@ -51,8 +46,10 @@ class ConfigTest extends \PHPUnit\Framework\TestCase */ private $relationsMock; - /** @var SerializerInterface|\PHPUnit_Framework_MockObject_MockObject */ - private $serializerMock; + /** + * @var \Magento\Framework\Interception\Config\CacheManager|\PHPUnit_Framework_MockObject_MockObject + */ + private $cacheManagerMock; /** @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager */ private $objectManagerHelper; @@ -61,7 +58,6 @@ protected function setUp() { $this->readerMock = $this->createMock(\Magento\Framework\ObjectManager\Config\Reader\Dom::class); $this->configScopeMock = $this->createMock(\Magento\Framework\Config\ScopeListInterface::class); - $this->cacheMock = $this->createMock(\Magento\Framework\Cache\FrontendInterface::class); $this->omConfigMock = $this->getMockForAbstractClass( \Magento\Framework\Interception\ObjectManager\ConfigInterface::class ); @@ -69,7 +65,7 @@ protected function setUp() $this->relationsMock = $this->getMockForAbstractClass( \Magento\Framework\ObjectManager\RelationsInterface::class ); - $this->serializerMock = $this->createMock(SerializerInterface::class); + $this->cacheManagerMock = $this->createMock(\Magento\Framework\Interception\Config\CacheManager::class); $this->objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); } @@ -88,9 +84,9 @@ public function testHasPluginsWhenDataIsNotCached($expectedResult, $type, $entit ->method('getAllScopes') ->will($this->returnValue(['global', 'backend', 'frontend'])); // turn cache off - $this->cacheMock->expects($this->any()) + $this->cacheManagerMock->expects($this->any()) ->method('load') - ->will($this->returnValue(false)); + ->will($this->returnValue(null)); $this->omConfigMock->expects($this->any()) ->method('getOriginalInstanceType') ->will($this->returnValueMap( @@ -138,21 +134,15 @@ public function testHasPluginsWhenDataIsNotCached($expectedResult, $type, $entit $this->relationsMock->expects($this->any())->method('has')->will($this->returnValue($expectedResult)); $this->relationsMock->expects($this->any())->method('getParents')->will($this->returnValue($entityParents)); - $this->serializerMock->expects($this->once()) - ->method('serialize'); - - $this->serializerMock->expects($this->never())->method('unserialize'); - $model = $this->objectManagerHelper->getObject( \Magento\Framework\Interception\Config\Config::class, [ 'reader' => $this->readerMock, 'scopeList' => $this->configScopeMock, - 'cache' => $this->cacheMock, + 'cacheManager' => $this->cacheManagerMock, 'relations' => $this->relationsMock, 'omConfig' => $this->omConfigMock, 'classDefinitions' => $this->definitionMock, - 'serializer' => $this->serializerMock ] ); @@ -177,32 +167,24 @@ public function testHasPluginsWhenDataIsCached($expectedResult, $type) 'virtual_custom_item' => true ]; $this->readerMock->expects($this->never())->method('read'); - $this->cacheMock->expects($this->never())->method('save'); - $serializedValue = 'serializedData'; - $this->cacheMock->expects($this->any()) + $this->cacheManagerMock->expects($this->never())->method('save'); + $this->cacheManagerMock->expects($this->any()) ->method('load') ->with($cacheId) - ->will($this->returnValue($serializedValue)); - - $this->serializerMock->expects($this->never())->method('serialize'); - $this->serializerMock->expects($this->once()) - ->method('unserialize') - ->with($serializedValue) - ->willReturn($interceptionData); + ->will($this->returnValue($interceptionData)); $model = $this->objectManagerHelper->getObject( \Magento\Framework\Interception\Config\Config::class, [ 'reader' => $this->readerMock, 'scopeList' => $this->configScopeMock, - 'cache' => $this->cacheMock, + 'cacheManager' => $this->cacheManagerMock, 'relations' => $this->objectManagerHelper->getObject( \Magento\Framework\ObjectManager\Relations\Runtime::class ), 'omConfig' => $this->omConfigMock, 'classDefinitions' => $this->definitionMock, 'cacheId' => $cacheId, - 'serializer' => $this->serializerMock ] ); From 0f4c7946bc003d05dfa4330ffb4a09cc08206435 Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Mon, 5 Nov 2018 09:44:42 -0600 Subject: [PATCH 018/131] MAGETWO-95212: block call to getCurrentUrl method is returning ajax request value - Removed unintended change --- app/code/Magento/Catalog/Block/Product/AbstractProduct.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index fb45246ea34..c8da0f70f73 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -266,7 +266,6 @@ public function getProductUrl($product, $additional = []) if (!isset($additional['_escape'])) { $additional['_escape'] = true; } - $additional['useUencPlaceholder'] = true; return $product->getUrlModel()->getUrl($product, $additional); } From 091a065cddb39c0f8f4d6a324e3aaa7dcad20c8c Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Mon, 5 Nov 2018 16:19:47 -0600 Subject: [PATCH 019/131] MAGETWO-95212: block call to getCurrentUrl method is returning ajax request value - Static fix --- app/code/Magento/CatalogWidget/Block/Product/ProductsList.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index 6f1e2259345..851f9e3fc5e 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -435,7 +435,7 @@ public function getAddToCartUrl($product, $additional = []) return parent::getAddToCartUrl($product, $additional); } - /* + /** * Get widget block name * * @return string From c8ac4261ef79f5259855f7460e08a8662dad7589 Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Wed, 7 Nov 2018 15:31:52 -0600 Subject: [PATCH 020/131] MAGETWO-95770: Saved multi line attribute data displayed incorrectly on customer edit address page - Fixed multiline customer address attribute data processing for admin --- .../Magento/Customer/Model/Customer/DataProvider.php | 11 +++++++++-- .../AdminCustomerAccountInformationSection.xml | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Customer/Model/Customer/DataProvider.php b/app/code/Magento/Customer/Model/Customer/DataProvider.php index ce976d3f62c..a3e121d3ce7 100644 --- a/app/code/Magento/Customer/Model/Customer/DataProvider.php +++ b/app/code/Magento/Customer/Model/Customer/DataProvider.php @@ -25,6 +25,7 @@ use Magento\Framework\Session\SessionManagerInterface; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool; +use Magento\Ui\Component\Form\Element\Multiline; use Magento\Ui\Component\Form\Field; use Magento\Ui\DataProvider\EavValidationRules; @@ -596,8 +597,14 @@ protected function prepareAddressData($addressId, array &$addresses, array $cust ) { $addresses[$addressId]['default_shipping'] = $customer['default_shipping']; } - if (isset($addresses[$addressId]['street']) && !is_array($addresses[$addressId]['street'])) { - $addresses[$addressId]['street'] = explode("\n", $addresses[$addressId]['street']); + + foreach ($this->meta['address']['children'] as $attributeName => $attributeMeta) { + if ($attributeMeta['arguments']['data']['config']['dataType'] === Multiline::NAME + && isset($addresses[$addressId][$attributeName]) + && !is_array($addresses[$addressId][$attributeName]) + ) { + $addresses[$addressId][$attributeName] = explode("\n", $addresses[$addressId][$attributeName]); + } } } diff --git a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml index a8c079824ef..e9776a43e3d 100644 --- a/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml +++ b/app/code/Magento/Customer/Test/Mftf/Section/AdminCustomerAccountInformationSection.xml @@ -12,6 +12,7 @@ + From e7247de8e972674bf95bc46f6eccb8b958c64392 Mon Sep 17 00:00:00 2001 From: Nathan Smith Date: Wed, 7 Nov 2018 15:35:46 -0600 Subject: [PATCH 021/131] MAGETWO-95770: Saved multi line attribute data displayed incorrectly on customer edit address page - Fixed static issues --- app/code/Magento/Customer/Model/Customer/DataProvider.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Model/Customer/DataProvider.php b/app/code/Magento/Customer/Model/Customer/DataProvider.php index a3e121d3ce7..31f126e937c 100644 --- a/app/code/Magento/Customer/Model/Customer/DataProvider.php +++ b/app/code/Magento/Customer/Model/Customer/DataProvider.php @@ -30,6 +30,8 @@ use Magento\Ui\DataProvider\EavValidationRules; /** + * Supplies the data for the customer UI component + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * * @api @@ -156,10 +158,11 @@ class DataProvider extends \Magento\Ui\DataProvider\AbstractDataProvider * @param Config $eavConfig * @param FilterPool $filterPool * @param FileProcessorFactory $fileProcessorFactory - * @param ContextInterface $context * @param array $meta * @param array $data + * @param ContextInterface $context * @param bool $allowToShowHiddenAttributes + * @throws \Magento\Framework\Exception\LocalizedException * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( From 4c495f2faa29edcaeebfe1ca1691754f3ef41b55 Mon Sep 17 00:00:00 2001 From: Patrick McLain Date: Wed, 7 Nov 2018 20:00:53 -0500 Subject: [PATCH 022/131] rebalance integration tests to prevent travis timeout --- dev/travis/before_script.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/travis/before_script.sh b/dev/travis/before_script.sh index 1dccc310c7a..3bd671dbaf8 100755 --- a/dev/travis/before_script.sh +++ b/dev/travis/before_script.sh @@ -13,9 +13,9 @@ case $TEST_SUITE in test_set_list=$(find testsuite/* -maxdepth 1 -mindepth 1 -type d | sort) test_set_count=$(printf "$test_set_list" | wc -l) - test_set_size[1]=$(printf "%.0f" $(echo "$test_set_count*0.17" | bc)) #17% - test_set_size[2]=$(printf "%.0f" $(echo "$test_set_count*0.27" | bc)) #27% - test_set_size[3]=$((test_set_count-test_set_size[1]-test_set_size[2])) #56% + test_set_size[1]=$(printf "%.0f" $(echo "$test_set_count*0.13" | bc)) #13% + test_set_size[2]=$(printf "%.0f" $(echo "$test_set_count*0.30" | bc)) #30% + test_set_size[3]=$((test_set_count-test_set_size[1]-test_set_size[2])) #55% echo "Total = ${test_set_count}; Batch #1 = ${test_set_size[1]}; Batch #2 = ${test_set_size[2]}; Batch #3 = ${test_set_size[3]};"; echo "==> preparing integration testsuite on index $INTEGRATION_INDEX with set size of ${test_set_size[$INTEGRATION_INDEX]}" From e0360fea947d2392b66d4a11ccbe195fe8f3758e Mon Sep 17 00:00:00 2001 From: Mariana Lashch Date: Thu, 8 Nov 2018 12:53:11 +0200 Subject: [PATCH 023/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - create MFTF test to cover fix --- .../ActionGroup/AdminOrderBraintreeFill.xml | 43 +++++++ .../Test/Mftf/Data/BraintreeData.xml | 1 + .../Test/Mftf/Section/AdminMenuSection.xml | 2 +- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 110 ++++++++++++++++++ .../ActionGroup/AdminInvoiceActionGroup.xml | 13 +++ .../ActionGroup/AdminOrderActionGroup.xml | 1 + .../AdminInvoiceMainActionsSection.xml | 2 + .../Section/AdminOrderInvoicesTabSection.xml | 1 + .../AdminCreateCartPriceRuleActionGroup.xml | 31 +++++ .../AdminCartPriceRulesFormSection.xml | 1 + .../Section/CartPriceRulesSubmenuSection.xml | 14 +++ .../Mftf/ActionGroup/AdminTaxActionGroup.xml | 27 +++++ .../Mftf/Section/AdminConfigureTaxSection.xml | 4 + 13 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFill.xml create mode 100644 app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml create mode 100644 app/code/Magento/SalesRule/Test/Mftf/Section/CartPriceRulesSubmenuSection.xml diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFill.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFill.xml new file mode 100644 index 00000000000..6ef70b1f386 --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFill.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml b/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml index 8f2588a6eff..ff98b6c91b5 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Data/BraintreeData.xml @@ -42,6 +42,7 @@ MerchantId PublicKey PrivateKey + Status Credit Card (Braintree) diff --git a/app/code/Magento/Braintree/Test/Mftf/Section/AdminMenuSection.xml b/app/code/Magento/Braintree/Test/Mftf/Section/AdminMenuSection.xml index 660c7393b40..eb7a9ce2c37 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Section/AdminMenuSection.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Section/AdminMenuSection.xml @@ -13,7 +13,7 @@ - + diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml new file mode 100644 index 00000000000..470c425f3da --- /dev/null +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -0,0 +1,110 @@ + + + + + + + + + + <description value="Admin should be able to open a New Credit Memo Page from Invoice Page for Order with tax and discount and payed using online payment method"/> + <severity value="CRITICAL"/> + <testCaseId value="MAGETWO-94472"/> + <group value="sales"/> + </annotations> + + <before> + <!--Create Default Category--> + <createData entity="SimpleSubCategory" stepKey="createCategory"/> + + <!--Create Simple product with Special Price--> + <createData entity="_defaultProduct" stepKey="simpleProduct"> + <requiredEntity createDataKey="createCategory"/> + </createData> + + <!--Create Tax Rule is based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 --> + <createData entity="SimpleTaxRule" stepKey="createTaxRule"/> + + <!--Configure Braintree Payment method--> + <createData entity="BraintreeConfig" stepKey="BraintreeConfigurationData"/> + <createData entity="CustomBraintreeConfigurationData" stepKey="enableBraintree"/> + + <!--Create Retailer Customer with US_CA address--> + <createData entity="Simple_US_Customer_CA" stepKey="simpleCustomer"> + <field key="group_id">3</field> + </createData> + + <!--Login as Admin User--> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + + <after> + <!--Delete Cart Price Rule--> + <actionGroup ref="AdminDeleteCartPriceRuleForRetailerActionGroup" stepKey="deleteSalesRule"/> + + <!--Delete Simple Sub Category--> + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> + + <!--Delete Simple Product--> + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> + + <!-- Delete Tax Rule --> + <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> + + <!-- Rollback Braintree to Default --> + <createData entity="DefaultBraintreeConfig" stepKey="DefaultBraintreeConfig"/> + + <!--Delete Customer--> + <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> + + <!--Log Out--> + <actionGroup ref="logout" stepKey="logout"/> + </after> + + <!-- Create a cart price rule for Fixed amount discount for whole cart --> + <actionGroup ref="AdminCreateCartPriceRuleForRetailerActionGroup" stepKey="createCartPriceRule"/> + + <!--Set Taxable Goods for Shipping Tax Class--> + <actionGroup ref="changeShippingTaxClass" stepKey="changeShippingTaxClass"/> + + <!--Adding Special price to product--> + <amOnPage url="{{AdminProductEditPage.url($$simpleProduct.id$$)}}" stepKey="openAdminProductEditPage"/> + <actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPrice"/> + <actionGroup ref="saveProductForm" stepKey="saveProductForm"/> + + <!--Create New Order--> + <actionGroup ref="navigateToNewOrderPageExistingCustomer" stepKey="navigateToNewOrderWithExistingCustomer"> + <argument name="customer" value="$$simpleCustomer$$"/> + </actionGroup> + + <!--Add a product to order--> + <actionGroup ref="addSimpleProductToOrder" stepKey="addProductToOrder"> + <argument name="product" value="$$simpleProduct$$"/> + </actionGroup> + + <!--Select FlatRate shipping method--> + <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> + + <!--Select Braintree online Payment method --> + <actionGroup ref="AdminOrderBraintreeFill" stepKey="selectCreditCardPayment"/> + + <!--Submit Order--> + <click stepKey="submitOrder" selector="{{NewOrderSection.submitOrder}}"/> + <waitForPageLoad stepKey="waitForSaveConfig" time="10"/> + <waitForElementVisible selector="{{NewOrderSection.successMessage}}" stepKey="waitForSuccessMessage" time="5"/> + + <!-- Create New invoice--> + <actionGroup ref="adminFastCreateInvoice" stepKey="createInvoice"/> + + <!--Get access to Credit Memo page from Invocie page--> + <click selector="{{AdminInvoiceMainActionsSection.openNewCreditMemoFromInvoice}}" stepKey="clickCreateNewCreditMemo"/> + <waitForPageLoad stepKey="waitForLoadNewCreditMemoPage" time="5"/> + <waitForElementVisible selector="{{AdminCreditMemoOrderInformationSection.orderId}}" stepKey="waitForOrderIdOnCreditMemoPage"/> + </test> +</tests> \ No newline at end of file diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml index 15aff7c751a..6cda4e143c9 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminInvoiceActionGroup.xml @@ -38,4 +38,17 @@ </arguments> <see selector="{{AdminInvoiceItemsSection.skuColumn}}" userInput="{{product.sku}}" stepKey="seeProductSkuInGrid"/> </actionGroup> + + <!--Admin Fast Create Invoice--> + <actionGroup name="adminFastCreateInvoice"> + <click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceButton"/> + <waitForPageLoad stepKey="waitForNewInvoicePageLoad" time="3"/> + <click selector="{{AdminInvoiceMainActionsSection.submitInvoice}}" stepKey="clickSubmitInvoice"/> + <waitForPageLoad stepKey="waitForSuccessMessageLoad" time="5"/> + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessMessage"/> + <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickInvoices"/> + <waitForLoadingMaskToDisappear stepKey="waitForLoadingMask5" /> + <click selector="{{AdminOrderInvoicesTabSection.viewInvoice}}" stepKey="openInvoicePage"/> + <waitForPageLoad stepKey="waitForInvoicePageLoad" time="5"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml index c82623632d7..4801c3c6f85 100644 --- a/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml +++ b/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOrderActionGroup.xml @@ -92,6 +92,7 @@ <fillField selector="{{AdminOrderFormItemsSection.rowQty('1')}}" userInput="1" stepKey="fillProductQty"/> <scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/> <click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/> + <wait time="5" stepKey="waitForOptionsToLoad"/> </actionGroup> <!--Add configurable product to order --> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceMainActionsSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceMainActionsSection.xml index 2a241708517..bc7fc8145af 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceMainActionsSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminInvoiceMainActionsSection.xml @@ -10,5 +10,7 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminInvoiceMainActionsSection"> <element name="submitInvoice" type="button" selector=".action-default.scalable.save.submit-button.primary"/> + <element name="openNewCreditMemoFromInvoice" type="button" selector=".action-default.scalable.credit-memo"/> + <element name="submitNewRefundFromInvoice" type="button" selector=".action-default.scalable.save.submit-button refund primary"/> </section> </sections> diff --git a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderInvoicesTabSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderInvoicesTabSection.xml index b33276bed52..4ebce4de6b3 100644 --- a/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderInvoicesTabSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminOrderInvoicesTabSection.xml @@ -12,5 +12,6 @@ <element name="spinner" type="text" selector="[data-role='spinner'][data-component*='sales_order_view_invoice']"/> <element name="gridRow" type="text" selector="#sales_order_view_tabs_order_invoices_content .data-grid tbody > tr:nth-of-type({{row}})" parameterized="true"/> <element name="viewGridRow" type="button" selector="#sales_order_view_tabs_order_invoices_content .data-grid tbody > tr:nth-of-type({{row}}) a[href*='order_invoice/view']" parameterized="true"/> + <element name="viewInvoice" type="button" selector="//div[@class='admin__data-grid-wrap']//a[@class='action-menu-item']"/> </section> </sections> \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml index 87947fba809..6a837577ece 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml @@ -23,4 +23,35 @@ <click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/> <see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> </actionGroup> + + <!--Create Cart price Rule for Retailer customer--> + <actionGroup name="AdminCreateCartPriceRuleForRetailerActionGroup"> + <click selector="{{AdminMenuSection.marketing}}" stepKey="clickOnMarketing" /> + <waitForPageLoad stepKey="waitForMarketing" time="3"/> + <click selector="{{CartPriceRulesSubmenuSection.cartPriceRules}}" stepKey="clickOnCartPriceRules"/> + <waitForPageLoad stepKey="waitForCartPriceRules" time="5"/> + <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> + <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectCustomerGroup"/> + <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Percent of product price discount" stepKey="selectActionType"/> + <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="10" stepKey="fillDiscountAmount"/> + <click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForCartRuleLoad" time="5"/> + <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> + </actionGroup> + + <!--Delete Cart price Rule for Retailer customer--> + <actionGroup name="AdminDeleteCartPriceRuleForRetailerActionGroup"> + <click selector="{{AdminMenuSection.marketing}}" stepKey="clickOnMarketing" /> + <waitForPageLoad stepKey="waitForMarketing" time="3"/> + <click selector="{{CartPriceRulesSubmenuSection.cartPriceRules}}" stepKey="clickOnCartPriceRules"/> + <waitForPageLoad stepKey="waitForCartPriceRules" time="5"/> + <fillField selector="{{AdminCartPriceRulesSection.filterByNameInput}}" userInput="{{SimpleSalesRule.name}}" stepKey="filterByName"/> + <click selector="{{AdminCartPriceRulesSection.searchButton}}" stepKey="doFilter"/> + <click selector="{{AdminCartPriceRulesSection.rowByIndex('1')}}" stepKey="goToEditRulePage"/> + <click selector="{{AdminCartPriceRulesFormSection.delete}}" stepKey="clickDeleteButton"/> + <click selector="{{AdminCartPriceRulesFormSection.modalAcceptButton}}" stepKey="confirmDelete"/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml index d8253505c42..480c266101d 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml @@ -26,6 +26,7 @@ <element name="priority" type="input" selector="//*[@name='sort_order']"/> <!-- Actions sub-form --> + <element name="actionsTab" type="text" selector="//div[@data-index='actions']//span[contains(.,'Actions')][1]"/> <element name="actionsHeader" type="button" selector="div[data-index='actions']" timeout="30"/> <element name="apply" type="select" selector="select[name='simple_action']"/> <element name="conditions" type="button" selector=".rule-param.rule-param-new-child > a"/> diff --git a/app/code/Magento/SalesRule/Test/Mftf/Section/CartPriceRulesSubmenuSection.xml b/app/code/Magento/SalesRule/Test/Mftf/Section/CartPriceRulesSubmenuSection.xml new file mode 100644 index 00000000000..f3d5e9627ef --- /dev/null +++ b/app/code/Magento/SalesRule/Test/Mftf/Section/CartPriceRulesSubmenuSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> + <section name="CartPriceRulesSubmenuSection"> + <element name="cartPriceRules" type="button" selector="//li[@data-ui-id='menu-magento-catalogrule-promo']//li[@data-ui-id='menu-magento-salesrule-promo-quote']"/> + </section> +</sections> \ No newline at end of file diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml index 1a95bf0282b..15dcaf66f12 100644 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml @@ -115,4 +115,31 @@ <!-- Save the tax rate --> <click stepKey="saveTaxRate" selector="{{AdminTaxRulesSection.save}}"/> </actionGroup> + + <!--Set Tax Class for Shipping--> + <actionGroup name="changeShippingTaxClass"> + <!--Select Configuration menu from Store--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES" /> + <waitForPageLoad stepKey="waitForConfiguration" time="5"/> + <click selector="{{StoresSubmenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <waitForPageLoad stepKey="waitForSales" time="5"/> + <!--Double click the same to fix flaky issue with redirection to Dashboard--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1" /> + <waitForPageLoad stepKey="waitForConfiguration1" time="5"/> + <click selector="{{StoresSubmenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <waitForPageLoad stepKey="waitForSales1" time="5"/> + <!--Change default tax class for Shipping on Taxable Goods--> + <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales" /> + <waitForPageLoad stepKey="waitForPaymentMethods" time="5"/> + <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> + <waitForPageLoad stepKey="waitForTax" time="5"/> + <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> + <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> + <!-- Save the settings --> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> </actionGroups> diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml index 8e52800516d..e0a3092c133 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml @@ -10,7 +10,11 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminConfigureTaxSection"> <!-- on page /admin/admin/system_config/edit/section/tax/ --> + <element name="salesTax" type="button" selector="//a[contains(@class, 'admin__page-nav-link item-nav')]/span[text()='Tax']"/> <element name="taxClasses" type="block" selector="#tax_classes-head" timeout="30"/> + <element name="taxClassShipping" type="select" selector="#tax_classes_shipping_tax_class"/> + <element name="taxClassProduct" type="select" selector="#tax_classes_default_product_tax_class"/> + <element name="taxClassCustomer" type="select" selector="#tax_classes_default_customer_tax_class"/> <element name="taxCalculationSettings" type="block" selector="#tax_calculation-head" timeout="30"/> <element name="taxCalculationSettingsOpened" type="block" selector="#tax_calculation-head.open" timeout="30"/> From 3de065bfeefbe324d1db903800efb6a95824e076 Mon Sep 17 00:00:00 2001 From: Rain2o <jrainwater@thinkpyxl.com> Date: Wed, 11 Jul 2018 17:29:24 -0400 Subject: [PATCH 024/131] Include multiselect options using custom source models --- .../Product/Indexer/Eav/Source.php | 71 ++++++++++++++++--- 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php index 3a61e7e3644..30b49dfeda1 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php @@ -24,22 +24,29 @@ class Source extends AbstractEav */ protected $_resourceHelper; - /** - * Construct - * - * @param \Magento\Framework\Model\ResourceModel\Db\Context $context - * @param \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper - * @param null|string $connectionName - */ + /** + * @var \Magento\Eav\Api\AttributeRepositoryInterface + */ + protected $_attributeRepository; + + /** + * Construct + * + * @param \Magento\Framework\Model\ResourceModel\Db\Context $context + * @param \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy + * @param \Magento\Eav\Model\Config $eavConfig + * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper + * @param \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository + * @param null|string $connectionName + */ public function __construct( \Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, + \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository, $connectionName = null ) { parent::__construct( @@ -50,6 +57,7 @@ public function __construct( $connectionName ); $this->_resourceHelper = $resourceHelper; + $this->_attributeRepository = $attributeRepository; } /** @@ -234,6 +242,9 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu $options[$row['attribute_id']][$row['option_id']] = true; } + // Include custom source model options + $options = $this->_getMultiSelectAttributeWithSourceModels($attrIds, $options); + // prepare get multiselect values query $productValueExpression = $connection->getCheckSql('pvs.value_id > 0', 'pvs.value', 'pvd.value'); $select = $connection->select()->from( @@ -297,6 +308,46 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu return $this; } + /** + * Get options for multiselect attributes using custom source models + * @maderlock's fix from: https://github.com/magento/magento2/issues/417#issuecomment-265146285 + * + * @param array $attrIds + * @param array $options + * + * @return array + * @throws \Zend_Db_Statement_Exception + */ + protected function _getMultiSelectAttributeWithSourceModels( $attrIds, $options ) { + // Add options from custom source models + $select = $this->getConnection()->select() + ->from( + ['ea' => $this->getTable('eav_attribute')], + ['attribute_id','entity_type_id', 'attribute_code'] + ) + ->where('attribute_id IN(?)', $attrIds) + ->where('source_model is not null'); + $query = $select->query(); + + while ($row = $query->fetch()) { + try { + /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */ + $attribute = $this->_attributeRepository->get($row['entity_type_id'], $row['attribute_code']); + $sourceModelOptions = $attribute->getOptions(); + // Add options to list used below + foreach ($sourceModelOptions as $o) { + $options[$row['attribute_id']][$o->getValue()] = true; + } + } catch (\BadMethodCallException $e) { + // Skip + } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + // skip + } + } + + return $options; + } + /** * Save a data to temporary source index table * From c6352c6c9166eba48d86852774b876ecaf34ebd8 Mon Sep 17 00:00:00 2001 From: Rain2o <jrainwater@thinkpyxl.com> Date: Thu, 12 Jul 2018 10:34:35 -0400 Subject: [PATCH 025/131] Fixed PHP sniffer errors. --- .../Product/Indexer/Eav/Source.php | 113 +++++++++--------- 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php index 30b49dfeda1..ab09171a6f2 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php @@ -24,29 +24,29 @@ class Source extends AbstractEav */ protected $_resourceHelper; - /** - * @var \Magento\Eav\Api\AttributeRepositoryInterface - */ + /** + * @var \Magento\Eav\Api\AttributeRepositoryInterface + */ protected $_attributeRepository; - /** - * Construct - * - * @param \Magento\Framework\Model\ResourceModel\Db\Context $context - * @param \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Framework\Event\ManagerInterface $eventManager - * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper - * @param \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository - * @param null|string $connectionName - */ + /** + * Construct + * + * @param \Magento\Framework\Model\ResourceModel\Db\Context $context + * @param \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy + * @param \Magento\Eav\Model\Config $eavConfig + * @param \Magento\Framework\Event\ManagerInterface $eventManager + * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper + * @param \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository + * @param null|string $connectionName + */ public function __construct( \Magento\Framework\Model\ResourceModel\Db\Context $context, \Magento\Framework\Indexer\Table\StrategyInterface $tableStrategy, \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, - \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository, + \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository, $connectionName = null ) { parent::__construct( @@ -242,8 +242,8 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu $options[$row['attribute_id']][$row['option_id']] = true; } - // Include custom source model options - $options = $this->_getMultiSelectAttributeWithSourceModels($attrIds, $options); + // Include custom source model options + $options = $this->_getMultiSelectAttributeWithSourceModels($attrIds, $options); // prepare get multiselect values query $productValueExpression = $connection->getCheckSql('pvs.value_id > 0', 'pvs.value', 'pvd.value'); @@ -308,45 +308,46 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu return $this; } - /** - * Get options for multiselect attributes using custom source models - * @maderlock's fix from: https://github.com/magento/magento2/issues/417#issuecomment-265146285 - * - * @param array $attrIds - * @param array $options - * - * @return array - * @throws \Zend_Db_Statement_Exception - */ - protected function _getMultiSelectAttributeWithSourceModels( $attrIds, $options ) { - // Add options from custom source models - $select = $this->getConnection()->select() - ->from( - ['ea' => $this->getTable('eav_attribute')], - ['attribute_id','entity_type_id', 'attribute_code'] - ) - ->where('attribute_id IN(?)', $attrIds) - ->where('source_model is not null'); - $query = $select->query(); - - while ($row = $query->fetch()) { - try { - /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */ - $attribute = $this->_attributeRepository->get($row['entity_type_id'], $row['attribute_code']); - $sourceModelOptions = $attribute->getOptions(); - // Add options to list used below - foreach ($sourceModelOptions as $o) { - $options[$row['attribute_id']][$o->getValue()] = true; - } - } catch (\BadMethodCallException $e) { - // Skip - } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { - // skip - } - } - - return $options; - } + /** + * Get options for multiselect attributes using custom source models + * @maderlock's fix from: https://github.com/magento/magento2/issues/417#issuecomment-265146285 + * + * @param array $attrIds + * @param array $options + * + * @return array + * @throws \Zend_Db_Statement_Exception + */ + protected function _getMultiSelectAttributeWithSourceModels($attrIds, $options) + { + // Add options from custom source models + $select = $this->getConnection()->select() + ->from( + ['ea' => $this->getTable('eav_attribute')], + ['attribute_id','entity_type_id', 'attribute_code'] + ) + ->where('attribute_id IN(?)', $attrIds) + ->where('source_model is not null'); + $query = $select->query(); + + while ($row = $query->fetch()) { + try { + /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */ + $attribute = $this->_attributeRepository->get($row['entity_type_id'], $row['attribute_code']); + $sourceModelOptions = $attribute->getOptions(); + // Add options to list used below + foreach ($sourceModelOptions as $o) { + $options[$row['attribute_id']][$o->getValue()] = true; + } + } catch (\BadMethodCallException $e) { + // Skip + } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + // skip + } + } + + return $options; + } /** * Save a data to temporary source index table From 53e6f67300259358f6e533c3eed8e0e939ca782f Mon Sep 17 00:00:00 2001 From: Mariana Lashch <mlashch@magento.com> Date: Thu, 8 Nov 2018 16:29:40 +0200 Subject: [PATCH 026/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - add minor changes to test --- ...raintreeFill.xml => AdminOrderBraintreeFillActionGroup.xml} | 3 +-- ...etateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) rename app/code/Magento/Braintree/Test/Mftf/ActionGroup/{AdminOrderBraintreeFill.xml => AdminOrderBraintreeFillActionGroup.xml} (97%) diff --git a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFill.xml b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFillActionGroup.xml similarity index 97% rename from app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFill.xml rename to app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFillActionGroup.xml index 6ef70b1f386..c2e6af9dcd7 100644 --- a/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFill.xml +++ b/app/code/Magento/Braintree/Test/Mftf/ActionGroup/AdminOrderBraintreeFillActionGroup.xml @@ -8,8 +8,7 @@ <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> - <actionGroup name="AdminOrderBraintreeFill"> - + <actionGroup name="AdminOrderBraintreeFillActionGroup"> <!--Select Braintree Payment method on Admin Order Create Page--> <click stepKey="chooseBraintree" selector="{{NewOrderSection.creditCardBraintree}}"/> <waitForPageLoad stepKey="waitForBraintreeConfigs" time="5"/> diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 470c425f3da..a7c0e8f6254 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -92,7 +92,7 @@ <actionGroup ref="orderSelectFlatRateShipping" stepKey="orderSelectFlatRateShippingMethod"/> <!--Select Braintree online Payment method --> - <actionGroup ref="AdminOrderBraintreeFill" stepKey="selectCreditCardPayment"/> + <actionGroup ref="AdminOrderBraintreeFillActionGroup" stepKey="selectCreditCardPayment"/> <!--Submit Order--> <click stepKey="submitOrder" selector="{{NewOrderSection.submitOrder}}"/> From fad135663cc088694ef492a0d676c9a85e30450b Mon Sep 17 00:00:00 2001 From: Nathan Smith <nathsmit@adobe.com> Date: Thu, 8 Nov 2018 09:47:07 -0600 Subject: [PATCH 027/131] MAGETWO-95770: Saved multi line attribute data displayed incorrectly on customer edit address page - Adjusted test --- .../Customer/Test/Unit/Model/Customer/DataProviderTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php index 50c21379054..d13c173cb12 100644 --- a/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php +++ b/app/code/Magento/Customer/Test/Unit/Model/Customer/DataProviderTest.php @@ -649,10 +649,8 @@ public function testGetData() 2 => [ 'firstname' => 'firstname', 'lastname' => 'lastname', - 'street' => [ - 'street', - 'street', - ], + // Won't be an array because it isn't defined as a multiline field in this test + 'street' => "street\nstreet", 'default_billing' => 2, 'default_shipping' => 2, ] From a6aa2394b1674c428cf5c466dd92133aea1722c0 Mon Sep 17 00:00:00 2001 From: Mariana Lashch <mlashch@magento.com> Date: Thu, 8 Nov 2018 18:20:49 +0200 Subject: [PATCH 028/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - add action --- .../Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml index 889db82db64..357f496b1cb 100644 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml @@ -135,6 +135,7 @@ <waitForPageLoad stepKey="waitForTax" time="5"/> <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="openTaxClassSection"/> <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> <!-- Save the settings --> <scrollToTopOfPage stepKey="scrollToTop"/> From f70f7f772f7ad16f115e989812a7462d0d8a2f39 Mon Sep 17 00:00:00 2001 From: Mariana Lashch <mlashch@magento.com> Date: Thu, 8 Nov 2018 18:56:16 +0200 Subject: [PATCH 029/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - add element and action on it --- .../Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml | 1 + .../Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml index 357f496b1cb..3009fa1fc8a 100644 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml @@ -136,6 +136,7 @@ <seeInCurrentUrl url="{{AdminTaxConfigurationPage.url}}" stepKey="adminTaxConfiguration"/> <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="openTaxClassSection"/> + <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="uncheckSystemValue"/> <selectOption selector="{{AdminConfigureTaxSection.taxClassShipping}}" userInput="Taxable Goods" stepKey="setTaxClassForShipping"/> <!-- Save the settings --> <scrollToTopOfPage stepKey="scrollToTop"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml index e0a3092c133..681b3a37f50 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminConfigureTaxSection.xml @@ -12,6 +12,7 @@ <!-- on page /admin/admin/system_config/edit/section/tax/ --> <element name="salesTax" type="button" selector="//a[contains(@class, 'admin__page-nav-link item-nav')]/span[text()='Tax']"/> <element name="taxClasses" type="block" selector="#tax_classes-head" timeout="30"/> + <element name="taxShippingClassSystem" type="checkbox" selector="#tax_classes_shipping_tax_class_inherit"/> <element name="taxClassShipping" type="select" selector="#tax_classes_shipping_tax_class"/> <element name="taxClassProduct" type="select" selector="#tax_classes_default_product_tax_class"/> <element name="taxClassCustomer" type="select" selector="#tax_classes_default_customer_tax_class"/> From 1862d2c02744a33a5b8b1a44eab53adf1bb79048 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi <mankivsk@adobe.com> Date: Thu, 8 Nov 2018 11:53:19 -0600 Subject: [PATCH 030/131] ENGCOM-3243: Write intercepted mapping to generated/metadata during compilation #18648 - Fixed docblock --- .../Framework/Interception/AbstractPlugin.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php index 60eb511dcb6..2a34f18fb0a 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php @@ -7,25 +7,35 @@ /** * Class GeneralTest + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ abstract class AbstractPlugin extends \PHPUnit\Framework\TestCase { /** + * Config reader + * * @var \PHPUnit_Framework_MockObject_MockObject */ protected $_configReader; /** + * Object Manager + * * @var \Magento\Framework\ObjectManagerInterface */ protected $_objectManager; /** + * Applicartion Object Manager + * * @var \Magento\Framework\ObjectManagerInterface */ private $applicationObjectManager; + /** + * Set up + */ public function setUp() { if (!$this->_objectManager) { @@ -36,11 +46,17 @@ public function setUp() \Magento\Framework\App\ObjectManager::setInstance($this->_objectManager); } + /** + * Tear down + */ public function tearDown() { \Magento\Framework\App\ObjectManager::setInstance($this->applicationObjectManager); } + /** + * Set up Interception Config + */ public function setUpInterceptionConfig($pluginConfig) { $config = new \Magento\Framework\Interception\ObjectManager\Config\Developer(); From 2f5b730fa800c528e8f38da91154089f094090dc Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi <mankivsk@adobe.com> Date: Thu, 8 Nov 2018 11:54:35 -0600 Subject: [PATCH 031/131] ENGCOM-3243: Write intercepted mapping to generated/metadata during compilation #18648 - Fixed static test --- .../Framework/Interception/Config/CacheManagerTest.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php index 9d5abd1a8a6..6b0487d4afd 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php @@ -40,7 +40,8 @@ protected function setUp() $this->serializer = $this->objectManager->get(\Magento\Framework\Serialize\SerializerInterface::class); $this->cache = $this->objectManager->get(\Magento\Framework\App\CacheInterface::class); - $this->configWriter = $this->objectManager->get(\Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem::class); + $this->configWriter = + $this->objectManager->get(\Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem::class); $this->initializeMetadataDirectory(); } @@ -125,7 +126,9 @@ private function getConfig() \Magento\Framework\Interception\Config\CacheManager::class, [ 'cacheId' => self::CACHE_ID, - 'compiledLoader' => $this->objectManager->create(\Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::class), + 'compiledLoader' => $this->objectManager->create( + \Magento\Framework\App\ObjectManager\ConfigLoader\Compiled::class + ), ] ); } From 9135654c9f123ca8a22f0aa23677fa8222912e9a Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi <mankivsk@adobe.com> Date: Thu, 8 Nov 2018 11:55:42 -0600 Subject: [PATCH 032/131] ENGCOM-3243: Write intercepted mapping to generated/metadata during compilation #18648 - Fixed docblock --- .../Magento/Framework/Interception/Config/CacheManager.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/internal/Magento/Framework/Interception/Config/CacheManager.php b/lib/internal/Magento/Framework/Interception/Config/CacheManager.php index cd16e2277d8..a754215bbe7 100644 --- a/lib/internal/Magento/Framework/Interception/Config/CacheManager.php +++ b/lib/internal/Magento/Framework/Interception/Config/CacheManager.php @@ -9,8 +9,9 @@ namespace Magento\Framework\Interception\Config; /** - * Interception cache manager responsible for handling interaction with compiled and - * uncompiled interception data + * Interception cache manager. + * + * Responsible for handling interaction with compiled and uncompiled interception data */ class CacheManager { From 5db83d30c9ca29a0f6613932196c9b0f3bc89de8 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi <mankivsk@adobe.com> Date: Thu, 8 Nov 2018 11:58:27 -0600 Subject: [PATCH 033/131] ENGCOM-3243: Write intercepted mapping to generated/metadata during compilation #18648 Fixed dockblock --- .../Framework/Interception/Config/Config.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/internal/Magento/Framework/Interception/Config/Config.php b/lib/internal/Magento/Framework/Interception/Config/Config.php index 4eeed4788a0..7632970705f 100644 --- a/lib/internal/Magento/Framework/Interception/Config/Config.php +++ b/lib/internal/Magento/Framework/Interception/Config/Config.php @@ -1,7 +1,5 @@ <?php /** - * Interception config. Responsible for providing list of plugins configured for instance - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -9,6 +7,11 @@ use Magento\Framework\Serialize\SerializerInterface; +/** + * Interception config. + * + * Responsible for providing list of plugins configured for instance + */ class Config implements \Magento\Framework\Interception\ConfigInterface { /** @@ -110,7 +113,8 @@ public function __construct( $this->_cacheId = $cacheId; $this->_reader = $reader; $this->_scopeList = $scopeList; - $this->cacheManager = $cacheManager ?? \Magento\Framework\App\ObjectManager::getInstance()->get(CacheManager::class); + $this->cacheManager = + $cacheManager ?? \Magento\Framework\App\ObjectManager::getInstance()->get(CacheManager::class); $intercepted = $this->cacheManager->load($cacheId); if ($intercepted !== null) { $this->_intercepted = $intercepted; @@ -166,7 +170,7 @@ protected function _inheritInterception($type) } /** - * {@inheritdoc} + * @inheritdoc */ public function hasPlugins($type) { @@ -193,7 +197,7 @@ private function initializeUncompiled($classDefinitions = []) /** * Generate intercepted array to store in compiled metadata or frontend cache * - * @param $classDefinitions + * @param array $classDefinitions */ private function generateIntercepted($classDefinitions) { From 40c58fc482c87a0840e2b1d05c3f951c30f140f2 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi <mankivsk@adobe.com> Date: Thu, 8 Nov 2018 11:59:34 -0600 Subject: [PATCH 034/131] ENGCOM-3243: Write intercepted mapping to generated/metadata during compilation #18648 - Fixed docblock --- setup/src/Magento/Setup/Console/Command/DiCompileCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php b/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php index ee26e71d94f..014d699cb23 100644 --- a/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php +++ b/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php @@ -103,7 +103,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ protected function configure() { @@ -132,7 +132,7 @@ private function checkEnvironment() } /** - * {@inheritdoc} + * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output) { From be71e3b26e103dbecffa1f9397b20f7e794e36f3 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi <mankivsk@adobe.com> Date: Thu, 8 Nov 2018 12:01:00 -0600 Subject: [PATCH 035/131] ENGCOM-3243: Write intercepted mapping to generated/metadata during compilation #18648 - Fixed docblock --- .../src/Magento/Setup/Module/Di/App/Task/Operation/Area.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php index 7acc84e356c..edc2a485278 100644 --- a/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php +++ b/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php @@ -10,6 +10,9 @@ use Magento\Setup\Module\Di\Compiler\Config; use Magento\Setup\Module\Di\Definition\Collection as DefinitionsCollection; +/** + * Area configuration aggregation + */ class Area implements OperationInterface { /** @@ -67,7 +70,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function doOperation() { From b80d92d59882c4f686aa8e538ad167ef4630be43 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi <mankivsk@adobe.com> Date: Thu, 8 Nov 2018 12:02:10 -0600 Subject: [PATCH 036/131] ENGCOM-3243: Write intercepted mapping to generated/metadata during compilation #18648 - Fixed docblock --- .../Setup/Module/Di/Compiler/Config/Writer/Filesystem.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php b/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php index ee9321c5d41..953dc04f4cd 100644 --- a/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php +++ b/setup/src/Magento/Setup/Module/Di/Compiler/Config/Writer/Filesystem.php @@ -11,6 +11,8 @@ use Magento\Setup\Module\Di\Compiler\Config\WriterInterface; /** + * Class for writing DI Compiler Configuration + * * @deprecated Moved to Framework to allow broader reuse * @see \Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem */ From 33435b7c4ac6ca2fdbaf07a393ba8d96f97de068 Mon Sep 17 00:00:00 2001 From: Sviatoslav Mankivskyi <mankivsk@adobe.com> Date: Thu, 8 Nov 2018 12:02:45 -0600 Subject: [PATCH 037/131] ENGCOM-3243: Write intercepted mapping to generated/metadata during compilation #18648 - Fixed static test --- .../Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php index 03b423bb32b..fbdbc951462 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php @@ -48,7 +48,8 @@ protected function setUp() $this->configReaderMock = $this->getMockBuilder(\Magento\Setup\Module\Di\Compiler\Config\Reader::class) ->disableOriginalConstructor() ->getMock(); - $this->configWriterMock = $this->getMockBuilder(\Magento\Framework\App\ObjectManager\ConfigWriterInterface::class) + $this->configWriterMock = + $this->getMockBuilder(\Magento\Framework\App\ObjectManager\ConfigWriterInterface::class) ->disableOriginalConstructor() ->getMock(); $this->configChain = $this->getMockBuilder(\Magento\Setup\Module\Di\Compiler\Config\ModificationChain::class) From 023a39177eb8889f291f92f3651c22c4c28c2908 Mon Sep 17 00:00:00 2001 From: Mariana Lashch <mlashch@magento.com> Date: Fri, 9 Nov 2018 15:18:52 +0200 Subject: [PATCH 038/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - fix issue with enabled Braintree and shipping tax class --- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 5 +++- .../Mftf/ActionGroup/AdminTaxActionGroup.xml | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index a7c0e8f6254..7c0a503e7bb 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -48,6 +48,9 @@ <!--Delete Cart Price Rule--> <actionGroup ref="AdminDeleteCartPriceRuleForRetailerActionGroup" stepKey="deleteSalesRule"/> + <!--Set to default configuration Tax Shipping Class--> + <actionGroup ref="setDefaultShippingTaxClass" stepKey="setdefaultClass"/> + <!--Delete Simple Sub Category--> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> @@ -58,7 +61,7 @@ <deleteData createDataKey="createTaxRule" stepKey="deleteTaxRule"/> <!-- Rollback Braintree to Default --> - <createData entity="DefaultBraintreeConfig" stepKey="DefaultBraintreeConfig"/> + <createData entity="RollBackCustomBraintreeConfigurationData" stepKey="rollbackBraintreeConfig"/> <!--Delete Customer--> <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> diff --git a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml index 3009fa1fc8a..4f724fb0047 100644 --- a/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml +++ b/app/code/Magento/Tax/Test/Mftf/ActionGroup/AdminTaxActionGroup.xml @@ -145,6 +145,32 @@ <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> </actionGroup> + <actionGroup name="setDefaultShippingTaxClass"> + <!--Select Configuration menu from Store--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES" /> + <waitForPageLoad stepKey="waitForConfiguration" time="5"/> + <click selector="{{StoresSubmenuSection.configuration}}" stepKey="clickOnConfigurations"/> + <waitForPageLoad stepKey="waitForSales" time="5"/> + <!--Double click the same to fix flaky issue with redirection to Dashboard--> + <click selector="{{AdminMenuSection.stores}}" stepKey="clickOnSTORES1" /> + <waitForPageLoad stepKey="waitForConfiguration1" time="5"/> + <click selector="{{StoresSubmenuSection.configuration}}" stepKey="clickOnConfigurations1"/> + <waitForPageLoad stepKey="waitForSales1" time="5"/> + <!--Change default tax class for Shipping on Taxable Goods--> + <click selector="{{ConfigurationListSection.sales}}" stepKey="clickOnSales" /> + <waitForPageLoad stepKey="waitForPaymentMethods" time="5"/> + <click selector="{{AdminConfigureTaxSection.salesTax}}" stepKey="clickOnTax"/> + <waitForPageLoad stepKey="waitForTax" time="5"/> + <seeElement selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="taxClassSectionC"/> + <click selector="{{AdminConfigureTaxSection.taxShippingClassSystem}}" stepKey="checkSystemDefaultValue"/> + <click selector="{{AdminConfigureTaxSection.taxClasses}}" stepKey="closeTaxClassSection"/> + <!-- Save the settings --> + <scrollToTopOfPage stepKey="scrollToTop"/> + <click stepKey="saveTaxOptions" selector="{{AdminCategoryMainActionsSection.SaveButton}}"/> + <waitForPageLoad stepKey="waitForTaxSaved"/> + <see stepKey="seeSuccess" selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration."/> + </actionGroup> + <!--Add Product Tax Class--> <actionGroup name="addProductTaxClass"> <arguments> From 493e5b6f7448b0eb42829db2dcd424acf180cdf8 Mon Sep 17 00:00:00 2001 From: Nathan Smith <nathsmit@adobe.com> Date: Fri, 9 Nov 2018 11:06:12 -0600 Subject: [PATCH 039/131] MAGETWO-95212: Dynamic block call to getCurrentUrl method is returning ajax request value - Fixed product compare link --- app/code/Magento/Catalog/Helper/Product/Compare.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Helper/Product/Compare.php b/app/code/Magento/Catalog/Helper/Product/Compare.php index 90d98874e00..d6d35c5c76d 100644 --- a/app/code/Magento/Catalog/Helper/Product/Compare.php +++ b/app/code/Magento/Catalog/Helper/Product/Compare.php @@ -166,7 +166,15 @@ public function getListUrl() */ public function getPostDataParams($product) { - return $this->postHelper->getPostData($this->getAddUrl(), ['product' => $product->getId()]); + $params = ['product' => $product->getId()]; + $requestingPageUrl = $this->_getRequest()->getParam('requesting_page_url'); + + if (!empty($requestingPageUrl)) { + $encodedUrl = $this->urlEncoder->encode($requestingPageUrl); + $params[\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED] = $encodedUrl; + } + + return $this->postHelper->getPostData($this->getAddUrl(), $params); } /** From 2283662f6a0a3b2c0d9d7a27c1a440f60b562c27 Mon Sep 17 00:00:00 2001 From: Nathan Smith <nathsmit@adobe.com> Date: Fri, 9 Nov 2018 11:40:32 -0600 Subject: [PATCH 040/131] MAGETWO-95212: Dynamic block call to getCurrentUrl method is returning ajax request value - Added selector --- .../CatalogWidget/Test/Mftf/Section/ProductListWidgetSection.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/CatalogWidget/Test/Mftf/Section/ProductListWidgetSection.xml b/app/code/Magento/CatalogWidget/Test/Mftf/Section/ProductListWidgetSection.xml index 4e79334a94c..03bef8ffa3b 100644 --- a/app/code/Magento/CatalogWidget/Test/Mftf/Section/ProductListWidgetSection.xml +++ b/app/code/Magento/CatalogWidget/Test/Mftf/Section/ProductListWidgetSection.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="ProductListWidgetSection"> <element name="AddToCartByName" type="button" selector="//*[contains(@class,'product-item-info')][descendant::a[contains(text(), '{{arg1}}')]]//button[contains(@class,'tocart')]" parameterized="true"/> + <element name="AddToCompareByName" type="button" selector="//*[contains(@class,'product-item-info')][descendant::a[contains(text(), '{{arg1}}')]]//button[contains(@class,'tocompare')]" parameterized="true"/> </section> </sections> From 2d45eb37e2ee1b40eb59fbb0f60cc66c38198438 Mon Sep 17 00:00:00 2001 From: Max Almonte <maxalmonte14@hotmail.com> Date: Sat, 10 Nov 2018 10:51:04 -0400 Subject: [PATCH 041/131] Added _customerCollection property as public --- .../Model/ResourceModel/Import/Customer/Storage.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php index c5d28240c30..1046afeebbf 100644 --- a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php +++ b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php @@ -48,6 +48,11 @@ class Storage */ private $customerCollectionFactory; + /** + * @var CustomerCollection + */ + public $_customerCollection; + /** * @param CustomerCollectionFactory $collectionFactory * @param CollectionByPagesIteratorFactory $colIteratorFactory @@ -58,6 +63,9 @@ public function __construct( CollectionByPagesIteratorFactory $colIteratorFactory, array $data = [] ) { + $this->_customerCollection = isset( + $data['customer_collection'] + ) ? $data['customer_collection'] : $collectionFactory->create(); $this->_pageSize = isset($data['page_size']) ? $data['page_size'] : 0; $this->_byPagesIterator = isset( $data['collection_by_pages_iterator'] From 7f3808cd5821355ec6193ae1d7785f0f522c889d Mon Sep 17 00:00:00 2001 From: Max Almonte <maxalmonte14@hotmail.com> Date: Sat, 10 Nov 2018 11:04:47 -0400 Subject: [PATCH 042/131] Added public connection property --- .../Magento/DownloadableImportExport/Helper/Uploader.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/code/Magento/DownloadableImportExport/Helper/Uploader.php b/app/code/Magento/DownloadableImportExport/Helper/Uploader.php index 5fc4df1d03c..de10bcea5d6 100644 --- a/app/code/Magento/DownloadableImportExport/Helper/Uploader.php +++ b/app/code/Magento/DownloadableImportExport/Helper/Uploader.php @@ -38,6 +38,11 @@ class Uploader extends \Magento\Framework\App\Helper\AbstractHelper */ protected $parameters = []; + /** + * @var \Magento\Framework\DB\Adapter\AdapterInterface + */ + public $connection; + /** * Construct * @@ -62,6 +67,7 @@ public function __construct( $this->fileUploader->init(); $this->fileUploader->setAllowedExtensions($this->getAllowedExtensions()); $this->fileUploader->removeValidateCallback('catalog_product_image'); + $this->connection = $resource->getConnection('write'); $this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::ROOT); } From daf7bcbefd8bddeab0043229883700f04de59f65 Mon Sep 17 00:00:00 2001 From: Mariana Lashch <mlashch@magento.com> Date: Mon, 12 Nov 2018 18:08:28 +0200 Subject: [PATCH 043/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - delete several waits, add minor changes according to code review comments --- ...rderWithOnlinePaymentIncludingTaxAndDiscount.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 7c0a503e7bb..4feb47ae78e 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -10,20 +10,20 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="CreateAdminOrderPayedWithOnlinePaymentIncludingTaxAndDiscount"> <annotations> - <features value="Sales"/> + <features value="Braintree"/> <stories value="Get access to a New Credit Memo Page from Invocie for Order payed with online payment via Admin"/> <title value="Admin should be able to open a New Credit Memo Page from Invoice Page for Order with tax and discount and payed using online payment method"/> <description value="Admin should be able to open a New Credit Memo Page from Invoice Page for Order with tax and discount and payed using online payment method"/> <severity value="CRITICAL"/> <testCaseId value="MAGETWO-94472"/> - <group value="sales"/> + <group value="braintree"/> </annotations> <before> <!--Create Default Category--> <createData entity="SimpleSubCategory" stepKey="createCategory"/> - <!--Create Simple product with Special Price--> + <!--Create Simple product--> <createData entity="_defaultProduct" stepKey="simpleProduct"> <requiredEntity createDataKey="createCategory"/> </createData> @@ -99,8 +99,9 @@ <!--Submit Order--> <click stepKey="submitOrder" selector="{{NewOrderSection.submitOrder}}"/> - <waitForPageLoad stepKey="waitForSaveConfig" time="10"/> - <waitForElementVisible selector="{{NewOrderSection.successMessage}}" stepKey="waitForSuccessMessage" time="5"/> + <waitForPageLoad stepKey="waitForSubmitOrder" time="5"/> + <see selector="{{NewOrderSection.successMessage}}" userInput="You created the order." stepKey="seeNewOrder" after="waitForSubmitOrder"/> + <!-- Create New invoice--> <actionGroup ref="adminFastCreateInvoice" stepKey="createInvoice"/> @@ -108,6 +109,6 @@ <!--Get access to Credit Memo page from Invocie page--> <click selector="{{AdminInvoiceMainActionsSection.openNewCreditMemoFromInvoice}}" stepKey="clickCreateNewCreditMemo"/> <waitForPageLoad stepKey="waitForLoadNewCreditMemoPage" time="5"/> - <waitForElementVisible selector="{{AdminCreditMemoOrderInformationSection.orderId}}" stepKey="waitForOrderIdOnCreditMemoPage"/> + <see selector="{{AdminCreditMemoOrderInformationSection.orderId}}" userInput="New Memo" stepKey="seeNewCreditMemo" after="waitForLoadNewCreditMemoPage"/> </test> </tests> \ No newline at end of file From 6d6380f272824619cfcfafd8a3fa142e354d311c Mon Sep 17 00:00:00 2001 From: Mariana Lashch <mlashch@magento.com> Date: Tue, 13 Nov 2018 10:28:33 +0200 Subject: [PATCH 044/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - change step on Credit memo page --- ...retateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index 4feb47ae78e..fe1ed76e77f 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -109,6 +109,6 @@ <!--Get access to Credit Memo page from Invocie page--> <click selector="{{AdminInvoiceMainActionsSection.openNewCreditMemoFromInvoice}}" stepKey="clickCreateNewCreditMemo"/> <waitForPageLoad stepKey="waitForLoadNewCreditMemoPage" time="5"/> - <see selector="{{AdminCreditMemoOrderInformationSection.orderId}}" userInput="New Memo" stepKey="seeNewCreditMemo" after="waitForLoadNewCreditMemoPage"/> + <see selector="{{AdminCreditMemoOrderInformationSection.orderId}}" userInput="New Memo for" stepKey="seeNewCreditMemo" after="waitForLoadNewCreditMemoPage"/> </test> </tests> \ No newline at end of file From 1b21f6fd18a1ef3afe9f8a17949131b5b606b5eb Mon Sep 17 00:00:00 2001 From: Mariana Lashch <mlashch@magento.com> Date: Tue, 13 Nov 2018 18:08:30 +0200 Subject: [PATCH 045/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - change test according to specific of B2B elements --- ...thOnlinePaymentIncludingTaxAndDiscount.xml | 24 ++++++++++++++----- .../AdminCreateCartPriceRuleActionGroup.xml | 18 -------------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml index fe1ed76e77f..d1d685effd1 100644 --- a/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml +++ b/app/code/Magento/Braintree/Test/Mftf/Test/CretateAdminOrderWithOnlinePaymentIncludingTaxAndDiscount.xml @@ -70,8 +70,21 @@ <actionGroup ref="logout" stepKey="logout"/> </after> - <!-- Create a cart price rule for Fixed amount discount for whole cart --> - <actionGroup ref="AdminCreateCartPriceRuleForRetailerActionGroup" stepKey="createCartPriceRule"/> + <!-- Create a cart price rule with 10% discount for whole cart --> + <click selector="{{AdminMenuSection.marketing}}" stepKey="clickOnMarketing" /> + <waitForPageLoad stepKey="waitForMarketing" time="3"/> + <click selector="{{CartPriceRulesSubmenuSection.cartPriceRules}}" stepKey="clickOnCartPriceRules"/> + <waitForPageLoad stepKey="waitForCartPriceRules" time="3"/> + <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> + <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> + <actionGroup ref="selectRetailerCustomerGroup" stepKey="selectRetailerCustomerGroup"/> + <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Percent of product price discount" stepKey="selectActionType"/> + <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="10" stepKey="fillDiscountAmount"/> + <click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/> + <waitForPageLoad stepKey="waitForCartRuleLoad" time="3"/> + <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> <!--Set Taxable Goods for Shipping Tax Class--> <actionGroup ref="changeShippingTaxClass" stepKey="changeShippingTaxClass"/> @@ -100,15 +113,14 @@ <!--Submit Order--> <click stepKey="submitOrder" selector="{{NewOrderSection.submitOrder}}"/> <waitForPageLoad stepKey="waitForSubmitOrder" time="5"/> - <see selector="{{NewOrderSection.successMessage}}" userInput="You created the order." stepKey="seeNewOrder" after="waitForSubmitOrder"/> - + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeOrderSuccessMessage" after="waitForSubmitOrder"/> <!-- Create New invoice--> <actionGroup ref="adminFastCreateInvoice" stepKey="createInvoice"/> - <!--Get access to Credit Memo page from Invocie page--> + <!--Get access to Credit Memo page from Invoice page--> <click selector="{{AdminInvoiceMainActionsSection.openNewCreditMemoFromInvoice}}" stepKey="clickCreateNewCreditMemo"/> <waitForPageLoad stepKey="waitForLoadNewCreditMemoPage" time="5"/> - <see selector="{{AdminCreditMemoOrderInformationSection.orderId}}" userInput="New Memo for" stepKey="seeNewCreditMemo" after="waitForLoadNewCreditMemoPage"/> + <see selector="{{AdminCreditMemoOrderInformationSection.orderStatus}}" userInput="Processing" stepKey="seeNewCreditMemo"/> </test> </tests> \ No newline at end of file diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml index 6a837577ece..6ee7b556beb 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCreateCartPriceRuleActionGroup.xml @@ -24,24 +24,6 @@ <see selector="{{AdminCartPriceRulesFormSection.successMessage}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> </actionGroup> - <!--Create Cart price Rule for Retailer customer--> - <actionGroup name="AdminCreateCartPriceRuleForRetailerActionGroup"> - <click selector="{{AdminMenuSection.marketing}}" stepKey="clickOnMarketing" /> - <waitForPageLoad stepKey="waitForMarketing" time="3"/> - <click selector="{{CartPriceRulesSubmenuSection.cartPriceRules}}" stepKey="clickOnCartPriceRules"/> - <waitForPageLoad stepKey="waitForCartPriceRules" time="5"/> - <click selector="{{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey="clickAddNewRule"/> - <fillField selector="{{AdminCartPriceRulesFormSection.ruleName}}" userInput="{{SimpleSalesRule.name}}" stepKey="fillRuleName"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.websites}}" userInput="Main Website" stepKey="selectWebsites"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectCustomerGroup"/> - <click selector="{{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey="clickToExpandActions"/> - <selectOption selector="{{AdminCartPriceRulesFormSection.apply}}" userInput="Percent of product price discount" stepKey="selectActionType"/> - <fillField selector="{{AdminCartPriceRulesFormSection.discountAmount}}" userInput="10" stepKey="fillDiscountAmount"/> - <click selector="{{AdminCartPriceRulesFormSection.save}}" stepKey="clickSaveButton"/> - <waitForPageLoad stepKey="waitForCartRuleLoad" time="5"/> - <see selector="{{AdminCartPriceRulesSection.messages}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/> - </actionGroup> - <!--Delete Cart price Rule for Retailer customer--> <actionGroup name="AdminDeleteCartPriceRuleForRetailerActionGroup"> <click selector="{{AdminMenuSection.marketing}}" stepKey="clickOnMarketing" /> From 9d0773b8db2c2a74e76702c08a87b90a8976b4be Mon Sep 17 00:00:00 2001 From: Mariana Lashch <mlashch@magento.com> Date: Tue, 13 Nov 2018 18:53:30 +0200 Subject: [PATCH 046/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - improve CE locator that is different from B2B --- .../Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml index bae70698599..afc60e80954 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml @@ -11,4 +11,9 @@ <!-- This actionGroup was created to be merged from B2B because B2B has a very different form control here --> <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="NOT LOGGED IN" stepKey="selectCustomerGroup"/> </actionGroup> + + <actionGroup name="selectRetailerCustomerGroup"> + <!-- This actionGroup was created to be merged from B2B. Retailer Customer Group --> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectCustomerGroup"/> + </actionGroup> </actionGroups> From 303698fbcaf7c6fcd519e1d92014cf567a2f310b Mon Sep 17 00:00:00 2001 From: Khodu Vaishnav <khodu.vaishnav@krishtechnolabs.com> Date: Wed, 14 Nov 2018 15:56:48 +0530 Subject: [PATCH 047/131] 9130 remove the negative qty block. --- .../CatalogInventory/Block/Stockqty/AbstractStockqty.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php b/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php index 568fa600ec5..7b27125f73f 100644 --- a/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php +++ b/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php @@ -131,7 +131,7 @@ public function getPlaceholderId() */ public function isMsgVisible() { - return $this->getStockQty() > 0 && $this->getStockQtyLeft() <= $this->getThresholdQty(); + return $this->getStockQty() > 0 && $this->getStockQtyLeft() > 0 && $this->getStockQtyLeft() <= $this->getThresholdQty(); } /** From 32e0f571322e7a37d38e6b3d19856bc4ce90143b Mon Sep 17 00:00:00 2001 From: Mariana Lashch <mlashch@magento.com> Date: Wed, 14 Nov 2018 13:15:58 +0200 Subject: [PATCH 048/131] MAGETWO-94472: [2.3] Unable to create credit memo for order placed via online payment with taxes and discounts - add changes to actiongroup --- .../Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml index afc60e80954..a794c67e736 100644 --- a/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml +++ b/app/code/Magento/SalesRule/Test/Mftf/ActionGroup/AdminCartPriceRuleActionGroup.xml @@ -14,6 +14,6 @@ <actionGroup name="selectRetailerCustomerGroup"> <!-- This actionGroup was created to be merged from B2B. Retailer Customer Group --> - <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectCustomerGroup"/> + <selectOption selector="{{AdminCartPriceRulesFormSection.customerGroups}}" userInput="Retailer" stepKey="selectRetailerCustomerGroup"/> </actionGroup> </actionGroups> From 4c236e7e5134805ee1194a2809cc3f1ddf537cf8 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Tue, 13 Nov 2018 17:11:34 +0200 Subject: [PATCH 049/131] ENGCOM-3243: Fixed static test. --- .../testsuite/Magento/Framework/Interception/AbstractPlugin.php | 2 ++ .../Magento/Framework/Interception/Config/CacheManagerTest.php | 2 +- lib/internal/Magento/Framework/Interception/Config/Config.php | 2 +- .../src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php index 2a34f18fb0a..281a038a5a9 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/AbstractPlugin.php @@ -56,6 +56,8 @@ public function tearDown() /** * Set up Interception Config + * + * @param array $pluginConfig */ public function setUpInterceptionConfig($pluginConfig) { diff --git a/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php b/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php index 6b0487d4afd..75737f01472 100644 --- a/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php +++ b/dev/tests/integration/testsuite/Magento/Framework/Interception/Config/CacheManagerTest.php @@ -40,7 +40,7 @@ protected function setUp() $this->serializer = $this->objectManager->get(\Magento\Framework\Serialize\SerializerInterface::class); $this->cache = $this->objectManager->get(\Magento\Framework\App\CacheInterface::class); - $this->configWriter = + $this->configWriter = $this->objectManager->get(\Magento\Framework\App\ObjectManager\ConfigWriter\Filesystem::class); $this->initializeMetadataDirectory(); diff --git a/lib/internal/Magento/Framework/Interception/Config/Config.php b/lib/internal/Magento/Framework/Interception/Config/Config.php index 7632970705f..3f16e9275bd 100644 --- a/lib/internal/Magento/Framework/Interception/Config/Config.php +++ b/lib/internal/Magento/Framework/Interception/Config/Config.php @@ -113,7 +113,7 @@ public function __construct( $this->_cacheId = $cacheId; $this->_reader = $reader; $this->_scopeList = $scopeList; - $this->cacheManager = + $this->cacheManager = $cacheManager ?? \Magento\Framework\App\ObjectManager::getInstance()->get(CacheManager::class); $intercepted = $this->cacheManager->load($cacheId); if ($intercepted !== null) { diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php index fbdbc951462..69de120cca4 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/App/Task/AreaTest.php @@ -48,7 +48,7 @@ protected function setUp() $this->configReaderMock = $this->getMockBuilder(\Magento\Setup\Module\Di\Compiler\Config\Reader::class) ->disableOriginalConstructor() ->getMock(); - $this->configWriterMock = + $this->configWriterMock = $this->getMockBuilder(\Magento\Framework\App\ObjectManager\ConfigWriterInterface::class) ->disableOriginalConstructor() ->getMock(); From 5ff88c0854d7683fbf7bfa74ae464b74fa79de7d Mon Sep 17 00:00:00 2001 From: Max Almonte <maxalmonte14@hotmail.com> Date: Fri, 16 Nov 2018 11:01:44 -0400 Subject: [PATCH 050/131] Removed PHPMD suppress warning directive --- app/code/Magento/DownloadableImportExport/Helper/Uploader.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/code/Magento/DownloadableImportExport/Helper/Uploader.php b/app/code/Magento/DownloadableImportExport/Helper/Uploader.php index de10bcea5d6..197250faaea 100644 --- a/app/code/Magento/DownloadableImportExport/Helper/Uploader.php +++ b/app/code/Magento/DownloadableImportExport/Helper/Uploader.php @@ -51,8 +51,6 @@ class Uploader extends \Magento\Framework\App\Helper\AbstractHelper * @param \Magento\CatalogImportExport\Model\Import\UploaderFactory $uploaderFactory * @param \Magento\Framework\App\ResourceConnection $resource * @param \Magento\Framework\Filesystem $filesystem - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function __construct( \Magento\Framework\App\Helper\Context $context, From 9dfe1372ce941a36b700efe1dbb4851ea5bc3520 Mon Sep 17 00:00:00 2001 From: Mahesh Singh <mahesh721@webkul.com> Date: Sun, 18 Nov 2018 17:31:34 +0530 Subject: [PATCH 051/131] issue #19205 fixed for 2.3-develop --- app/code/Magento/Bundle/Model/Product/Type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index b61df8d7cb1..e5755df2291 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -827,7 +827,7 @@ private function multiToFlatArray(array $array) if (is_array($value)) { $flatArray = array_merge($flatArray, $this->multiToFlatArray($value)); } else { - $flatArray[$key] = $value; + $flatArray[] = $value; } } From eb2e505c68b1ed24ccc7d45e4a7eb4c2b0216f23 Mon Sep 17 00:00:00 2001 From: Mahesh Singh <mahesh721@webkul.com> Date: Sun, 18 Nov 2018 18:57:14 +0530 Subject: [PATCH 052/131] removed unused variable --- app/code/Magento/Bundle/Model/Product/Type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index e5755df2291..c8cd8c15fdb 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -823,7 +823,7 @@ private function recursiveIntval(array $array) private function multiToFlatArray(array $array) { $flatArray = []; - foreach ($array as $key => $value) { + foreach ($array as $value) { if (is_array($value)) { $flatArray = array_merge($flatArray, $this->multiToFlatArray($value)); } else { From 176b303b509953f84278614249c4b3559105c579 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Mon, 19 Nov 2018 09:21:15 +0200 Subject: [PATCH 053/131] MAGETWO-95739: Zip code is not validated during checkout when "My billing and shipping address are the same" is unchecked --- .../web/js/model/shipping-rates-validator.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js b/app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js index ca11fec7cd5..b53be1a40f3 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js @@ -35,6 +35,7 @@ define([ var checkoutConfig = window.checkoutConfig, validators = [], observedElements = [], + postcodeElements = [], postcodeElementName = 'postcode'; validators.push(defaultValidator); @@ -78,11 +79,7 @@ define([ } $.each(elements, function (index, field) { - var elementBinding = self.doElementBinding.bind(self), - fullPath = formPath + '.' + field, - func = uiRegistry.async(fullPath); - - func(elementBinding); + uiRegistry.async(formPath + '.' + field)(self.doElementBinding.bind(self)); }); }, @@ -104,6 +101,7 @@ define([ if (element.index === postcodeElementName) { this.bindHandler(element, delay); + postcodeElements.push(element); } }, @@ -138,7 +136,13 @@ define([ if (!formPopUpState.isVisible()) { clearTimeout(self.validateAddressTimeout); self.validateAddressTimeout = setTimeout(function () { - self.postcodeValidation(element); + if (element.index === postcodeElementName) { + self.postcodeValidation(element); + } else { + $.each(postcodeElements, function (index, elem) { + self.postcodeValidation(elem); + }); + } self.validateFields(); }, delay); } @@ -151,7 +155,7 @@ define([ * @return {*} */ postcodeValidation: function (postcodeElement) { - var countryId = $('select[name="country_id"]').val(), + var countryId = $('#checkoutSteps > :visible select[name="country_id"]').val(), validationResult, warnMessage; From 028a15ced987666269cf9cdb269b5002cfa5b11d Mon Sep 17 00:00:00 2001 From: Joel Rainwater <joel.rainwater@netatmo.com> Date: Mon, 19 Nov 2018 14:38:07 +0100 Subject: [PATCH 054/131] Refactored _getMultiSelectAttributeWithSourceModels to use repo getList as opposed to direct query --- .../Product/Indexer/Eav/Source.php | 57 +++++++++++-------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php index ab09171a6f2..a2aa217941c 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php @@ -7,6 +7,7 @@ use Magento\Catalog\Model\Product\Attribute\Source\Status as ProductStatus; use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\Data\ProductAttributeInterface; /** * Catalog Product Eav Select and Multiply Select Attributes Indexer resource model @@ -29,6 +30,16 @@ class Source extends AbstractEav */ protected $_attributeRepository; + /** + * @var \Magento\Framework\Api\SearchCriteriaBuilder + */ + private $searchCriteriaBuilder; + + /** + * @var \Psr\Log\LoggerInterface + */ + private $logger; + /** * Construct * @@ -38,6 +49,8 @@ class Source extends AbstractEav * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository + * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder + * @param \Psr\Log\LoggerInterface $logger * @param null|string $connectionName */ public function __construct( @@ -47,6 +60,8 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository, + \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, + \Psr\Log\LoggerInterface $logger, $connectionName = null ) { parent::__construct( @@ -58,6 +73,8 @@ public function __construct( ); $this->_resourceHelper = $resourceHelper; $this->_attributeRepository = $attributeRepository; + $this->searchCriteriaBuilder = $searchCriteriaBuilder; + $this->logger = $logger; } /** @@ -310,39 +327,31 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu /** * Get options for multiselect attributes using custom source models - * @maderlock's fix from: https://github.com/magento/magento2/issues/417#issuecomment-265146285 + * Based on @maderlock's fix from: + * https://github.com/magento/magento2/issues/417#issuecomment-265146285 * * @param array $attrIds * @param array $options * * @return array - * @throws \Zend_Db_Statement_Exception */ protected function _getMultiSelectAttributeWithSourceModels($attrIds, $options) { // Add options from custom source models - $select = $this->getConnection()->select() - ->from( - ['ea' => $this->getTable('eav_attribute')], - ['attribute_id','entity_type_id', 'attribute_code'] - ) - ->where('attribute_id IN(?)', $attrIds) - ->where('source_model is not null'); - $query = $select->query(); - - while ($row = $query->fetch()) { - try { - /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */ - $attribute = $this->_attributeRepository->get($row['entity_type_id'], $row['attribute_code']); - $sourceModelOptions = $attribute->getOptions(); - // Add options to list used below - foreach ($sourceModelOptions as $o) { - $options[$row['attribute_id']][$o->getValue()] = true; - } - } catch (\BadMethodCallException $e) { - // Skip - } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { - // skip + $this->searchCriteriaBuilder + ->addFilter('attribute_id', $attrIds, 'in') + ->addFilter('source_model', true, 'notnull'); + $criteria = $this->searchCriteriaBuilder->create(); + $attributes = $this->_attributeRepository->getList( + ProductAttributeInterface::ENTITY_TYPE_CODE, + $criteria + )->getItems(); + + foreach ($attributes as $attribute) { + $sourceModelOptions = $attribute->getOptions(); + // Add options to list used below + foreach ($sourceModelOptions as $o) { + $options[$attribute->getAttributeId()][$o->getValue()] = true; } } From f38283304a86c7d720e74daed60420a9064e1e6e Mon Sep 17 00:00:00 2001 From: Joel Rainwater <joel.rainwater@netatmo.com> Date: Mon, 19 Nov 2018 14:39:17 +0100 Subject: [PATCH 055/131] Removed logger interface since we no longer have exceptions to log --- .../Model/ResourceModel/Product/Indexer/Eav/Source.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php index a2aa217941c..ea90d089e93 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php @@ -35,11 +35,6 @@ class Source extends AbstractEav */ private $searchCriteriaBuilder; - /** - * @var \Psr\Log\LoggerInterface - */ - private $logger; - /** * Construct * @@ -50,7 +45,6 @@ class Source extends AbstractEav * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder - * @param \Psr\Log\LoggerInterface $logger * @param null|string $connectionName */ public function __construct( @@ -61,7 +55,6 @@ public function __construct( \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository, \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, - \Psr\Log\LoggerInterface $logger, $connectionName = null ) { parent::__construct( @@ -74,7 +67,6 @@ public function __construct( $this->_resourceHelper = $resourceHelper; $this->_attributeRepository = $attributeRepository; $this->searchCriteriaBuilder = $searchCriteriaBuilder; - $this->logger = $logger; } /** From 130e160986d20ec7b4e1717c3bb4f61a7aa5900e Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Mon, 19 Nov 2018 16:54:22 +0200 Subject: [PATCH 056/131] MAGETWO-96290: [Magento Cloud] Cannot update category positions via REST API --- .../Model/Category/Link/SaveHandler.php | 27 ++-- .../ResourceModel/Product/CategoryLink.php | 16 ++- .../Model/Category/Link/SaveHandlerTest.php | 130 ++++++++++++++++++ 3 files changed, 152 insertions(+), 21 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php diff --git a/app/code/Magento/Catalog/Model/Category/Link/SaveHandler.php b/app/code/Magento/Catalog/Model/Category/Link/SaveHandler.php index f22c6903a23..4ea06d4e34d 100644 --- a/app/code/Magento/Catalog/Model/Category/Link/SaveHandler.php +++ b/app/code/Magento/Catalog/Model/Category/Link/SaveHandler.php @@ -6,7 +6,6 @@ namespace Magento\Catalog\Model\Category\Link; use Magento\Catalog\Api\Data\CategoryLinkInterface; -use Magento\Catalog\Model\Indexer\Product\Category; use Magento\Framework\EntityManager\Operation\ExtensionInterface; /** @@ -40,6 +39,8 @@ public function __construct( } /** + * Execute + * * @param object $entity * @param array $arguments * @return object @@ -78,6 +79,8 @@ public function execute($entity, $arguments = []) } /** + * Get category links positions + * * @param object $entity * @return array */ @@ -106,27 +109,19 @@ private function getCategoryLinksPositions($entity) */ private function mergeCategoryLinks($newCategoryPositions, $oldCategoryPositions) { - $result = []; if (empty($newCategoryPositions)) { - return $result; + return []; } + $categoryPositions = array_combine(array_column($oldCategoryPositions, 'category_id'), $oldCategoryPositions); foreach ($newCategoryPositions as $newCategoryPosition) { - $key = array_search( - $newCategoryPosition['category_id'], - array_column($oldCategoryPositions, 'category_id') - ); - - if ($key === false) { - $result[] = $newCategoryPosition; - } elseif (isset($oldCategoryPositions[$key]) - && $oldCategoryPositions[$key]['position'] != $newCategoryPosition['position'] - ) { - $result[] = $newCategoryPositions[$key]; - unset($oldCategoryPositions[$key]); + $categoryId = $newCategoryPosition['category_id']; + if (!isset($categoryPositions[$categoryId])) { + $categoryPositions[$categoryId] = ['category_id' => $categoryId]; } + $categoryPositions[$categoryId]['position'] = $newCategoryPosition['position']; } - $result = array_merge($result, $oldCategoryPositions); + $result = array_values($categoryPositions); return $result; } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/CategoryLink.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/CategoryLink.php index b54c19a1115..f11c975396f 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/CategoryLink.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/CategoryLink.php @@ -93,6 +93,8 @@ public function saveCategoryLinks(ProductInterface $product, array $categoryLink } /** + * Get category link metadata + * * @return \Magento\Framework\EntityManager\EntityMetadataInterface */ private function getCategoryLinkMetadata() @@ -114,16 +116,16 @@ private function getCategoryLinkMetadata() private function processCategoryLinks($newCategoryPositions, &$oldCategoryPositions) { $result = ['changed' => [], 'updated' => []]; + + $oldCategoryPositions = array_values($oldCategoryPositions); + $oldCategoryList = array_column($oldCategoryPositions, 'category_id'); foreach ($newCategoryPositions as $newCategoryPosition) { - $key = array_search( - $newCategoryPosition['category_id'], - array_column($oldCategoryPositions, 'category_id') - ); + $key = array_search($newCategoryPosition['category_id'], $oldCategoryList); if ($key === false) { $result['changed'][] = $newCategoryPosition; } elseif ($oldCategoryPositions[$key]['position'] != $newCategoryPosition['position']) { - $result['updated'][] = $newCategoryPositions[$key]; + $result['updated'][] = $newCategoryPosition; unset($oldCategoryPositions[$key]); } } @@ -132,6 +134,8 @@ private function processCategoryLinks($newCategoryPositions, &$oldCategoryPositi } /** + * Update category links + * * @param ProductInterface $product * @param array $insertLinks * @param bool $insert @@ -175,6 +179,8 @@ private function updateCategoryLinks(ProductInterface $product, array $insertLin } /** + * Delete category links + * * @param ProductInterface $product * @param array $deleteLinks * @return array diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php new file mode 100644 index 00000000000..af5028cb164 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php @@ -0,0 +1,130 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Category\Link; + +use Magento\Catalog\Api\Data\CategoryLinkInterfaceFactory; +use Magento\Catalog\Api\Data\ProductInterface; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\EntityManager\MetadataPool; +use Magento\TestFramework\Helper\Bootstrap; +use PHPUnit\Framework\TestCase; + +/** + * Save handler test + * + * @magentoDataFixture Magento/Catalog/_files/categories_no_products.php + * @magentoDataFixture Magento/Catalog/_files/second_product_simple.php + */ +class SaveHandlerTest extends TestCase +{ + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var string + */ + private $productLinkField; + + /** + * @var CategoryLinkInterfaceFactory + */ + private $categoryLinkFactory; + + /** + * @var SaveHandler + */ + private $saveHandler; + + /** + * @inheritdoc + */ + protected function setUp() + { + $this->productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class); + $metadataPool = Bootstrap::getObjectManager()->create(MetadataPool::class); + $this->productLinkField = $metadataPool->getMetadata(ProductInterface::class)->getLinkField(); + $this->categoryLinkFactory = Bootstrap::getObjectManager()->create(CategoryLinkInterfaceFactory::class); + $this->saveHandler = Bootstrap::getObjectManager()->create(SaveHandler::class); + } + + /** + * Execute test + * + * @return void + */ + public function testExecute(): void + { + $product = $this->productRepository->get('simple2'); + $product->setCategoryIds([3, 4, 6]); + $this->productRepository->save($product); + $categoryPositions = [ + 3 => [ + 'category_id' => 3, + 'position' => 0, + ], + 4 => [ + 'category_id' => 4, + 'position' => 0, + ], + 6 => [ + 'category_id' => 6, + 'position' => 0, + ], + ]; + + $categoryLinks = $product->getExtensionAttributes()->getCategoryLinks(); + $this->assertEmpty($categoryLinks); + + $categoryLinks = []; + $categoryPositions[4]['position'] = 1; + $categoryPositions[6]['position'] = 1; + foreach ($categoryPositions as $categoryPosition) { + $categoryLink = $this->categoryLinkFactory->create() + ->setCategoryId($categoryPosition['category_id']) + ->setPosition($categoryPosition['position']); + $categoryLinks[] = $categoryLink; + } + $categoryLinks = $this->updateCategoryLinks($product, $categoryLinks); + foreach ($categoryLinks as $categoryLink) { + $categoryPosition = $categoryPositions[$categoryLink->getCategoryId()]; + $this->assertEquals($categoryPosition['category_id'], $categoryLink->getCategoryId()); + $this->assertEquals($categoryPosition['position'], $categoryLink->getPosition()); + } + + $categoryPositions[4]['position'] = 2; + $categoryLink = $this->categoryLinkFactory->create() + ->setCategoryId(4) + ->setPosition($categoryPositions[4]['position']); + $categoryLinks = $this->updateCategoryLinks($product, [$categoryLink]); + foreach ($categoryLinks as $categoryLink) { + $categoryPosition = $categoryPositions[$categoryLink->getCategoryId()]; + $this->assertEquals($categoryPosition['category_id'], $categoryLink->getCategoryId()); + $this->assertEquals($categoryPosition['position'], $categoryLink->getPosition()); + } + } + + /** + * Update category links + * + * @param ProductInterface $product + * @param \Magento\Catalog\Api\Data\CategoryLinkInterface[] $categoryLinks + * @return \Magento\Catalog\Api\Data\CategoryLinkInterface[] + */ + private function updateCategoryLinks(ProductInterface $product, array $categoryLinks): array + { + $product->getExtensionAttributes()->setCategoryLinks($categoryLinks); + $arguments = [$this->productLinkField => $product->getData($this->productLinkField)]; + $this->saveHandler->execute($product, $arguments); + $product = $this->productRepository->get($product->getSku(), false, null, true); + $categoryLinks = $product->getExtensionAttributes()->getCategoryLinks(); + + return $categoryLinks; + } +} From b9c4e77bc0cca1f87efa569c2804e7bfe6723025 Mon Sep 17 00:00:00 2001 From: Joel Rainwater <joel.rain2o@gmail.com> Date: Mon, 19 Nov 2018 17:28:25 +0100 Subject: [PATCH 057/131] Resolved code standard errors. --- .../Product/Indexer/Eav/Source.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php index ea90d089e93..f9fb8ec3bb3 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php @@ -28,12 +28,12 @@ class Source extends AbstractEav /** * @var \Magento\Eav\Api\AttributeRepositoryInterface */ - protected $_attributeRepository; + private $attributeRepository; /** * @var \Magento\Framework\Api\SearchCriteriaBuilder */ - private $searchCriteriaBuilder; + private $criteriaBuilder; /** * Construct @@ -44,7 +44,7 @@ class Source extends AbstractEav * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper * @param \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository - * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder + * @param \Magento\Framework\Api\SearchCriteriaBuilder $criteriaBuilder * @param null|string $connectionName */ public function __construct( @@ -54,7 +54,7 @@ public function __construct( \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository, - \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, + \Magento\Framework\Api\SearchCriteriaBuilder $criteriaBuilder, $connectionName = null ) { parent::__construct( @@ -65,8 +65,8 @@ public function __construct( $connectionName ); $this->_resourceHelper = $resourceHelper; - $this->_attributeRepository = $attributeRepository; - $this->searchCriteriaBuilder = $searchCriteriaBuilder; + $this->attributeRepository = $attributeRepository; + $this->criteriaBuilder = $criteriaBuilder; } /** @@ -252,7 +252,7 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu } // Include custom source model options - $options = $this->_getMultiSelectAttributeWithSourceModels($attrIds, $options); + $options = $this->getMultiSelectAttributeWithSourceModels($attrIds, $options); // prepare get multiselect values query $productValueExpression = $connection->getCheckSql('pvs.value_id > 0', 'pvs.value', 'pvd.value'); @@ -327,13 +327,13 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu * * @return array */ - protected function _getMultiSelectAttributeWithSourceModels($attrIds, $options) + private function getMultiSelectAttributeWithSourceModels($attrIds, $options) { // Add options from custom source models - $this->searchCriteriaBuilder + $this->criteriaBuilder ->addFilter('attribute_id', $attrIds, 'in') ->addFilter('source_model', true, 'notnull'); - $criteria = $this->searchCriteriaBuilder->create(); + $criteria = $this->criteriaBuilder->create(); $attributes = $this->_attributeRepository->getList( ProductAttributeInterface::ENTITY_TYPE_CODE, $criteria From 54da6f6a10250a49fe8fd54b1479271076d7a2fa Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Mon, 19 Nov 2018 14:48:18 -0600 Subject: [PATCH 058/131] MC-5318: Create tax rate, all postcodes --- .../Tax/Test/Mftf/Data/TaxRateData.xml | 13 +++ .../Mftf/Section/AdminTaxRateFormSection.xml | 21 +++++ .../Mftf/Section/AdminTaxRateGridSection.xml | 21 +++++ .../Mftf/Section/AdminTaxRulesSection.xml | 1 + .../AdminCreateTaxRateAllPostCodesTest.xml | 79 +++++++++++++++++++ 5 files changed, 135 insertions(+) create mode 100644 app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml new file mode 100644 index 00000000000..7a8dc35e796 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> + <entity name="SimpleTaxRate" type="taxRate"> + <data key="code" unique="suffix">TaxRate</data> + </entity> +</entities> diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml new file mode 100644 index 00000000000..580ce8cb485 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminTaxRateFormSection"> + <element name="taxIdentifier" type="input" selector="//*[@id = 'rate-form']//*[@name = 'code']" /> + <element name="labelForZipCode" type="text" selector="//*[@id = 'rate-form']//*[@name = 'code']" /> + <element name="deleteRate" type="button" selector="#delete"/> + <element name="ok" type="button" selector="button.action-primary.action-accept"/> + + <element name="country" type="select" selector="#tax_country_id"/> + <element name="state" type="select" selector="#tax_region_id"/> + <element name="rate" type="text" selector="#rate"/> + </section> +</sections> diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml new file mode 100644 index 00000000000..daa86c52162 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminTaxRateGridSection"> + <element name="grid" type="block" selector="#tax_rate_grid"/> + <element name="add" type="button" selector="#add" timeout="30"/> + <element name="search" type="button" selector="button[data-action='grid-filter-apply']" timeout="30"/> + <element name="filterByTaxIdentifier" type="input" selector="#tax_rate_grid_filter_code"/> + <element name="filterByCountry" type="input" selector="#tax_rate_grid_filter_tax_country_id"/> + <element name="filterByPostCode" type="input" selector="#tax_rate_grid_filter_tax_postcode"/> + <element name="nthRow" type="block" selector="tr[data-role='row']:nth-of-type({{var}})" parameterized="true" timeout="30"/> + <element name="country" type="select" selector="#tax_country_id"/> + </section> +</sections> \ No newline at end of file diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml index 6c258f2de18..04d0d7f766e 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml @@ -28,5 +28,6 @@ <element name="deleteTaxClassName" type="button" selector="//span[contains(text(),'{{var1}}')]" parameterized="true"/> <element name="deleteTaxClass" type="button" selector="//span[contains(text(),'{{var1}}')]/../..//*[@class='mselect-delete']" parameterized="true"/> <element name="popUpDialogOK" type="button" selector="//*[@class='modal-footer']//*[contains(text(),'OK')]"/> + <element name="taxRateMultiSelectItems" type="block" selector=".mselect-list-item"/> </section> </sections> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml new file mode 100644 index 00000000000..40146a86323 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCreateTaxRateAllPostCodesTest"> + <annotations> + <stories value="Create tax rate"/> + <title value="Create tax rate, all postcodes"/> + <description value="Tests log into Create tax rate and create all postcodes"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + <group value="banana"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> + <click selector="{{AdminTaxRateGridSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + <click selector="{{AdminTaxRateFormSection.deleteRate}}" stepKey="clickDeleteRate"/> + <click selector="{{AdminTaxRateFormSection.ok}}" stepKey="clickOk"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the tax rate." stepKey="seeSuccess"/> + </after> + + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + + <!-- Create a tax rate with * for postcodes --> + <click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddButton"/> + <fillField selector="{{AdminTaxRateFormSection.ruleName}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillRuleName"/> + <fillField selector="{{AdminTaxRateSection.zipCode}}" userInput="*" stepKey="fillPostCode"/> + <selectOption selector="{{AdminTaxRateSection.country}}" userInput="Australia" stepKey="selectCountry"/> + <fillField selector="{{AdminTaxRateSection.rate}}" userInput="20" stepKey="fillRate"/> + <click selector="{{AdminTaxRateSection.saveRule}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <!-- Verify the tax rate grid page shows the tax rate we just created --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/> + <waitForPageLoad stepKey="waitForTaxRateIndex2"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/> + <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="Australia" stepKey="fillCountryFilter"/> + <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="*" stepKey="fillPostCodeFilter"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> + <see selector="{{AdminTaxRateGridSection.grid}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeRuleName"/> + <see selector="{{AdminTaxRateGridSection.grid}}" userInput="Australia" stepKey="seeCountry"/> + <see selector="{{AdminTaxRateGridSection.grid}}" userInput="*" stepKey="seePostCode"/> + + <!-- Go to the tax rate edit page for our new tax rate --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex3"/> + <waitForPageLoad stepKey="waitForTaxRateIndex3"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter2"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + + <!-- Verify we see expected values on the tax rate edit page --> + <seeInField selector="{{AdminTaxRateFormSection.ruleName}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeRuleName2"/> + <seeInField selector="{{AdminTaxRateSection.zipCode}}" userInput="*" stepKey="seeZipCode"/> + <seeOptionIsSelected selector="{{AdminTaxRateSection.country}}" userInput="Australia" stepKey="seeCountry2"/> + <seeInField selector="{{AdminTaxRateSection.rate}}" userInput="20" stepKey="seeRate"/> + + <!-- Go to the tax rule grid page and verify our tax rate can be used in the rule --> + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/> + <waitForPageLoad stepKey="waitForTaxRuleIndex"/> + <click selector="{{AdminGridMainControls.add}}" stepKey="clickAddNewTaxRule"/> + <see selector="{{AdminTaxRulesSection.taxRateMultiSelectItems}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxRateOnNewTaxRulePage"/> + </test> +</tests> \ No newline at end of file From c640bc4441b8a1bde94d9b95da57aeb9f65dcae7 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Tue, 20 Nov 2018 10:57:39 +0200 Subject: [PATCH 059/131] MAGETWO-95739: Zip code is not validated during checkout when "My billing and shipping address are the same" is unchecked --- .../view/frontend/web/js/model/shipping-rates-validator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js b/app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js index b53be1a40f3..fde88ebadb3 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/shipping-rates-validator.js @@ -155,7 +155,7 @@ define([ * @return {*} */ postcodeValidation: function (postcodeElement) { - var countryId = $('#checkoutSteps > :visible select[name="country_id"]').val(), + var countryId = $('select[name="country_id"]:visible').val(), validationResult, warnMessage; From fe68f5b643551e989215539f7d3dc04b9eeb36d5 Mon Sep 17 00:00:00 2001 From: Serhiy Yelahin <serhiy.yelahin@transoftgroup.com> Date: Tue, 20 Nov 2018 14:32:42 +0200 Subject: [PATCH 060/131] MAGETWO-96290: [Magento Cloud] Cannot update category positions via REST API --- .../Model/Category/Link/SaveHandlerTest.php | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php index af5028cb164..5b24c4e2219 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Category/Link/SaveHandlerTest.php @@ -47,11 +47,13 @@ class SaveHandlerTest extends TestCase */ protected function setUp() { - $this->productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class); - $metadataPool = Bootstrap::getObjectManager()->create(MetadataPool::class); - $this->productLinkField = $metadataPool->getMetadata(ProductInterface::class)->getLinkField(); - $this->categoryLinkFactory = Bootstrap::getObjectManager()->create(CategoryLinkInterfaceFactory::class); - $this->saveHandler = Bootstrap::getObjectManager()->create(SaveHandler::class); + $objectManager = Bootstrap::getObjectManager(); + $this->productRepository = $objectManager->create(ProductRepositoryInterface::class); + $metadataPool = $objectManager->create(MetadataPool::class); + $this->productLinkField = $metadataPool->getMetadata(ProductInterface::class) + ->getLinkField(); + $this->categoryLinkFactory = $objectManager->create(CategoryLinkInterfaceFactory::class); + $this->saveHandler = $objectManager->create(SaveHandler::class); } /** @@ -92,22 +94,14 @@ public function testExecute(): void $categoryLinks[] = $categoryLink; } $categoryLinks = $this->updateCategoryLinks($product, $categoryLinks); - foreach ($categoryLinks as $categoryLink) { - $categoryPosition = $categoryPositions[$categoryLink->getCategoryId()]; - $this->assertEquals($categoryPosition['category_id'], $categoryLink->getCategoryId()); - $this->assertEquals($categoryPosition['position'], $categoryLink->getPosition()); - } + $this->assertPositions($categoryPositions, $categoryLinks); $categoryPositions[4]['position'] = 2; $categoryLink = $this->categoryLinkFactory->create() ->setCategoryId(4) ->setPosition($categoryPositions[4]['position']); $categoryLinks = $this->updateCategoryLinks($product, [$categoryLink]); - foreach ($categoryLinks as $categoryLink) { - $categoryPosition = $categoryPositions[$categoryLink->getCategoryId()]; - $this->assertEquals($categoryPosition['category_id'], $categoryLink->getCategoryId()); - $this->assertEquals($categoryPosition['position'], $categoryLink->getPosition()); - } + $this->assertPositions($categoryPositions, $categoryLinks); } /** @@ -123,8 +117,25 @@ private function updateCategoryLinks(ProductInterface $product, array $categoryL $arguments = [$this->productLinkField => $product->getData($this->productLinkField)]; $this->saveHandler->execute($product, $arguments); $product = $this->productRepository->get($product->getSku(), false, null, true); - $categoryLinks = $product->getExtensionAttributes()->getCategoryLinks(); + $categoryLinks = $product->getExtensionAttributes() + ->getCategoryLinks(); return $categoryLinks; } + + /** + * Assert positions + * + * @param array $categoryPositions + * @param array $categoryLinks + * @return void + */ + private function assertPositions(array $categoryPositions, array $categoryLinks): void + { + foreach ($categoryLinks as $categoryLink) { + $categoryPosition = $categoryPositions[$categoryLink->getCategoryId()]; + $this->assertEquals($categoryPosition['category_id'], $categoryLink->getCategoryId()); + $this->assertEquals($categoryPosition['position'], $categoryLink->getPosition()); + } + } } From d791b361c6f108b583eacfa4ca1e9ba9f72a1646 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Tue, 20 Nov 2018 15:14:32 -0600 Subject: [PATCH 061/131] MC-5318: Create tax rate, all postcodes - addressing code review comments --- .../Mftf/Section/AdminTaxRateFormSection.xml | 9 ++++--- .../Mftf/Section/AdminTaxRateGridSection.xml | 1 + .../Mftf/Section/AdminTaxRulesSection.xml | 2 -- .../AdminCreateTaxRateAllPostCodesTest.xml | 25 +++++++++---------- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml index 580ce8cb485..53a3393ceb4 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml @@ -9,13 +9,16 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminTaxRateFormSection"> - <element name="taxIdentifier" type="input" selector="//*[@id = 'rate-form']//*[@name = 'code']" /> - <element name="labelForZipCode" type="text" selector="//*[@id = 'rate-form']//*[@name = 'code']" /> + <element name="taxIdentifier" type="input" selector="#code" /> + <element name="labelForZipCode" type="text" selector="//*[@id = 'rate-form']//*[@name = 'code']" /> <element name="deleteRate" type="button" selector="#delete"/> <element name="ok" type="button" selector="button.action-primary.action-accept"/> - + <element name="save" type="button" selector="#save"/> <element name="country" type="select" selector="#tax_country_id"/> <element name="state" type="select" selector="#tax_region_id"/> <element name="rate" type="text" selector="#rate"/> + <element name="success" type="text" selector="#messages-message-success"/> + <element name="successMessage" type="text" selector=".message-success"/> + <element name="errorMessage" type="text" selector=".message.message-error.error"/> </section> </sections> diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml index daa86c52162..5df1f9c4ba2 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml @@ -17,5 +17,6 @@ <element name="filterByPostCode" type="input" selector="#tax_rate_grid_filter_tax_postcode"/> <element name="nthRow" type="block" selector="tr[data-role='row']:nth-of-type({{var}})" parameterized="true" timeout="30"/> <element name="country" type="select" selector="#tax_country_id"/> + <element name="zipCode" type="input" selector="#tax_postcode"/> </section> </sections> \ No newline at end of file diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml index 04d0d7f766e..8eb2a111446 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml @@ -9,14 +9,12 @@ <sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminTaxRulesSection"> - <!-- on page /admin/tax/rule/new/ --> <element name="ruleName" type="input" selector="#anchor-content #code"/> <element name="addNewTaxRate" type="block" selector="//*[text()='Add New Tax Rate']" timeout="30"/> <element name="taxIdentifier" type="input" selector="aside #code"/> <element name="zipIsRange" type="checkbox" selector="#zip_is_range"/> <element name="zipCode" type="input" selector="#tax_postcode"/> <element name="state" type="select" selector="#tax_region_id"/> - <element name="country" type="select" selector="#tax_country_id"/> <element name="rate" type="input" selector="#rate"/> <element name="save" type="button" selector=".action-save" timeout="30"/> <element name="saveRule" type="button" selector="#save" timeout="30"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml index 40146a86323..cc1482a077f 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml @@ -13,6 +13,7 @@ <stories value="Create tax rate"/> <title value="Create tax rate, all postcodes"/> <description value="Tests log into Create tax rate and create all postcodes"/> + <testCaseId value="MC-5318"/> <severity value="CRITICAL"/> <group value="tax"/> <group value="mtf_migrated"/> @@ -23,25 +24,23 @@ </before> <after> <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> - <click selector="{{AdminTaxRateGridSection.clearFilters}}" stepKey="clickClearFilters2"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> <click selector="{{AdminTaxRateFormSection.deleteRate}}" stepKey="clickDeleteRate"/> <click selector="{{AdminTaxRateFormSection.ok}}" stepKey="clickOk"/> - <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the tax rate." stepKey="seeSuccess"/> </after> <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> <waitForPageLoad stepKey="waitForTaxRateIndex1"/> - <!-- Create a tax rate with * for postcodes --> - <click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddButton"/> - <fillField selector="{{AdminTaxRateFormSection.ruleName}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillRuleName"/> - <fillField selector="{{AdminTaxRateSection.zipCode}}" userInput="*" stepKey="fillPostCode"/> - <selectOption selector="{{AdminTaxRateSection.country}}" userInput="Australia" stepKey="selectCountry"/> - <fillField selector="{{AdminTaxRateSection.rate}}" userInput="20" stepKey="fillRate"/> - <click selector="{{AdminTaxRateSection.saveRule}}" stepKey="clickSave"/> + <click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddNewTaxRateButton"/> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillRuleName"/> + <fillField selector="{{AdminTaxRateGridSection.zipCode}}" userInput="*" stepKey="fillPostCode"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="Australia" stepKey="selectCountry1"/> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="20" stepKey="fillRate"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> <!-- Verify the tax rate grid page shows the tax rate we just created --> @@ -65,10 +64,10 @@ <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> <!-- Verify we see expected values on the tax rate edit page --> - <seeInField selector="{{AdminTaxRateFormSection.ruleName}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeRuleName2"/> - <seeInField selector="{{AdminTaxRateSection.zipCode}}" userInput="*" stepKey="seeZipCode"/> - <seeOptionIsSelected selector="{{AdminTaxRateSection.country}}" userInput="Australia" stepKey="seeCountry2"/> - <seeInField selector="{{AdminTaxRateSection.rate}}" userInput="20" stepKey="seeRate"/> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeRuleName2"/> + <seeInField selector="{{AdminTaxRateGridSection.zipCode}}" userInput="*" stepKey="seeZipCode"/> + <seeOptionIsSelected selector="{{AdminTaxRateGridSection.country}}" userInput="Australia" stepKey="seeCountry2"/> + <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="20" stepKey="seeRate"/> <!-- Go to the tax rule grid page and verify our tax rate can be used in the rule --> <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/> From 658526798b773cbbf485276a3e6bf3dc7c86b230 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Tue, 20 Nov 2018 15:35:29 -0600 Subject: [PATCH 062/131] MC-5318: Create tax rate, all postcodes - addressing code review comments --- .../Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml | 4 ---- .../Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml | 1 - 2 files changed, 5 deletions(-) diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml index 53a3393ceb4..913d8135762 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml @@ -10,15 +10,11 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminTaxRateFormSection"> <element name="taxIdentifier" type="input" selector="#code" /> - <element name="labelForZipCode" type="text" selector="//*[@id = 'rate-form']//*[@name = 'code']" /> <element name="deleteRate" type="button" selector="#delete"/> <element name="ok" type="button" selector="button.action-primary.action-accept"/> <element name="save" type="button" selector="#save"/> <element name="country" type="select" selector="#tax_country_id"/> <element name="state" type="select" selector="#tax_region_id"/> <element name="rate" type="text" selector="#rate"/> - <element name="success" type="text" selector="#messages-message-success"/> - <element name="successMessage" type="text" selector=".message-success"/> - <element name="errorMessage" type="text" selector=".message.message-error.error"/> </section> </sections> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml index cc1482a077f..f4b1066dae2 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml @@ -17,7 +17,6 @@ <severity value="CRITICAL"/> <group value="tax"/> <group value="mtf_migrated"/> - <group value="banana"/> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> From e940298f04b0dfbef5bb9efa1123ece974c32248 Mon Sep 17 00:00:00 2001 From: Joel Rainwater <joel.rain2o@gmail.com> Date: Wed, 21 Nov 2018 13:45:10 +0100 Subject: [PATCH 063/131] Fixed invalid reference to --- .../Model/ResourceModel/Product/Indexer/Eav/Source.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php index f9fb8ec3bb3..b7489bff18a 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php @@ -319,7 +319,7 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu /** * Get options for multiselect attributes using custom source models - * Based on @maderlock's fix from: + * Based on @maderlock's fix from: * https://github.com/magento/magento2/issues/417#issuecomment-265146285 * * @param array $attrIds @@ -334,7 +334,7 @@ private function getMultiSelectAttributeWithSourceModels($attrIds, $options) ->addFilter('attribute_id', $attrIds, 'in') ->addFilter('source_model', true, 'notnull'); $criteria = $this->criteriaBuilder->create(); - $attributes = $this->_attributeRepository->getList( + $attributes = $this->attributeRepository->getList( ProductAttributeInterface::ENTITY_TYPE_CODE, $criteria )->getItems(); From 6f7e4de04a9e8275de729cff8be2d364286326af Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Wed, 21 Nov 2018 15:14:28 -0600 Subject: [PATCH 064/131] MC-5319: Create tax rate, zip code range MC-5318: Create tax rate, all postcodes --- .../Mftf/Section/AdminTaxRateFormSection.xml | 10 ++- .../Mftf/Section/AdminTaxRateGridSection.xml | 4 +- .../Mftf/Section/AdminTaxRuleFormSection.xml | 14 ++++ .../Mftf/Section/AdminTaxRuleGridSection.xml | 16 +++++ .../Mftf/Section/AdminTaxRulesSection.xml | 1 + .../AdminCreateTaxRateAllPostCodesTest.xml | 6 +- .../Test/AdminCreateTaxRateZipCodeRange.xml | 71 +++++++++++++++++++ 7 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRuleFormSection.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRuleGridSection.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml index 913d8135762..b2efe5c47b0 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateFormSection.xml @@ -10,11 +10,15 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> <section name="AdminTaxRateFormSection"> <element name="taxIdentifier" type="input" selector="#code" /> - <element name="deleteRate" type="button" selector="#delete"/> - <element name="ok" type="button" selector="button.action-primary.action-accept"/> - <element name="save" type="button" selector="#save"/> + <element name="deleteRate" type="button" selector="#delete" timeout="30"/> + <element name="ok" type="button" selector="button.action-primary.action-accept" timeout="30"/> + <element name="save" type="button" selector="#save" timeout="30"/> <element name="country" type="select" selector="#tax_country_id"/> <element name="state" type="select" selector="#tax_region_id"/> <element name="rate" type="text" selector="#rate"/> + <element name="zipRange" type="checkbox" selector="#zip_is_range"/> + <element name="rangeFrom" type="text" selector="#zip_from"/> + <element name="rangeTo" type="text" selector="#zip_to"/> + <element name="zipCode" type="input" selector="#tax_postcode"/> </section> </sections> diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml index 5df1f9c4ba2..61999f3e2ea 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml @@ -16,7 +16,7 @@ <element name="filterByCountry" type="input" selector="#tax_rate_grid_filter_tax_country_id"/> <element name="filterByPostCode" type="input" selector="#tax_rate_grid_filter_tax_postcode"/> <element name="nthRow" type="block" selector="tr[data-role='row']:nth-of-type({{var}})" parameterized="true" timeout="30"/> - <element name="country" type="select" selector="#tax_country_id"/> - <element name="zipCode" type="input" selector="#tax_postcode"/> + <element name="country" type="select" selector="#tax_rate_grid_filter_tax_country_id"/> + <element name="zipCode" type="text" selector="#tax_rate_grid_filter_tax_postcode"/> </section> </sections> \ No newline at end of file diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRuleFormSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRuleFormSection.xml new file mode 100644 index 00000000000..37a04670890 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRuleFormSection.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminTaxRuleFormSection"> + <element name="taxIdentifier" type="input" selector="input.admin__control-text admin__action-multiselect-search"/> + </section> +</sections> \ No newline at end of file diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRuleGridSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRuleGridSection.xml new file mode 100644 index 00000000000..b76a60cfd66 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRuleGridSection.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> + <section name="AdminTaxRuleGridSection"> + <element name="add" type="button" selector="#add" timeout="30"/> + </section> +</sections> + + diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml index 8eb2a111446..3d58238c96f 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRulesSection.xml @@ -15,6 +15,7 @@ <element name="zipIsRange" type="checkbox" selector="#zip_is_range"/> <element name="zipCode" type="input" selector="#tax_postcode"/> <element name="state" type="select" selector="#tax_region_id"/> + <element name="country" type="select" selector="#tax_country_id"/> <element name="rate" type="input" selector="#rate"/> <element name="save" type="button" selector=".action-save" timeout="30"/> <element name="saveRule" type="button" selector="#save" timeout="30"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml index f4b1066dae2..b63ca195315 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateAllPostCodesTest.xml @@ -36,7 +36,7 @@ <!-- Create a tax rate with * for postcodes --> <click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddNewTaxRateButton"/> <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillRuleName"/> - <fillField selector="{{AdminTaxRateGridSection.zipCode}}" userInput="*" stepKey="fillPostCode"/> + <fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="*" stepKey="fillPostCode"/> <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="Australia" stepKey="selectCountry1"/> <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="20" stepKey="fillRate"/> <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> @@ -64,8 +64,8 @@ <!-- Verify we see expected values on the tax rate edit page --> <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeRuleName2"/> - <seeInField selector="{{AdminTaxRateGridSection.zipCode}}" userInput="*" stepKey="seeZipCode"/> - <seeOptionIsSelected selector="{{AdminTaxRateGridSection.country}}" userInput="Australia" stepKey="seeCountry2"/> + <seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="*" stepKey="seeZipCode"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="Australia" stepKey="seeCountry2"/> <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="20" stepKey="seeRate"/> <!-- Go to the tax rule grid page and verify our tax rate can be used in the rule --> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml new file mode 100644 index 00000000000..c4abd856354 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCreateTaxRateZipCodeRange"> + <annotations> + <stories value="Create Tax Rate"/> + <title value="Create Tax Rate,zip code range"/> + <description value="Test log in to Create Tax Rate and Create Zip Code Range"/> + <testCaseId value="MC-5319"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> + <click selector="{{AdminTaxRateFormSection.deleteRate}}" stepKey="clickDeleteRate"/> + <click selector="{{AdminTaxRateFormSection.ok}}" stepKey="clickOk"/> + </after> + + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + <!-- Create a tax rate with range from 90001-96162 for zipCodes --> + <click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddNewTaxRateButton"/> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillRuleName"/> + <checkOption selector="{{AdminTaxRateFormSection.zipRange}}" stepKey="checkZipRange" /> + <fillField selector="{{AdminTaxRateFormSection.rangeFrom}}" userInput="90001" stepKey="fillZipFrom"/> + <fillField selector="{{AdminTaxRateFormSection.rangeTo}}" userInput="96162" stepKey="fillZipTo"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="United States" stepKey="selectCountry1"/> + <selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="California" stepKey="selectState" /> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput='15.5' stepKey="seeRate"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/> + <waitForPageLoad stepKey="waitForTaxRateIndex3"/> + <!-- Create a tax rate for zipCodeRange and verify we see expected values on the tax rate grid page --> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <selectOption selector="{{AdminTaxRateGridSection.country}}" userInput="United States" stepKey="selectCountry2" /> + <fillField selector="{{AdminTaxRateGridSection.zipCode}}" userInput="90001-96162" stepKey="seeTaxPostCode1"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow3"/> + <!-- Verify we see expected values on the tax rate form page --> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxIdentifierField2"/> + <seeCheckboxIsChecked selector="{{AdminTaxRateFormSection.zipRange}}" stepKey="clickZipRange"/> + <seeInField selector="{{AdminTaxRateFormSection.rangeFrom}}" userInput="90001" stepKey="seeTaxPostCode2"/> + <seeInField selector="{{AdminTaxRateFormSection.rangeTo}}" userInput="96162" stepKey="seeTaxPostCode3"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="California" stepKey="seeState"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="United States" stepKey="seeCountry2"/> + + <!-- Verify we see expected values on the tax rule form page --> + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex4"/> + <click selector="{{AdminTaxRuleGridSection.add}}" stepKey="clickAdd"/> + <see selector="{{AdminTaxRulesSection.taxRateMultiSelectItems}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxRateOnNewTaxRulePage"/> + </test> +</tests> From 9d08ae0a6fd49092ba2922f63d36160a1ac89637 Mon Sep 17 00:00:00 2001 From: Bartosz Kubicki <bartosz.kubicki@lizardmedia.pl> Date: Sun, 23 Sep 2018 10:32:06 +0200 Subject: [PATCH 065/131] Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Merge remote-tracking branch 'origin/adding-attribute-to-product-in-product-form-fix' into adding-attribute-to-product-in-product-form-fix Conflicts: app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php Fix for not added attribute, while added it dynamically from product form. Fix for static code analysis errors. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Merge remote-tracking branch 'origin/adding-attribute-to-product-in-product-form-fix' into adding-attribute-to-product-in-product-form-fix Conflicts: app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php Fix for not added attribute, while added it dynamically from product form. Fix for static code analysis errors. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Merge remote-tracking branch 'origin/adding-attribute-to-product-in-product-form-fix' into adding-attribute-to-product-in-product-form-fix Conflicts: app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php Fix for not added attribute, while added it dynamically from product form. Fix for static code analysis errors. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Merge remote-tracking branch 'origin/adding-attribute-to-product-in-product-form-fix' into adding-attribute-to-product-in-product-form-fix Conflicts: app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php Fix for not added attribute, while added it dynamically from product form. Fix for static code analysis errors. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Merge remote-tracking branch 'origin/adding-attribute-to-product-in-product-form-fix' into adding-attribute-to-product-in-product-form-fix Conflicts: app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php Fix for not added attribute, while added it dynamically from product form. Fix for static code analysis errors. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Fix for not added attribute, while added it dynamically from product form. Merge remote-tracking branch 'origin/adding-attribute-to-product-in-product-form-fix' into adding-attribute-to-product-in-product-form-fix Conflicts: app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php Fix for not added attribute, while added it dynamically from product form. Fix for static code analysis errors. --- .../Product/AddAttributeToTemplate.php | 86 ++++++++++++------- 1 file changed, 54 insertions(+), 32 deletions(-) diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php index bbef1de28e5..09eacbbf073 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/AddAttributeToTemplate.php @@ -6,8 +6,10 @@ namespace Magento\Catalog\Controller\Adminhtml\Product; +use Magento\Backend\App\Action\Context; use Magento\Catalog\Api\AttributeSetRepositoryInterface; use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Controller\Adminhtml\Product; use Magento\Eav\Api\AttributeGroupRepositoryInterface; use Magento\Eav\Api\AttributeManagementInterface; use Magento\Eav\Api\AttributeRepositoryInterface; @@ -16,8 +18,14 @@ use Magento\Eav\Api\Data\AttributeInterface; use Magento\Eav\Api\Data\AttributeSetInterface; use Magento\Framework\Api\SearchCriteriaBuilder; +use Magento\Framework\App\Action\HttpPostActionInterface; +use Magento\Framework\Controller\Result\Json; +use Magento\Framework\Controller\Result\JsonFactory; +use Magento\Framework\DataObject; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\App\ObjectManager; use Psr\Log\LoggerInterface; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Api\ExtensionAttributesFactory; /** @@ -25,10 +33,10 @@ * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class AddAttributeToTemplate extends \Magento\Catalog\Controller\Adminhtml\Product +class AddAttributeToTemplate extends Product implements HttpPostActionInterface { /** - * @var \Magento\Framework\Controller\Result\JsonFactory + * @var JsonFactory */ protected $resultJsonFactory; @@ -75,33 +83,34 @@ class AddAttributeToTemplate extends \Magento\Catalog\Controller\Adminhtml\Produ /** * Constructor * - * @param \Magento\Backend\App\Action\Context $context + * @param Context $context * @param Builder $productBuilder - * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory - * @param \Magento\Eav\Api\Data\AttributeGroupInterfaceFactory|null $attributeGroupFactory + * @param JsonFactory $resultJsonFactory + * @param AttributeGroupInterfaceFactory|null $attributeGroupFactory * @SuppressWarnings(PHPMD.ExcessiveParameterList) + * @SuppressWarnings(PHPMD.LongVariable) */ public function __construct( - \Magento\Backend\App\Action\Context $context, - \Magento\Catalog\Controller\Adminhtml\Product\Builder $productBuilder, - \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory, - \Magento\Eav\Api\Data\AttributeGroupInterfaceFactory $attributeGroupFactory = null + Context $context, + Builder $productBuilder, + JsonFactory $resultJsonFactory, + AttributeGroupInterfaceFactory $attributeGroupFactory = null ) { parent::__construct($context, $productBuilder); $this->resultJsonFactory = $resultJsonFactory; - $this->attributeGroupFactory = $attributeGroupFactory ?: \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Eav\Api\Data\AttributeGroupInterfaceFactory::class); + $this->attributeGroupFactory = $attributeGroupFactory ?: ObjectManager::getInstance() + ->get(AttributeGroupInterfaceFactory::class); } /** * Add attribute to attribute set * - * @return \Magento\Framework\Controller\Result\Json + * @return Json */ public function execute() { $request = $this->getRequest(); - $response = new \Magento\Framework\DataObject(); + $response = new DataObject(); $response->setError(false); try { @@ -124,12 +133,12 @@ public function execute() ->getItems(); if (!$attributeGroupItems) { - throw new \Magento\Framework\Exception\NoSuchEntityException; + throw new NoSuchEntityException; } /** @var AttributeGroupInterface $attributeGroup */ $attributeGroup = reset($attributeGroupItems); - } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { + } catch (NoSuchEntityException $e) { /** @var AttributeGroupInterface $attributeGroup */ $attributeGroup = $this->attributeGroupFactory->create(); } @@ -176,101 +185,114 @@ public function execute() * Adding basic filters * * @return SearchCriteriaBuilder - * @throws \Magento\Framework\Exception\LocalizedException + * @throws LocalizedException */ private function getBasicAttributeSearchCriteriaBuilder() { - $attributeIds = (array)$this->getRequest()->getParam('attributeIds', []); + $attributeIds = (array) $this->getRequest()->getParam('attributeIds', []); if (empty($attributeIds['selected'])) { throw new LocalizedException(__('Attributes were missing and must be specified.')); } return $this->getSearchCriteriaBuilder() - ->addFilter('attribute_set_id', new \Zend_Db_Expr('null'), 'is') ->addFilter('attribute_id', [$attributeIds['selected']], 'in'); } /** + * Get AttributeRepositoryInterface + * * @return AttributeRepositoryInterface */ private function getAttributeRepository() { if (null === $this->attributeRepository) { - $this->attributeRepository = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Eav\Api\AttributeRepositoryInterface::class); + $this->attributeRepository = ObjectManager::getInstance() + ->get(AttributeRepositoryInterface::class); } return $this->attributeRepository; } /** + * Get AttributeSetRepositoryInterface + * * @return AttributeSetRepositoryInterface */ private function getAttributeSetRepository() { if (null === $this->attributeSetRepository) { - $this->attributeSetRepository = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Catalog\Api\AttributeSetRepositoryInterface::class); + $this->attributeSetRepository = ObjectManager::getInstance() + ->get(AttributeSetRepositoryInterface::class); } return $this->attributeSetRepository; } /** + * Get AttributeGroupInterface + * * @return AttributeGroupRepositoryInterface */ private function getAttributeGroupRepository() { if (null === $this->attributeGroupRepository) { - $this->attributeGroupRepository = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Eav\Api\AttributeGroupRepositoryInterface::class); + $this->attributeGroupRepository = ObjectManager::getInstance() + ->get(AttributeGroupRepositoryInterface::class); } return $this->attributeGroupRepository; } /** + * Get SearchCriteriaBuilder + * * @return SearchCriteriaBuilder */ private function getSearchCriteriaBuilder() { if (null === $this->searchCriteriaBuilder) { - $this->searchCriteriaBuilder = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Framework\Api\SearchCriteriaBuilder::class); + $this->searchCriteriaBuilder = ObjectManager::getInstance() + ->get(SearchCriteriaBuilder::class); } return $this->searchCriteriaBuilder; } /** + * Get AttributeManagementInterface + * * @return AttributeManagementInterface */ private function getAttributeManagement() { if (null === $this->attributeManagement) { - $this->attributeManagement = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Eav\Api\AttributeManagementInterface::class); + $this->attributeManagement = ObjectManager::getInstance() + ->get(AttributeManagementInterface::class); } return $this->attributeManagement; } /** + * Get LoggerInterface + * * @return LoggerInterface */ private function getLogger() { if (null === $this->logger) { - $this->logger = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Psr\Log\LoggerInterface::class); + $this->logger = ObjectManager::getInstance() + ->get(LoggerInterface::class); } return $this->logger; } /** + * Get ExtensionAttributesFactory. + * * @return ExtensionAttributesFactory */ private function getExtensionAttributesFactory() { if (null === $this->extensionAttributesFactory) { - $this->extensionAttributesFactory = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Framework\Api\ExtensionAttributesFactory::class); + $this->extensionAttributesFactory = ObjectManager::getInstance() + ->get(ExtensionAttributesFactory::class); } return $this->extensionAttributesFactory; } From 180de0ab6d6e29deee123baed1d8f20f2324180a Mon Sep 17 00:00:00 2001 From: Tomas Votruba <tomas.vot@gmail.com> Date: Thu, 22 Nov 2018 09:19:06 +0100 Subject: [PATCH 066/131] correct param, var and return annotation values --- .../Magento/Framework/Acl/Loader/ResourceLoader.php | 2 +- lib/internal/Magento/Framework/Amqp/Queue.php | 2 +- .../SearchCriteria/CollectionProcessor/JoinProcessor.php | 2 +- .../Unit/ExtensionAttribute/Config/SchemaLocatorTest.php | 2 +- lib/internal/Magento/Framework/App/ResourceConnection.php | 2 +- .../Magento/Framework/App/Test/Unit/Request/HttpTest.php | 8 ++++---- .../Unit/ResourceConnection/Config/SchemaLocatorTest.php | 2 +- .../App/Test/Unit/Route/Config/SchemaLocatorTest.php | 4 ++-- lib/internal/Magento/Framework/App/Utility/Classes.php | 2 +- .../Test/Unit/Backend/Decorator/DecoratorAbstractTest.php | 2 +- .../Magento/Framework/Composer/ComposerJsonFinder.php | 2 +- .../Magento/Framework/Config/Test/Unit/ThemeTest.php | 4 ++-- .../Unit/PreProcessor/File/Collector/AggregatedTest.php | 6 +++--- .../Test/Unit/PreProcessor/File/Collector/LibraryTest.php | 4 ++-- lib/internal/Magento/Framework/DataObject/Copy.php | 6 +++--- .../EntityManager/Test/Unit/TypeResolverTest.php | 2 +- .../Event/Test/Unit/Config/SchemaLocatorTest.php | 4 ++-- .../Magento/Framework/Exception/BulkException.php | 2 +- lib/internal/Magento/Framework/File/Mime.php | 2 +- lib/internal/Magento/Framework/Filesystem/Io/Sftp.php | 2 +- .../Indexer/Test/Unit/Config/SchemaLocatorTest.php | 4 ++-- lib/internal/Magento/Framework/Lock/Backend/Database.php | 2 +- .../Framework/Lock/Test/Unit/Backend/DatabaseTest.php | 2 +- lib/internal/Magento/Framework/Logger/Handler/Base.php | 2 +- lib/internal/Magento/Framework/Logger/Handler/System.php | 2 +- lib/internal/Magento/Framework/Message/Manager.php | 2 +- lib/internal/Magento/Framework/Model/AbstractModel.php | 2 +- lib/internal/Magento/Framework/Module/Setup/Context.php | 2 +- .../Magento/Framework/ObjectManager/Profiler/Log.php | 2 +- .../ObjectManager/Test/Unit/Config/SchemaLocatorTest.php | 4 ++-- .../Search/Test/Unit/Adapter/Mysql/Filter/BuilderTest.php | 2 +- .../Framework/Session/SaveHandler/Redis/Config.php | 2 +- lib/internal/Magento/Framework/Test/Unit/UrlTest.php | 6 +++--- lib/internal/Magento/Framework/Translate.php | 2 +- .../Framework/Translate/Inline/ParserInterface.php | 2 +- .../Magento/Framework/View/Design/Theme/ThemeList.php | 2 +- .../View/Element/UiComponent/Config/DomMerger.php | 2 +- lib/internal/Magento/Framework/Webapi/ErrorProcessor.php | 2 +- 38 files changed, 53 insertions(+), 53 deletions(-) diff --git a/lib/internal/Magento/Framework/Acl/Loader/ResourceLoader.php b/lib/internal/Magento/Framework/Acl/Loader/ResourceLoader.php index 8a4ad39d785..afcd1d82bb8 100644 --- a/lib/internal/Magento/Framework/Acl/Loader/ResourceLoader.php +++ b/lib/internal/Magento/Framework/Acl/Loader/ResourceLoader.php @@ -17,7 +17,7 @@ class ResourceLoader implements \Magento\Framework\Acl\LoaderInterface /** * Acl resource config * - * @var ProviderInterface $resourceProvider + * @var ProviderInterface */ protected $_resourceProvider; diff --git a/lib/internal/Magento/Framework/Amqp/Queue.php b/lib/internal/Magento/Framework/Amqp/Queue.php index edd57339b84..0587d5a5927 100644 --- a/lib/internal/Magento/Framework/Amqp/Queue.php +++ b/lib/internal/Magento/Framework/Amqp/Queue.php @@ -37,7 +37,7 @@ class Queue implements QueueInterface private $envelopeFactory; /** - * @var LoggerInterface $logger + * @var LoggerInterface */ private $logger; diff --git a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php index 207325042c7..34f16212c82 100644 --- a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php +++ b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php @@ -28,7 +28,7 @@ class JoinProcessor implements CollectionProcessorInterface private $appliedFields = []; /** - * @param CustomJoinInterface[] $customFilters + * @param CustomJoinInterface[] $customJoins * @param array $fieldMapping */ public function __construct( diff --git a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/SchemaLocatorTest.php index d874f155b16..972b165d8f3 100644 --- a/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/Api/Test/Unit/ExtensionAttribute/Config/SchemaLocatorTest.php @@ -15,7 +15,7 @@ class SchemaLocatorTest extends \PHPUnit\Framework\TestCase */ protected $model; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; protected function setUp() diff --git a/lib/internal/Magento/Framework/App/ResourceConnection.php b/lib/internal/Magento/Framework/App/ResourceConnection.php index 148053fa44e..4652d2aaf6d 100644 --- a/lib/internal/Magento/Framework/App/ResourceConnection.php +++ b/lib/internal/Magento/Framework/App/ResourceConnection.php @@ -53,7 +53,7 @@ class ResourceConnection protected $connectionFactory; /** - * @var DeploymentConfig $deploymentConfig + * @var DeploymentConfig */ private $deploymentConfig; diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php index 535e74e9a3b..81805e2df96 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -246,8 +246,8 @@ public function testIsAjax() } /** - * @param $serverVariables array - * @param $expectedResult string + * @param array $serverVariables + * @param string $expectedResult * @dataProvider serverVariablesProvider */ public function testGetDistroBaseUrl($serverVariables, $expectedResult) @@ -374,7 +374,7 @@ public function testIsSecure($isSecure, $serverHttps, $headerOffloadKey, $header /** * @dataProvider httpSafeMethodProvider * @backupGlobals enabled - * @param string $method value of $_SERVER['REQUEST_METHOD'] + * @param string $httpMethod value of $_SERVER['REQUEST_METHOD'] */ public function testIsSafeMethodTrue($httpMethod) { @@ -386,7 +386,7 @@ public function testIsSafeMethodTrue($httpMethod) /** * @dataProvider httpNotSafeMethodProvider * @backupGlobals enabled - * @param string $method value of $_SERVER['REQUEST_METHOD'] + * @param string $httpMethod value of $_SERVER['REQUEST_METHOD'] */ public function testIsSafeMethodFalse($httpMethod) { diff --git a/lib/internal/Magento/Framework/App/Test/Unit/ResourceConnection/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/App/Test/Unit/ResourceConnection/Config/SchemaLocatorTest.php index 8a5c071e8c4..921fcf2e61e 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/ResourceConnection/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/ResourceConnection/Config/SchemaLocatorTest.php @@ -13,7 +13,7 @@ class SchemaLocatorTest extends \PHPUnit\Framework\TestCase */ protected $model; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; protected function setUp() diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/SchemaLocatorTest.php index 143de5ee47f..61938b45529 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Route/Config/SchemaLocatorTest.php @@ -12,10 +12,10 @@ class SchemaLocatorTest extends \PHPUnit\Framework\TestCase */ protected $config; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolverMock; protected function setUp() diff --git a/lib/internal/Magento/Framework/App/Utility/Classes.php b/lib/internal/Magento/Framework/App/Utility/Classes.php index 7cd36f0e37f..289fc8fc8c8 100644 --- a/lib/internal/Magento/Framework/App/Utility/Classes.php +++ b/lib/internal/Magento/Framework/App/Utility/Classes.php @@ -236,7 +236,7 @@ public static function getVirtualClasses() /** * Check if instance is virtual type * - * @param $className string + * @param string $className * @return bool */ public static function isVirtual($className) diff --git a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/DecoratorAbstractTest.php b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/DecoratorAbstractTest.php index ba75b7eed52..03ce339e90b 100644 --- a/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/DecoratorAbstractTest.php +++ b/lib/internal/Magento/Framework/Cache/Test/Unit/Backend/Decorator/DecoratorAbstractTest.php @@ -54,7 +54,7 @@ public function testConstructor() } /** - * @param array options + * @param array $options * @expectedException \Zend_Cache_Exception * @dataProvider constructorExceptionDataProvider */ diff --git a/lib/internal/Magento/Framework/Composer/ComposerJsonFinder.php b/lib/internal/Magento/Framework/Composer/ComposerJsonFinder.php index 259fcd323b3..2a641a41377 100644 --- a/lib/internal/Magento/Framework/Composer/ComposerJsonFinder.php +++ b/lib/internal/Magento/Framework/Composer/ComposerJsonFinder.php @@ -13,7 +13,7 @@ class ComposerJsonFinder { /** - * @var DirectoryList $directoryList + * @var DirectoryList */ private $directoryList; diff --git a/lib/internal/Magento/Framework/Config/Test/Unit/ThemeTest.php b/lib/internal/Magento/Framework/Config/Test/Unit/ThemeTest.php index 17fa8906836..4966a45c7b4 100644 --- a/lib/internal/Magento/Framework/Config/Test/Unit/ThemeTest.php +++ b/lib/internal/Magento/Framework/Config/Test/Unit/ThemeTest.php @@ -7,10 +7,10 @@ class ThemeTest extends \PHPUnit\Framework\TestCase { - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolverMock; protected function setUp() diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/AggregatedTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/AggregatedTest.php index c1c2a4f4a1d..cdf7a1ec373 100644 --- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/AggregatedTest.php +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/AggregatedTest.php @@ -98,9 +98,9 @@ public function testGetFilesEmpty() * * @dataProvider getFilesDataProvider * - * @param $libraryFiles array Files in lib directory - * @param $baseFiles array Files in base directory - * @param $themeFiles array Files in theme + * @param array $libraryFiles Files in lib directory + * @param array $baseFiles Files in base directory + * @param array $themeFiles Files in theme * * * @return void */ diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/LibraryTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/LibraryTest.php index 962734feea1..6080652a4ad 100644 --- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/LibraryTest.php +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/File/Collector/LibraryTest.php @@ -129,8 +129,8 @@ public function testGetFilesEmpty() * * @dataProvider getFilesDataProvider * - * @param $libraryFiles array Files in lib directory - * @param $themeFiles array Files in theme + * @param array $libraryFiles Files in lib directory + * @param array $themeFiles Files in theme * * * @return void */ diff --git a/lib/internal/Magento/Framework/DataObject/Copy.php b/lib/internal/Magento/Framework/DataObject/Copy.php index 728f72e713d..f4e733feb0b 100644 --- a/lib/internal/Magento/Framework/DataObject/Copy.php +++ b/lib/internal/Magento/Framework/DataObject/Copy.php @@ -123,7 +123,7 @@ protected function dispatchCopyFieldSetEvent($fieldset, $aspect, $source, $targe * @param string $aspect a field name * @param array|\Magento\Framework\DataObject $source * @param string $root - * @return array $data + * @return array * * @api */ @@ -232,7 +232,7 @@ protected function _setFieldsetFieldValue($target, $targetCode, $value) /** * Access the extension get method * - * @param \Magento\Framework\Api\ExtensibleDataInterface $object + * @param \Magento\Framework\Api\ExtensibleDataInterface $source * @param string $code * * @return mixed @@ -265,7 +265,7 @@ protected function getAttributeValueFromExtensibleDataObject($source, $code) /** * Access the extension set method * - * @param \Magento\Framework\Api\ExtensibleDataInterface $object + * @param \Magento\Framework\Api\ExtensibleDataInterface $target * @param string $code * @param mixed $value * diff --git a/lib/internal/Magento/Framework/EntityManager/Test/Unit/TypeResolverTest.php b/lib/internal/Magento/Framework/EntityManager/Test/Unit/TypeResolverTest.php index 1ab6074d6a3..9b90e373de8 100644 --- a/lib/internal/Magento/Framework/EntityManager/Test/Unit/TypeResolverTest.php +++ b/lib/internal/Magento/Framework/EntityManager/Test/Unit/TypeResolverTest.php @@ -32,7 +32,7 @@ public function setUp() /** * @param object $dataObject - * @param string $interfaceNames + * @param string $interfaceName * @dataProvider resolveDataProvider */ public function testResolve($dataObject, $interfaceName) diff --git a/lib/internal/Magento/Framework/Event/Test/Unit/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Event/Test/Unit/Config/SchemaLocatorTest.php index cd8a16b5c2c..66651174a87 100644 --- a/lib/internal/Magento/Framework/Event/Test/Unit/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/Event/Test/Unit/Config/SchemaLocatorTest.php @@ -12,10 +12,10 @@ class SchemaLocatorTest extends \PHPUnit\Framework\TestCase */ protected $model; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolverMock; protected function setUp() diff --git a/lib/internal/Magento/Framework/Exception/BulkException.php b/lib/internal/Magento/Framework/Exception/BulkException.php index b2e91da211f..9ee43bce2b9 100644 --- a/lib/internal/Magento/Framework/Exception/BulkException.php +++ b/lib/internal/Magento/Framework/Exception/BulkException.php @@ -39,7 +39,7 @@ public function __construct(Phrase $phrase = null, \Exception $cause = null, $co } /** - * @param $data array + * @param array $data */ public function addData($data) { diff --git a/lib/internal/Magento/Framework/File/Mime.php b/lib/internal/Magento/Framework/File/Mime.php index d42b536f450..f235d5765c7 100644 --- a/lib/internal/Magento/Framework/File/Mime.php +++ b/lib/internal/Magento/Framework/File/Mime.php @@ -61,7 +61,7 @@ class Mime /** * List of mime types that can be defined by file extension. * - * @var array $defineByExtensionList + * @var array */ private $defineByExtensionList = [ 'txt' => 'text/plain', diff --git a/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php b/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php index a04e4fcbb12..119c89f0334 100644 --- a/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php +++ b/lib/internal/Magento/Framework/Filesystem/Io/Sftp.php @@ -17,7 +17,7 @@ class Sftp extends AbstractIo const SSH2_PORT = 22; /** - * @var \phpseclib\Net\SFTP $_connection + * @var \phpseclib\Net\SFTP */ protected $_connection = null; diff --git a/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/SchemaLocatorTest.php index ee193da3f0b..5b09c558a90 100644 --- a/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/Indexer/Test/Unit/Config/SchemaLocatorTest.php @@ -13,10 +13,10 @@ class SchemaLocatorTest extends \PHPUnit\Framework\TestCase */ protected $model; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolverMock; protected function setUp() diff --git a/lib/internal/Magento/Framework/Lock/Backend/Database.php b/lib/internal/Magento/Framework/Lock/Backend/Database.php index dbc6a97ce60..ce6aeca66d6 100644 --- a/lib/internal/Magento/Framework/Lock/Backend/Database.php +++ b/lib/internal/Magento/Framework/Lock/Backend/Database.php @@ -139,7 +139,7 @@ public function isLocked(string $name): bool * Limited to 64 characters in MySQL. * * @param string $name - * @return string $name + * @return string * @throws InputException */ private function addPrefix(string $name): string diff --git a/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php b/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php index 616597a8838..db3add62ff5 100644 --- a/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php +++ b/lib/internal/Magento/Framework/Lock/Test/Unit/Backend/DatabaseTest.php @@ -32,7 +32,7 @@ class DatabaseTest extends \PHPUnit\Framework\TestCase private $objectManager; /** - * @var Database $database + * @var Database */ private $database; diff --git a/lib/internal/Magento/Framework/Logger/Handler/Base.php b/lib/internal/Magento/Framework/Logger/Handler/Base.php index 46c707a9254..84109b7b263 100644 --- a/lib/internal/Magento/Framework/Logger/Handler/Base.php +++ b/lib/internal/Magento/Framework/Logger/Handler/Base.php @@ -73,7 +73,7 @@ private function sanitizeFileName($fileName) /** * {@inheritDoc} * - * @param $record array + * @param array $record * * @return void */ diff --git a/lib/internal/Magento/Framework/Logger/Handler/System.php b/lib/internal/Magento/Framework/Logger/Handler/System.php index b30195e9797..f2de01d0745 100644 --- a/lib/internal/Magento/Framework/Logger/Handler/System.php +++ b/lib/internal/Magento/Framework/Logger/Handler/System.php @@ -43,7 +43,7 @@ public function __construct( /** * Writes formatted record through the handler. * - * @param $record array The record metadata + * @param array $record The record metadata * @return void */ public function write(array $record) diff --git a/lib/internal/Magento/Framework/Message/Manager.php b/lib/internal/Magento/Framework/Message/Manager.php index f31892a938f..2b1b60bf76a 100644 --- a/lib/internal/Magento/Framework/Message/Manager.php +++ b/lib/internal/Magento/Framework/Message/Manager.php @@ -67,7 +67,7 @@ class Manager implements ManagerInterface * @param Event\ManagerInterface $eventManager * @param LoggerInterface $logger * @param string $defaultGroup - * @param ExceptionMessageFactoryInterface|null exceptionMessageFactory + * @param ExceptionMessageFactoryInterface|null $exceptionMessageFactory exceptionMessageFactory */ public function __construct( Session $session, diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index d8a7c96c639..c1a597e1371 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -42,7 +42,7 @@ abstract class AbstractModel extends \Magento\Framework\DataObject /** * Data changes flag (true after setData|unsetData call) - * @var $_hasDataChange bool + * @var bool */ protected $_hasDataChanges = false; diff --git a/lib/internal/Magento/Framework/Module/Setup/Context.php b/lib/internal/Magento/Framework/Module/Setup/Context.php index 81b93ac447c..81dcb08e95c 100644 --- a/lib/internal/Magento/Framework/Module/Setup/Context.php +++ b/lib/internal/Magento/Framework/Module/Setup/Context.php @@ -107,7 +107,7 @@ public function getEventManager() } /** - * @return \Psr\Log\LoggerInterface $logger + * @return \Psr\Log\LoggerInterface */ public function getLogger() { diff --git a/lib/internal/Magento/Framework/ObjectManager/Profiler/Log.php b/lib/internal/Magento/Framework/ObjectManager/Profiler/Log.php index 9221dad9090..79f014d8964 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Profiler/Log.php +++ b/lib/internal/Magento/Framework/ObjectManager/Profiler/Log.php @@ -11,7 +11,7 @@ class Log { /** - * @var $this + * @var self */ protected static $instance; diff --git a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/SchemaLocatorTest.php b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/SchemaLocatorTest.php index 1a653992e1e..65018bcd873 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/SchemaLocatorTest.php +++ b/lib/internal/Magento/Framework/ObjectManager/Test/Unit/Config/SchemaLocatorTest.php @@ -12,10 +12,10 @@ class SchemaLocatorTest extends \PHPUnit\Framework\TestCase */ protected $model; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolver; - /** @var \Magento\Framework\Config\Dom\UrnResolver $urnResolverMock */ + /** @var \Magento\Framework\Config\Dom\UrnResolver */ protected $urnResolverMock; protected function setUp() diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/Filter/BuilderTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/Filter/BuilderTest.php index 2a7aa8561b2..26e6aba1d33 100644 --- a/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/Filter/BuilderTest.php +++ b/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/Filter/BuilderTest.php @@ -29,7 +29,7 @@ class BuilderTest extends \PHPUnit\Framework\TestCase private $preprocessor; /** - * @var ConditionManager|\PHPUnit_Framework_MockObject_MockObject $conditionManager + * @var ConditionManager|\PHPUnit_Framework_MockObject_MockObject */ private $conditionManager; diff --git a/lib/internal/Magento/Framework/Session/SaveHandler/Redis/Config.php b/lib/internal/Magento/Framework/Session/SaveHandler/Redis/Config.php index 5a4ed1700da..a5eddb402a1 100644 --- a/lib/internal/Magento/Framework/Session/SaveHandler/Redis/Config.php +++ b/lib/internal/Magento/Framework/Session/SaveHandler/Redis/Config.php @@ -143,7 +143,7 @@ class Config implements \Cm\RedisSession\Handler\ConfigInterface /** * Deployment config * - * @var DeploymentConfig $deploymentConfig + * @var DeploymentConfig */ private $deploymentConfig; diff --git a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php index 3713978d0f7..046a9d63fc8 100644 --- a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php @@ -149,8 +149,8 @@ protected function getUrlModel($arguments = []) } /** - * @param $httpHost string - * @param $url string + * @param string $httpHost + * @param string $url * @dataProvider getCurrentUrlProvider */ public function testGetCurrentUrl($httpHost, $url) @@ -435,7 +435,7 @@ public function testGetDirectUrl() } /** - * @param string $url + * @param string $inputUrl * @dataProvider getRebuiltUrlDataProvider */ public function testGetRebuiltUrl($inputUrl, $outputUrl) diff --git a/lib/internal/Magento/Framework/Translate.php b/lib/internal/Magento/Framework/Translate.php index dae3f73e8fc..e992482609a 100644 --- a/lib/internal/Magento/Framework/Translate.php +++ b/lib/internal/Magento/Framework/Translate.php @@ -60,7 +60,7 @@ class Translate implements \Magento\Framework\TranslateInterface protected $_viewDesign; /** - * @var \Magento\Framework\Cache\FrontendInterface $cache + * @var \Magento\Framework\Cache\FrontendInterface */ protected $_cache; diff --git a/lib/internal/Magento/Framework/Translate/Inline/ParserInterface.php b/lib/internal/Magento/Framework/Translate/Inline/ParserInterface.php index e8905f71ea7..4c3bfc1a196 100644 --- a/lib/internal/Magento/Framework/Translate/Inline/ParserInterface.php +++ b/lib/internal/Magento/Framework/Translate/Inline/ParserInterface.php @@ -43,7 +43,7 @@ public function getContent(); /** * Sets the body content that is being parsed passed upon the passed in string. * - * @param $content string + * @param string $content * @return void */ public function setContent($content); diff --git a/lib/internal/Magento/Framework/View/Design/Theme/ThemeList.php b/lib/internal/Magento/Framework/View/Design/Theme/ThemeList.php index 000fba24f08..0d6ed2f98b5 100644 --- a/lib/internal/Magento/Framework/View/Design/Theme/ThemeList.php +++ b/lib/internal/Magento/Framework/View/Design/Theme/ThemeList.php @@ -40,7 +40,7 @@ class ThemeList extends \Magento\Framework\Data\Collection implements ListInterf protected $_itemObjectClass = ThemeInterface::class; /** - * @var \Magento\Framework\Config\ThemeFactory $themeConfigFactory + * @var \Magento\Framework\Config\ThemeFactory */ protected $themeConfigFactory; diff --git a/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php b/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php index b20726b7958..015ecf403b3 100644 --- a/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php +++ b/lib/internal/Magento/Framework/View/Element/UiComponent/Config/DomMerger.php @@ -341,7 +341,7 @@ public function createDomDocument($xml) * Validate dom document * * @param \DOMDocument $domDocument - * @param string|null $schemaFilePath + * @param string|null $schema * @return array of errors * @throws \Exception */ diff --git a/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php b/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php index 6fc5b284b75..6ffcaa0676a 100644 --- a/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php +++ b/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php @@ -195,7 +195,7 @@ public function renderException(\Exception $exception, $httpCode = self::DEFAULT * Log information about exception to exception log. * * @param \Exception $exception - * @return string $reportId + * @return string */ protected function _critical(\Exception $exception) { From 486aeadf01fedab8853fd515c88116282185f58d Mon Sep 17 00:00:00 2001 From: Daniel Ruf <daniel.ruf@ueberbit.de> Date: Thu, 22 Nov 2018 10:14:33 +0100 Subject: [PATCH 067/131] chore: remove old code for IE9 --- lib/web/varien/js.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/web/varien/js.js b/lib/web/varien/js.js index 55e41a1652c..45032829f2f 100644 --- a/lib/web/varien/js.js +++ b/lib/web/varien/js.js @@ -607,17 +607,11 @@ if (!("console" in window) || !("firebug" in console)) * @example fireEvent($('my-input', 'click')); */ function fireEvent(element, event) { - if (document.createEvent) { - // dispatch for all browsers except IE before version 9 - var evt = document.createEvent('HTMLEvents'); + // dispatch event + var evt = document.createEvent('HTMLEvents'); - evt.initEvent(event, true, true); // event type, bubbling, cancelable - return element.dispatchEvent(evt); - } - // dispatch for IE before version 9 - var evt = document.createEventObject(); - - return element.fireEvent('on' + event, evt); + evt.initEvent(event, true, true); // event type, bubbling, cancelable + return element.dispatchEvent(evt); } From c8d4c2e808ed57a7eb8b1369b3a74f25aa722516 Mon Sep 17 00:00:00 2001 From: Daniel Ruf <daniel.ruf@ueberbit.de> Date: Thu, 22 Nov 2018 10:16:32 +0100 Subject: [PATCH 068/131] chore: remove old CSS fixes for IE --- .../fileUploader/css/jquery.fileupload-ui.css | 11 - lib/web/prototype/windows/themes/darkX.css | 20 -- lib/web/prototype/windows/themes/lighting.css | 293 +----------------- lib/web/prototype/windows/themes/mac_os_x.css | 112 ------- .../windows/themes/mac_os_x_dialog.css | 50 --- lib/web/prototype/windows/themes/nuncio.css | 67 ---- 6 files changed, 1 insertion(+), 552 deletions(-) diff --git a/lib/web/jquery/fileUploader/css/jquery.fileupload-ui.css b/lib/web/jquery/fileUploader/css/jquery.fileupload-ui.css index e36a93df36b..44b628efb48 100644 --- a/lib/web/jquery/fileUploader/css/jquery.fileupload-ui.css +++ b/lib/web/jquery/fileUploader/css/jquery.fileupload-ui.css @@ -52,17 +52,6 @@ display: block; } -/* Fix for IE 6: */ -*html .fileinput-button { - line-height: 22px; - margin: 1px -3px 0 0; -} - -/* Fix for IE 7: */ -*+html .fileinput-button { - margin: 1px 0 0 0; -} - @media (max-width: 480px) { .files .btn span { display: none; diff --git a/lib/web/prototype/windows/themes/darkX.css b/lib/web/prototype/windows/themes/darkX.css index 2f83cfd46ad..1d964b1376d 100644 --- a/lib/web/prototype/windows/themes/darkX.css +++ b/lib/web/prototype/windows/themes/darkX.css @@ -99,23 +99,3 @@ font-size: 14px; background:#5E5148; } - - -/* FOR IE */ -* html .darkX_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-minimize-focused.png", sizingMethod="crop"); -} - -* html .darkX_maximize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-maximize-focused.png", sizingMethod="scale"); -} - -* html .darkX_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/darkX/button-close-focused.png", sizingMethod="crop"); -} diff --git a/lib/web/prototype/windows/themes/lighting.css b/lib/web/prototype/windows/themes/lighting.css index 95ec287a927..60fed4aaa2d 100644 --- a/lib/web/prototype/windows/themes/lighting.css +++ b/lib/web/prototype/windows/themes/lighting.css @@ -185,79 +185,6 @@ background:transparent url('lighting/spinner.gif') no-repeat center center } -/* FOR IE */ -* html .bluelighting_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-blue.png", sizingMethod="scale"); -} - -* html .bluelighting_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-blue.png", sizingMethod="scale"); -} - -* html .bluelighting_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-blue.png", sizingMethod="scale"); -} - -* html .bluelighting_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-blue.png", sizingMethod="scale"); -} - -* html .bluelighting_se, * html .bluelighting_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_maximize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-blue.png", sizingMethod="crop"); -} - -* html .bluelighting_content { - background:#B8D7FF; -} - - - .overlay_greylighting { background-color:#FFF; filter:alpha(opacity=60); @@ -419,79 +346,6 @@ background:transparent url('lighting/spinner.gif') no-repeat center center } -/* FOR IE */ -* html .greylighting_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-grey.png", sizingMethod="crop"); -} - -* html .greylighting_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-grey.png", sizingMethod="scale"); -} - -* html .greylighting_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-grey.png", sizingMethod="crop"); -} - -* html .greylighting_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-grey.png", sizingMethod="scale"); -} - -* html .greylighting_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-grey.png", sizingMethod="scale"); -} - -* html .greylighting_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-grey.png", sizingMethod="crop"); -} - -* html .greylighting_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-grey.png", sizingMethod="scale"); -} - -* html greylighting_se, * html .greylighting_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-grey.png", sizingMethod="crop"); -} - -* html .greylighting_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-grey.png", sizingMethod="crop"); -} - -* html .greylighting_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-grey.png", sizingMethod="crop"); -} - -* html .greylighting_maximize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-grey.png", sizingMethod="crop"); -} - -* html .greylighting_content { - background:#C7C7C7; -} - - - .overlay_greenlighting { background-color:#FFF; filter:alpha(opacity=60); @@ -653,79 +507,6 @@ background:transparent url('lighting/spinner.gif') no-repeat center center } -/* FOR IE */ -* html .greenlighting_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-green.png", sizingMethod="crop"); -} - -* html .greenlighting_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-green.png", sizingMethod="scale"); -} - -* html .greenlighting_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-green.png", sizingMethod="crop"); -} - -* html .greenlighting_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-green.png", sizingMethod="scale"); -} - -* html .greenlighting_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-green.png", sizingMethod="scale"); -} - -* html .greenlighting_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-green.png", sizingMethod="crop"); -} - -* html .greenlighting_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-green.png", sizingMethod="scale"); -} - -* html greenlighting_se, * html .greenlighting_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-green.png", sizingMethod="crop"); -} - -* html .greenlighting_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-green.png", sizingMethod="crop"); -} - -* html .greenlighting_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-green.png", sizingMethod="crop"); -} - -* html .greenlighting_maximize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-green.png", sizingMethod="crop"); -} - -* html .greenlighting_content { - background:#A4FCA7; -} - - - .overlay_darkbluelighting { background-color:#FFF; filter:alpha(opacity=60); @@ -885,76 +666,4 @@ width:100%; height:16px; background:transparent url('lighting/spinner.gif') no-repeat center center -} - -/* FOR IE */ -* html .darkbluelighting_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-left-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-middle-darkblue.png", sizingMethod="scale"); -} - -* html .darkbluelighting_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/top-right-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/left-darkblue.png", sizingMethod="scale"); -} - -* html .darkbluelighting_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/right-darkblue.png", sizingMethod="scale"); -} - -* html .darkbluelighting_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-left-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-middle-darkblue.png", sizingMethod="scale"); -} - -* html darkbluelighting_se, * html .darkbluelighting_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/bottom-right-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-close-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-minimize-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_maximize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/lighting/button-maximize-darkblue.png", sizingMethod="crop"); -} - -* html .darkbluelighting_content { - background:#020EBA; -} - +} \ No newline at end of file diff --git a/lib/web/prototype/windows/themes/mac_os_x.css b/lib/web/prototype/windows/themes/mac_os_x.css index 24751f86888..d2f556b876e 100644 --- a/lib/web/prototype/windows/themes/mac_os_x.css +++ b/lib/web/prototype/windows/themes/mac_os_x.css @@ -109,62 +109,6 @@ padding-bottom:24px; } -/* FOR IE */ -* html .mac_os_x_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TL_Main.png", sizingMethod="crop"); -} - -* html .mac_os_x_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/T_Main.png", sizingMethod="scale"); -} - -* html .mac_os_x_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TR_Main.png", sizingMethod="crop"); -} - -* html .mac_os_x_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/L_Main.png", sizingMethod="scale"); -} - -* html .mac_os_x_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/R_Main.png", sizingMethod="scale"); -} - -* html .mac_os_x_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BL_Main.png", sizingMethod="crop"); -} - -* html .mac_os_x_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/B_Main.png", sizingMethod="scale"); -} - -* html .mac_os_x_se { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR_Main.png", sizingMethod="crop"); -} - -* html .mac_os_x_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR_Main.png", sizingMethod="crop"); -} - - /* Focused windows */ .overlay_blur_os_x { background-color: #85BBEF; @@ -275,59 +219,3 @@ .blur_os_x_s .status_bar { padding-bottom:24px; } - -/* FOR IE */ -* html .blur_os_x_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TL.png", sizingMethod="crop"); -} - -* html .blur_os_x_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/T.png", sizingMethod="scale"); -} - -* html .blur_os_x_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/TR.png", sizingMethod="crop"); -} - -* html .blur_os_x_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/L.png", sizingMethod="scale"); -} - -* html .blur_os_x_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/R.png", sizingMethod="scale"); -} - -* html .blur_os_x_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BL.png", sizingMethod="crop"); -} - -* html .blur_os_x_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/B.png", sizingMethod="scale"); -} - -* html .blur_os_x_se { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR.png", sizingMethod="crop"); -} - -* html .blur_os_x_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x/BR.png", sizingMethod="crop"); -} - diff --git a/lib/web/prototype/windows/themes/mac_os_x_dialog.css b/lib/web/prototype/windows/themes/mac_os_x_dialog.css index e663e3c5e25..5aff20203d0 100644 --- a/lib/web/prototype/windows/themes/mac_os_x_dialog.css +++ b/lib/web/prototype/windows/themes/mac_os_x_dialog.css @@ -108,53 +108,3 @@ .mac_os_x_dialog_buttons { text-align: center; } -/* FOR IE */ -* html .mac_os_x_dialog_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); -} - - -* html .mac_os_x_dialog_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/L.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/R.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BL.png", sizingMethod="crop"); -} - -* html .mac_os_x_dialog_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/B.png", sizingMethod="scale"); -} - -* html .mac_os_x_dialog_se { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); -} - -* html .mac_os_x_dialog_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/mac_os_x_dialog/BR.png", sizingMethod="crop"); -} - diff --git a/lib/web/prototype/windows/themes/nuncio.css b/lib/web/prototype/windows/themes/nuncio.css index 2c439bd0019..275ba53436f 100644 --- a/lib/web/prototype/windows/themes/nuncio.css +++ b/lib/web/prototype/windows/themes/nuncio.css @@ -95,70 +95,3 @@ .top_draggable, .bottom_draggable { cursor:move } -/* FOR IE */ -* html .nuncio_nw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_left.png", sizingMethod="crop"); -} - -* html .nuncio_n { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_mid.png", sizingMethod="scale"); -} - -* html .nuncio_ne { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/top_right.png", sizingMethod="crop"); -} - -* html .nuncio_w { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_left.png", sizingMethod="scale"); -} - -* html .nuncio_e { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/center_right.png", sizingMethod="scale"); -} - -* html .nuncio_sw { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_left.png", sizingMethod="crop"); -} - -* html .nuncio_s { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_mid.png", sizingMethod="scale"); -} - -* html .nuncio_se { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop"); -} - -* html .nuncio_sizer { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/bottom_right.png", sizingMethod="crop"); -} - -* html .nuncio_close { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/close.png", sizingMethod="crop"); -} - -* html .nuncio_minimize { - background-color: transparent; - background-image: none; - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../themes/nuncio/minimize.png", sizingMethod="crop"); -} - From bf831c6031464b2ba0d07ff053b3b14d7a0ba1e0 Mon Sep 17 00:00:00 2001 From: Tomas Votruba <tomas.vot@gmail.com> Date: Thu, 22 Nov 2018 11:19:02 +0100 Subject: [PATCH 069/131] fixup --- lib/internal/Magento/Framework/Message/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Message/Manager.php b/lib/internal/Magento/Framework/Message/Manager.php index 2b1b60bf76a..1138cf4f8f7 100644 --- a/lib/internal/Magento/Framework/Message/Manager.php +++ b/lib/internal/Magento/Framework/Message/Manager.php @@ -67,7 +67,7 @@ class Manager implements ManagerInterface * @param Event\ManagerInterface $eventManager * @param LoggerInterface $logger * @param string $defaultGroup - * @param ExceptionMessageFactoryInterface|null $exceptionMessageFactory exceptionMessageFactory + * @param ExceptionMessageFactoryInterface|null $exceptionMessageFactory */ public function __construct( Session $session, From d2dd7b39772a7c0a8a2cca2fea4925d033536a1a Mon Sep 17 00:00:00 2001 From: Sergii Ivashchenko <serg.ivashchenko@gmail.com> Date: Thu, 22 Nov 2018 21:24:58 +0200 Subject: [PATCH 070/131] Code style fixes --- .../Framework/Acl/Loader/ResourceLoader.php | 3 ++ lib/internal/Magento/Framework/Amqp/Queue.php | 10 ++-- .../CollectionProcessor/JoinProcessor.php | 3 ++ .../Framework/App/ResourceConnection.php | 1 + .../Magento/Framework/App/Utility/Classes.php | 3 ++ .../Magento/Framework/DataObject/Copy.php | 7 ++- .../Framework/Exception/BulkException.php | 4 ++ lib/internal/Magento/Framework/File/Mime.php | 3 ++ .../Magento/Framework/Logger/Handler/Base.php | 10 ++-- .../Framework/Logger/Handler/System.php | 3 ++ .../Magento/Framework/Message/Manager.php | 4 +- .../Magento/Framework/Model/AbstractModel.php | 8 +++- .../Framework/Module/Setup/Context.php | 18 ++++++++ .../Framework/ObjectManager/Profiler/Log.php | 4 +- .../Session/SaveHandler/Redis/Config.php | 46 +++++++++---------- 15 files changed, 85 insertions(+), 42 deletions(-) diff --git a/lib/internal/Magento/Framework/Acl/Loader/ResourceLoader.php b/lib/internal/Magento/Framework/Acl/Loader/ResourceLoader.php index afcd1d82bb8..af781e19d04 100644 --- a/lib/internal/Magento/Framework/Acl/Loader/ResourceLoader.php +++ b/lib/internal/Magento/Framework/Acl/Loader/ResourceLoader.php @@ -12,6 +12,9 @@ use Magento\Framework\Acl\AclResource\ProviderInterface; use Magento\Framework\Acl\AclResourceFactory; +/** + * ACL Loader + */ class ResourceLoader implements \Magento\Framework\Acl\LoaderInterface { /** diff --git a/lib/internal/Magento/Framework/Amqp/Queue.php b/lib/internal/Magento/Framework/Amqp/Queue.php index 0587d5a5927..ff5bae5017f 100644 --- a/lib/internal/Magento/Framework/Amqp/Queue.php +++ b/lib/internal/Magento/Framework/Amqp/Queue.php @@ -63,7 +63,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc * @since 100.0.0 */ public function dequeue() @@ -98,7 +98,7 @@ public function dequeue() } /** - * {@inheritdoc} + * @inheritdoc * @since 100.0.0 */ public function acknowledge(EnvelopeInterface $envelope) @@ -119,7 +119,7 @@ public function acknowledge(EnvelopeInterface $envelope) } /** - * {@inheritdoc} + * @inheritdoc * @since 100.0.0 */ public function subscribe($callback) @@ -153,7 +153,7 @@ public function subscribe($callback) } /** - * (@inheritdoc) + * @inheritdoc * @since 100.0.0 */ public function reject(EnvelopeInterface $envelope, $requeue = true, $rejectionMessage = null) @@ -172,7 +172,7 @@ public function reject(EnvelopeInterface $envelope, $requeue = true, $rejectionM } /** - * (@inheritdoc) + * @inheritdoc * @since 100.0.0 */ public function push(EnvelopeInterface $envelope) diff --git a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php index 34f16212c82..29029ab6efa 100644 --- a/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php +++ b/lib/internal/Magento/Framework/Api/SearchCriteria/CollectionProcessor/JoinProcessor.php @@ -10,6 +10,9 @@ use Magento\Framework\Api\SearchCriteriaInterface; use Magento\Framework\Data\Collection\AbstractDb; +/** + * Search criteria join processor + */ class JoinProcessor implements CollectionProcessorInterface { /** diff --git a/lib/internal/Magento/Framework/App/ResourceConnection.php b/lib/internal/Magento/Framework/App/ResourceConnection.php index 4652d2aaf6d..3dbe5f2db54 100644 --- a/lib/internal/Magento/Framework/App/ResourceConnection.php +++ b/lib/internal/Magento/Framework/App/ResourceConnection.php @@ -12,6 +12,7 @@ /** * Application provides ability to configure multiple connections to persistent storage. * This class provides access to all these connections. + * * @api */ class ResourceConnection diff --git a/lib/internal/Magento/Framework/App/Utility/Classes.php b/lib/internal/Magento/Framework/App/Utility/Classes.php index 289fc8fc8c8..3518264e1ab 100644 --- a/lib/internal/Magento/Framework/App/Utility/Classes.php +++ b/lib/internal/Magento/Framework/App/Utility/Classes.php @@ -9,6 +9,9 @@ use Magento\Framework\Component\ComponentRegistrar; +/** + * Utility for class names processing + */ class Classes { /** diff --git a/lib/internal/Magento/Framework/DataObject/Copy.php b/lib/internal/Magento/Framework/DataObject/Copy.php index f4e733feb0b..8d8896c6cb6 100644 --- a/lib/internal/Magento/Framework/DataObject/Copy.php +++ b/lib/internal/Magento/Framework/DataObject/Copy.php @@ -4,11 +4,11 @@ * See COPYING.txt for license details. */ +namespace Magento\Framework\DataObject; + /** * Utility class for copying data sets between objects */ -namespace Magento\Framework\DataObject; - class Copy { /** @@ -116,8 +116,7 @@ protected function dispatchCopyFieldSetEvent($fieldset, $aspect, $source, $targe } /** - * Get data from object|array to object|array containing fields - * from fieldset matching an aspect. + * Get data from object|array to object|array containing fields from fieldset matching an aspect. * * @param string $fieldset * @param string $aspect a field name diff --git a/lib/internal/Magento/Framework/Exception/BulkException.php b/lib/internal/Magento/Framework/Exception/BulkException.php index 9ee43bce2b9..168e910e0d3 100644 --- a/lib/internal/Magento/Framework/Exception/BulkException.php +++ b/lib/internal/Magento/Framework/Exception/BulkException.php @@ -39,6 +39,8 @@ public function __construct(Phrase $phrase = null, \Exception $cause = null, $co } /** + * Add data + * * @param array $data */ public function addData($data) @@ -47,6 +49,8 @@ public function addData($data) } /** + * Retrieve data + * * @return array */ public function getData() diff --git a/lib/internal/Magento/Framework/File/Mime.php b/lib/internal/Magento/Framework/File/Mime.php index f235d5765c7..9d768915868 100644 --- a/lib/internal/Magento/Framework/File/Mime.php +++ b/lib/internal/Magento/Framework/File/Mime.php @@ -6,6 +6,9 @@ namespace Magento\Framework\File; +/** + * Utility for mime type retrieval + */ class Mime { /** diff --git a/lib/internal/Magento/Framework/Logger/Handler/Base.php b/lib/internal/Magento/Framework/Logger/Handler/Base.php index 84109b7b263..5ae38101a7e 100644 --- a/lib/internal/Magento/Framework/Logger/Handler/Base.php +++ b/lib/internal/Magento/Framework/Logger/Handler/Base.php @@ -11,6 +11,9 @@ use Monolog\Handler\StreamHandler; use Monolog\Logger; +/** + * Base stream handler + */ class Base extends StreamHandler { /** @@ -32,6 +35,7 @@ class Base extends StreamHandler * @param DriverInterface $filesystem * @param string $filePath * @param string $fileName + * @throws \Exception */ public function __construct( DriverInterface $filesystem, @@ -71,11 +75,7 @@ private function sanitizeFileName($fileName) } /** - * {@inheritDoc} - * - * @param array $record - * - * @return void + * @inheritDoc */ public function write(array $record) { diff --git a/lib/internal/Magento/Framework/Logger/Handler/System.php b/lib/internal/Magento/Framework/Logger/Handler/System.php index f2de01d0745..c519e320a25 100644 --- a/lib/internal/Magento/Framework/Logger/Handler/System.php +++ b/lib/internal/Magento/Framework/Logger/Handler/System.php @@ -9,6 +9,9 @@ use Magento\Framework\Filesystem\DriverInterface; use Monolog\Logger; +/** + * System stream handler + */ class System extends Base { /** diff --git a/lib/internal/Magento/Framework/Message/Manager.php b/lib/internal/Magento/Framework/Message/Manager.php index 1138cf4f8f7..c3b5701057d 100644 --- a/lib/internal/Magento/Framework/Message/Manager.php +++ b/lib/internal/Magento/Framework/Message/Manager.php @@ -89,7 +89,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function getDefaultGroup() { @@ -110,8 +110,8 @@ protected function prepareGroup($group) /** * @inheritdoc * - * @param string|null $group * @param bool $clear + * @param string|null $group * @return Collection */ public function getMessages($clear = false, $group = null) diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index c1a597e1371..78275a81346 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -216,6 +216,8 @@ protected function _init($resourceModel) } /** + * Remove unneeded properties from serialization + * * @return string[] */ public function __sleep() @@ -337,8 +339,8 @@ public function hasDataChanges() * * If $key is an array, it will overwrite all the data in the object. * - * @param string|array $key - * @param mixed $value + * @param string|array $key + * @param mixed $value * @return $this */ public function setData($key, $value = null) @@ -616,6 +618,8 @@ protected function _hasModelChanged() } /** + * Check if save is allowed + * * @return bool */ public function isSaveAllowed() diff --git a/lib/internal/Magento/Framework/Module/Setup/Context.php b/lib/internal/Magento/Framework/Module/Setup/Context.php index 81dcb08e95c..4c6240e4c82 100644 --- a/lib/internal/Magento/Framework/Module/Setup/Context.php +++ b/lib/internal/Magento/Framework/Module/Setup/Context.php @@ -99,6 +99,8 @@ public function __construct( } /** + * Retrieve event manager + * * @return \Magento\Framework\Event\ManagerInterface */ public function getEventManager() @@ -107,6 +109,8 @@ public function getEventManager() } /** + * Retrieve logger + * * @return \Psr\Log\LoggerInterface */ public function getLogger() @@ -115,6 +119,8 @@ public function getLogger() } /** + * Retrieve module list + * * @return \Magento\Framework\Module\ModuleListInterface */ public function getModuleList() @@ -123,6 +129,8 @@ public function getModuleList() } /** + * Retrieve modules reader + * * @return \Magento\Framework\Module\Dir\Reader */ public function getModulesReader() @@ -131,6 +139,8 @@ public function getModulesReader() } /** + * Retrieve resource model + * * @return \Magento\Framework\App\ResourceConnection */ public function getResourceModel() @@ -139,6 +149,8 @@ public function getResourceModel() } /** + * Retrieve migration factory + * * @return \Magento\Framework\Module\Setup\MigrationFactory */ public function getMigrationFactory() @@ -147,6 +159,8 @@ public function getMigrationFactory() } /** + * Retrieve resource + * * @return \Magento\Framework\Module\ResourceInterface */ public function getResource() @@ -155,6 +169,8 @@ public function getResource() } /** + * Retrieve encryptor + * * @return \Magento\Framework\Encryption\EncryptorInterface */ public function getEncryptor() @@ -163,6 +179,8 @@ public function getEncryptor() } /** + * Retrieve filesystem + * * @return \Magento\Framework\Filesystem */ public function getFilesystem() diff --git a/lib/internal/Magento/Framework/ObjectManager/Profiler/Log.php b/lib/internal/Magento/Framework/ObjectManager/Profiler/Log.php index 79f014d8964..c1c1e7c1770 100644 --- a/lib/internal/Magento/Framework/ObjectManager/Profiler/Log.php +++ b/lib/internal/Magento/Framework/ObjectManager/Profiler/Log.php @@ -1,6 +1,5 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ @@ -8,6 +7,9 @@ use Magento\Framework\ObjectManager\Profiler\Tree\Item as Item; +/** + * Class Log + */ class Log { /** diff --git a/lib/internal/Magento/Framework/Session/SaveHandler/Redis/Config.php b/lib/internal/Magento/Framework/Session/SaveHandler/Redis/Config.php index a5eddb402a1..70b666f8a4e 100644 --- a/lib/internal/Magento/Framework/Session/SaveHandler/Redis/Config.php +++ b/lib/internal/Magento/Framework/Session/SaveHandler/Redis/Config.php @@ -173,7 +173,7 @@ public function __construct( } /** - * {@inheritdoc} + * @inheritdoc */ public function getLogLevel() { @@ -181,7 +181,7 @@ public function getLogLevel() } /** - * {@inheritdoc} + * @inheritdoc */ public function getHost() { @@ -189,7 +189,7 @@ public function getHost() } /** - * {@inheritdoc} + * @inheritdoc */ public function getPort() { @@ -197,7 +197,7 @@ public function getPort() } /** - * {@inheritdoc} + * @inheritdoc */ public function getDatabase() { @@ -205,7 +205,7 @@ public function getDatabase() } /** - * {@inheritdoc} + * @inheritdoc */ public function getPassword() { @@ -213,7 +213,7 @@ public function getPassword() } /** - * {@inheritdoc} + * @inheritdoc */ public function getTimeout() { @@ -221,7 +221,7 @@ public function getTimeout() } /** - * {@inheritdoc} + * @inheritdoc */ public function getPersistentIdentifier() { @@ -229,7 +229,7 @@ public function getPersistentIdentifier() } /** - * {@inheritdoc} + * @inheritdoc */ public function getCompressionThreshold() { @@ -237,7 +237,7 @@ public function getCompressionThreshold() } /** - * {@inheritdoc} + * @inheritdoc */ public function getCompressionLibrary() { @@ -245,7 +245,7 @@ public function getCompressionLibrary() } /** - * {@inheritdoc} + * @inheritdoc */ public function getMaxConcurrency() { @@ -253,7 +253,7 @@ public function getMaxConcurrency() } /** - * {@inheritdoc} + * @inheritdoc */ public function getMaxLifetime() { @@ -261,7 +261,7 @@ public function getMaxLifetime() } /** - * {@inheritdoc} + * @inheritdoc */ public function getMinLifetime() { @@ -269,7 +269,7 @@ public function getMinLifetime() } /** - * {@inheritdoc} + * @inheritdoc */ public function getDisableLocking() { @@ -277,7 +277,7 @@ public function getDisableLocking() } /** - * {@inheritdoc} + * @inheritdoc */ public function getBotLifetime() { @@ -285,7 +285,7 @@ public function getBotLifetime() } /** - * {@inheritdoc} + * @inheritdoc */ public function getBotFirstLifetime() { @@ -293,7 +293,7 @@ public function getBotFirstLifetime() } /** - * {@inheritdoc} + * @inheritdoc */ public function getFirstLifetime() { @@ -301,7 +301,7 @@ public function getFirstLifetime() } /** - * {@inheritdoc} + * @inheritdoc */ public function getBreakAfter() { @@ -309,7 +309,7 @@ public function getBreakAfter() } /** - * {@inheritdoc} + * @inheritdoc */ public function getLifetime() { @@ -320,7 +320,7 @@ public function getLifetime() } /** - * {@inheritdoc} + * @inheritdoc */ public function getSentinelServers() { @@ -328,7 +328,7 @@ public function getSentinelServers() } /** - * {@inheritdoc} + * @inheritdoc */ public function getSentinelMaster() { @@ -336,7 +336,7 @@ public function getSentinelMaster() } /** - * {@inheritdoc} + * @inheritdoc */ public function getSentinelVerifyMaster() { @@ -344,7 +344,7 @@ public function getSentinelVerifyMaster() } /** - * {@inheritdoc} + * @inheritdoc */ public function getSentinelConnectRetries() { @@ -352,7 +352,7 @@ public function getSentinelConnectRetries() } /** - * {@inheritdoc} + * @inheritdoc */ public function getFailAfter() { From 329c5900fe75878f38f37945b41f5c4e76974dc5 Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 23 Nov 2018 09:34:01 +0200 Subject: [PATCH 071/131] MAGETWO-96308: Configurable "As low As" Product Price Not Updating Correctly --- .../Catalog/view/base/web/js/price-box.js | 6 +- .../view/frontend/web/js/configurable.js | 65 ++++++++++++++++++- .../view/frontend/web/js/swatch-renderer.js | 45 ++++++++++++- 3 files changed, 112 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/view/base/web/js/price-box.js b/app/code/Magento/Catalog/view/base/web/js/price-box.js index 783d39cddbc..a179fe22028 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-box.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-box.js @@ -78,7 +78,11 @@ define([ pricesCode = [], priceValue, origin, finalPrice; - this.cache.additionalPriceObject = this.cache.additionalPriceObject || {}; + if (typeof newPrices !== 'undefined' && newPrices.hasOwnProperty("prices")) { + this.cache.additionalPriceObject = {}; + } else { + this.cache.additionalPriceObject = this.cache.additionalPriceObject || {}; + } if (newPrices) { $.extend(this.cache.additionalPriceObject, newPrices); diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js index 6b6c1762fad..ed735df1b29 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js +++ b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js @@ -477,7 +477,9 @@ define([ _getPrices: function () { var prices = {}, elements = _.toArray(this.options.settings), - hasProductPrice = false; + hasProductPrice = false, + optionPriceDiff = 0, + allowedProduct, optionPrices, basePrice, optionFinalPrice; _.each(elements, function (element) { var selected = element.options[element.selectedIndex], @@ -485,8 +487,22 @@ define([ priceValue = {}; if (config && config.allowedProducts.length === 1 && !hasProductPrice) { + prices = {}; priceValue = this._calculatePrice(config); hasProductPrice = true; + } else if (element.value) { + allowedProduct = this._getAllowedProductWithMinPrice(config.allowedProducts); + optionPrices = this.options.spConfig.optionPrices; + basePrice = parseFloat(this.options.spConfig.prices.basePrice.amount); + + if (!_.isEmpty(allowedProduct)) { + optionFinalPrice = parseFloat(optionPrices[allowedProduct].finalPrice.amount); + optionPriceDiff = optionFinalPrice - basePrice; + } + if (optionPriceDiff !== 0) { + prices = {}; + priceValue = this._calculatePriceDifference(allowedProduct); + } } prices[element.attributeId] = priceValue; @@ -495,6 +511,53 @@ define([ return prices; }, + /** + * Get product with minimum price from selected options. + * + * @param {Array} allowedProducts + * @returns {String} + * @private + */ + _getAllowedProductWithMinPrice: function (allowedProducts) { + var optionPrices = this.options.spConfig.optionPrices, + product = {}, + optionMinPrice, optionFinalPrice; + + _.each(allowedProducts, function (allowedProduct) { + optionFinalPrice = parseFloat(optionPrices[allowedProduct].finalPrice.amount); + + if (_.isEmpty(product)) { + optionMinPrice = optionFinalPrice; + product = allowedProduct; + } + if (optionFinalPrice < optionMinPrice) { + product = allowedProduct; + } + }, this); + + return product; + }, + + /** + * Calculate price difference for allowed product + * + * @param {*} allowedProduct - Product + * @returns {*} + * @private + */ + _calculatePriceDifference: function (allowedProduct) { + var displayPrices = $(this.options.priceHolderSelector).priceBox('option').prices, + newPrices = this.options.spConfig.optionPrices[allowedProduct]; + + _.each(displayPrices, function (price, code) { + if (newPrices[code]) { + displayPrices[code].amount = newPrices[code].amount - displayPrices[code].amount; + } + }); + + return displayPrices; + }, + /** * Returns prices for configured products * diff --git a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js index 63dbd31751e..5f5bdcb6aa2 100644 --- a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js @@ -968,10 +968,24 @@ define([ * @private */ _getPrices: function (newPrices, displayPrices) { - var $widget = this; + var $widget = this, + optionPriceDiff = 0, + allowedProduct, optionPrices, basePrice, optionFinalPrice; if (_.isEmpty(newPrices)) { - newPrices = $widget.options.jsonConfig.prices; + allowedProduct = this._getAllowedProductWithMinPrice(this._CalcProducts()); + optionPrices = this.options.jsonConfig.optionPrices; + basePrice = parseFloat(this.options.jsonConfig.prices.basePrice.amount); + + if (!_.isEmpty(allowedProduct)) { + optionFinalPrice = parseFloat(optionPrices[allowedProduct].finalPrice.amount); + optionPriceDiff = optionFinalPrice - basePrice; + } + if (optionPriceDiff !== 0) { + newPrices = this.options.jsonConfig.optionPrices[allowedProduct]; + } else { + newPrices = $widget.options.jsonConfig.prices; + } } _.each(displayPrices, function (price, code) { @@ -983,6 +997,33 @@ define([ return displayPrices; }, + /** + * Get product with minimum price from selected options. + * + * @param {Array} allowedProducts + * @returns {String} + * @private + */ + _getAllowedProductWithMinPrice: function (allowedProducts) { + var optionPrices = this.options.jsonConfig.optionPrices, + product = {}, + optionFinalPrice, optionMinPrice; + + _.each(allowedProducts, function (allowedProduct) { + optionFinalPrice = parseFloat(optionPrices[allowedProduct].finalPrice.amount); + + if (_.isEmpty(product)) { + optionMinPrice = optionFinalPrice; + product = allowedProduct; + } + if (optionFinalPrice < optionMinPrice) { + product = allowedProduct; + } + }, this); + + return product; + }, + /** * Gets all product media and change current to the needed one * From dc900b96054a4a318ee708e4d868bc0ac7e1aefd Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 23 Nov 2018 12:00:23 +0200 Subject: [PATCH 072/131] MAGETWO-96308: Configurable "As low As" Product Price Not Updating Correctly --- app/code/Magento/Catalog/view/base/web/js/price-box.js | 2 +- .../Magento/Swatches/view/frontend/web/js/swatch-renderer.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/view/base/web/js/price-box.js b/app/code/Magento/Catalog/view/base/web/js/price-box.js index a179fe22028..de68d769885 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-box.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-box.js @@ -78,7 +78,7 @@ define([ pricesCode = [], priceValue, origin, finalPrice; - if (typeof newPrices !== 'undefined' && newPrices.hasOwnProperty("prices")) { + if (typeof newPrices !== 'undefined' && newPrices.hasOwnProperty('prices')) { this.cache.additionalPriceObject = {}; } else { this.cache.additionalPriceObject = this.cache.additionalPriceObject || {}; diff --git a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js index 5f5bdcb6aa2..19eb532d564 100644 --- a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js @@ -976,7 +976,6 @@ define([ allowedProduct = this._getAllowedProductWithMinPrice(this._CalcProducts()); optionPrices = this.options.jsonConfig.optionPrices; basePrice = parseFloat(this.options.jsonConfig.prices.basePrice.amount); - if (!_.isEmpty(allowedProduct)) { optionFinalPrice = parseFloat(optionPrices[allowedProduct].finalPrice.amount); optionPriceDiff = optionFinalPrice - basePrice; From c7ac6a063cb0cdca45bab973fe99609bd60f350b Mon Sep 17 00:00:00 2001 From: Sergii Ivashchenko <serg.ivashchenko@gmail.com> Date: Fri, 23 Nov 2018 13:08:45 +0200 Subject: [PATCH 073/131] Code style fixes --- lib/internal/Magento/Framework/App/ResourceConnection.php | 1 + lib/internal/Magento/Framework/File/Mime.php | 1 + lib/internal/Magento/Framework/Logger/Handler/Base.php | 3 ++- lib/internal/Magento/Framework/Model/AbstractModel.php | 5 +++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/App/ResourceConnection.php b/lib/internal/Magento/Framework/App/ResourceConnection.php index 3dbe5f2db54..b543cc970f6 100644 --- a/lib/internal/Magento/Framework/App/ResourceConnection.php +++ b/lib/internal/Magento/Framework/App/ResourceConnection.php @@ -11,6 +11,7 @@ /** * Application provides ability to configure multiple connections to persistent storage. + * * This class provides access to all these connections. * * @api diff --git a/lib/internal/Magento/Framework/File/Mime.php b/lib/internal/Magento/Framework/File/Mime.php index 9d768915868..ed370b1beae 100644 --- a/lib/internal/Magento/Framework/File/Mime.php +++ b/lib/internal/Magento/Framework/File/Mime.php @@ -109,6 +109,7 @@ public function getMimeType($file) /** * Get mime type by the native mime_content_type function. + * * Search for extended mime type if mime_content_type() returned 'application/octet-stream' or 'text/plain' * * @param string $file diff --git a/lib/internal/Magento/Framework/Logger/Handler/Base.php b/lib/internal/Magento/Framework/Logger/Handler/Base.php index 5ae38101a7e..4c136fd65a5 100644 --- a/lib/internal/Magento/Framework/Logger/Handler/Base.php +++ b/lib/internal/Magento/Framework/Logger/Handler/Base.php @@ -55,8 +55,9 @@ public function __construct( } /** - * @param string $fileName + * Remove dots from file name * + * @param string $fileName * @return string * @throws \InvalidArgumentException */ diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index 78275a81346..1c3e67281c1 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -628,6 +628,8 @@ public function isSaveAllowed() } /** + * Set flag property _hasDataChanges + * * @param bool $flag * @return void */ @@ -723,6 +725,7 @@ public function validateBeforeSave() /** * Returns validator, which contains all rules to validate this model. + * * Returns FALSE, if no validation rules exist. * * @return \Zend_Validate_Interface|false @@ -737,6 +740,7 @@ protected function _getValidatorBeforeSave() /** * Creates validator for the model with all validation rules in it. + * * Returns FALSE, if no validation rules exist. * * @return \Zend_Validate_Interface|bool @@ -774,6 +778,7 @@ protected function _getValidationRulesBeforeSave() /** * Get list of cache tags applied to model object. + * * Return false if cache tags are not supported by model * * @return array|false From 1a1081095721c7332ae2b7e65800c7139109038f Mon Sep 17 00:00:00 2001 From: "rostyslav.hymon" <rostyslav.hymon@transoftgroup.com> Date: Fri, 23 Nov 2018 14:17:15 +0200 Subject: [PATCH 074/131] MAGETWO-96308: Configurable "As low As" Product Price Not Updating Correctly --- .../ConfigurableProduct/view/frontend/web/js/configurable.js | 3 +++ .../Magento/Swatches/view/frontend/web/js/swatch-renderer.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js index ed735df1b29..78974877dd9 100644 --- a/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js +++ b/app/code/Magento/ConfigurableProduct/view/frontend/web/js/configurable.js @@ -499,6 +499,7 @@ define([ optionFinalPrice = parseFloat(optionPrices[allowedProduct].finalPrice.amount); optionPriceDiff = optionFinalPrice - basePrice; } + if (optionPriceDiff !== 0) { prices = {}; priceValue = this._calculatePriceDifference(allowedProduct); @@ -530,6 +531,7 @@ define([ optionMinPrice = optionFinalPrice; product = allowedProduct; } + if (optionFinalPrice < optionMinPrice) { product = allowedProduct; } @@ -550,6 +552,7 @@ define([ newPrices = this.options.spConfig.optionPrices[allowedProduct]; _.each(displayPrices, function (price, code) { + if (newPrices[code]) { displayPrices[code].amount = newPrices[code].amount - displayPrices[code].amount; } diff --git a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js index 19eb532d564..d942fd7766a 100644 --- a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js @@ -976,10 +976,12 @@ define([ allowedProduct = this._getAllowedProductWithMinPrice(this._CalcProducts()); optionPrices = this.options.jsonConfig.optionPrices; basePrice = parseFloat(this.options.jsonConfig.prices.basePrice.amount); + if (!_.isEmpty(allowedProduct)) { optionFinalPrice = parseFloat(optionPrices[allowedProduct].finalPrice.amount); optionPriceDiff = optionFinalPrice - basePrice; } + if (optionPriceDiff !== 0) { newPrices = this.options.jsonConfig.optionPrices[allowedProduct]; } else { @@ -988,6 +990,7 @@ define([ } _.each(displayPrices, function (price, code) { + if (newPrices[code]) { displayPrices[code].amount = newPrices[code].amount - displayPrices[code].amount; } @@ -1015,6 +1018,7 @@ define([ optionMinPrice = optionFinalPrice; product = allowedProduct; } + if (optionFinalPrice < optionMinPrice) { product = allowedProduct; } From e12ebf1ddcb0c568986d1dff881ce50e13995068 Mon Sep 17 00:00:00 2001 From: Joel Rainwater <joel.rain2o@gmail.com> Date: Fri, 23 Nov 2018 17:45:49 +0100 Subject: [PATCH 075/131] Added integration tests for multiselect source model indexing --- .../Product/Indexer/Eav/SourceTest.php | 47 ++++++++++++++++ .../Catalog/_files/MultiselectSourceMock.php | 25 +++++++++ ...ultiselect_attribute_with_source_model.php | 46 +++++++++++++++ ...t_attribute_with_source_model_rollback.php | 18 ++++++ ...ultiselect_attribute_with_source_model.php | 56 +++++++++++++++++++ ...t_attribute_with_source_model_rollback.php | 32 +++++++++++ 6 files changed, 224 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/MultiselectSourceMock.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_source_model.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_source_model_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_with_source_model.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_with_source_model_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/SourceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/SourceTest.php index 4280e9dc891..5cf6d00fe77 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/SourceTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/SourceTest.php @@ -8,6 +8,7 @@ use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product\Attribute\Source\Status; use Magento\TestFramework\Helper\Bootstrap; +use Magento\Catalog\_files\MultiselectSourceMock; /** * Class SourceTest @@ -157,4 +158,50 @@ public function testReindexMultiselectAttribute() $result = $connection->fetchAll($select); $this->assertCount(3, $result); } + + /** + * @magentoDataFixture Magento/Catalog/_files/products_with_multiselect_attribute_with_source_model.php + * @magentoDbIsolation disabled + */ + public function testReindexMultiselectAttributeWithSourceModel() + { + $objectManager = Bootstrap::getObjectManager(); + + /** @var ProductRepositoryInterface $productRepository */ + $productRepository = $objectManager->create(ProductRepositoryInterface::class); + + /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attr **/ + $attr = $objectManager->get(\Magento\Eav\Model\Config::class) + ->getAttribute('catalog_product', 'multiselect_attr_with_source'); + + /** @var $sourceModel MultiselectSourceMock */ + $sourceModel = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + MultiselectSourceMock::class + ); + $options = $sourceModel->getAllOptions(); + $product1Id = $options[0]['value'] * 10; + $product2Id = $options[1]['value'] * 10; + + /** @var \Magento\Catalog\Model\Product $product1 **/ + $product1 = $productRepository->getById($product1Id); + $product1->setSpecialFromDate(date('Y-m-d H:i:s')); + $product1->setNewsFromDate(date('Y-m-d H:i:s')); + $productRepository->save($product1); + + /** @var \Magento\Catalog\Model\Product $product2 **/ + $product2 = $productRepository->getById($product2Id); + $product1->setSpecialFromDate(date('Y-m-d H:i:s')); + $product1->setNewsFromDate(date('Y-m-d H:i:s')); + $productRepository->save($product2); + + $this->_eavIndexerProcessor->reindexAll(); + $connection = $this->productResource->getConnection(); + $select = $connection->select() + ->from($this->productResource->getTable('catalog_product_index_eav')) + ->where('entity_id in (?)', [$product1Id, $product2Id]) + ->where('attribute_id = ?', $attr->getId()); + + $result = $connection->fetchAll($select); + $this->assertCount(3, $result); + } } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/MultiselectSourceMock.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/MultiselectSourceMock.php new file mode 100644 index 00000000000..b9325622d89 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/MultiselectSourceMock.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Catalog\_files; + +use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource; + +/** + * Creates mock source for multiselect attributes + */ +class MultiselectSourceMock extends AbstractSource +{ + + public function getAllOptions() + { + return [ + ['value' => 1, 'label' => 'Option 1'], + ['value' => 2, 'label' => 'Option 2'], + ['value' => 3, 'label' => 'Option 3'], + ['value' => 4, 'label' => 'Option 4 "!@#$%^&*'], + ]; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_source_model.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_source_model.php new file mode 100644 index 00000000000..6dcba90bf44 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_source_model.php @@ -0,0 +1,46 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +/* Create attribute */ +/** @var $installer \Magento\Catalog\Setup\CategorySetup */ +$installer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Setup\CategorySetup::class +); +/** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */ +$attribute = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Model\ResourceModel\Eav\Attribute::class +); +$entityType = $installer->getEntityTypeId('catalog_product'); +if (!$attribute->loadByCode($entityType, 'multiselect_attr_with_source')->getAttributeId()) { + $attribute->setData( + [ + 'attribute_code' => 'multiselect_attr_with_source', + 'entity_type_id' => $entityType, + 'is_global' => 1, + 'is_user_defined' => 1, + 'frontend_input' => 'multiselect', + 'is_unique' => 0, + 'is_required' => 0, + 'is_searchable' => 0, + 'is_visible_in_advanced_search' => 0, + 'is_comparable' => 0, + 'is_filterable' => 1, + 'is_filterable_in_search' => 0, + 'is_used_for_promo_rules' => 0, + 'is_html_allowed_on_front' => 1, + 'is_visible_on_front' => 0, + 'used_in_product_listing' => 0, + 'used_for_sort_by' => 0, + 'frontend_label' => ['Multiselect Attribute with Source Model'], + 'backend_type' => 'varchar', + 'backend_model' => \Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend::class, + 'source_model' => \Magento\Catalog\_files\MultiselectSourceMock::class + ] + ); + $attribute->save(); + + /* Assign attribute to attribute set */ + $installer->addAttributeToGroup('catalog_product', 'Default', 'General', $attribute->getId()); +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_source_model_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_source_model_rollback.php new file mode 100644 index 00000000000..9859e1ab4c7 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiselect_attribute_with_source_model_rollback.php @@ -0,0 +1,18 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +/* Delete attribute with multiselect_attribute code */ +$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\Registry'); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); +/** @var $attribute \Magento\Catalog\Model\ResourceModel\Eav\Attribute */ +$attribute = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + 'Magento\Catalog\Model\ResourceModel\Eav\Attribute' +); +$attribute->load('multiselect_attr_with_source', 'attribute_code'); +$attribute->delete(); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_with_source_model.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_with_source_model.php new file mode 100644 index 00000000000..a1e81fd3b40 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_with_source_model.php @@ -0,0 +1,56 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +use Magento\Catalog\_files\MultiselectSourceMock; + +/** + * Create multiselect attribute + */ +require __DIR__ . '/multiselect_attribute_with_source_model.php'; +require __DIR__ . '/../../Checkout/_files/ValidatorFileMock.php'; + +/** Create product with options and multiselect attribute */ + +/** @var $installer \Magento\Catalog\Setup\CategorySetup */ +$installer = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + \Magento\Catalog\Setup\CategorySetup::class +); + +/** @var $sourceModel MultiselectSourceMock */ +$sourceModel = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( + MultiselectSourceMock::class +); +$options = $sourceModel->getAllOptions(); + +/** @var $product \Magento\Catalog\Model\Product */ +$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class); +$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) + ->setId($options[0]['value'] * 10) + ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default')) + ->setWebsiteIds([1]) + ->setName('With Multiselect Source Model 1') + ->setSku('simple_mssm_1') + ->setPrice(10) + ->setDescription('Hello " &" Bring the water bottle when you can!') + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setMultiselectAttrWithSource([$options[0]['value']]) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->save(); + +$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class); +$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE) + ->setId($options[1]['value'] * 10) + ->setAttributeSetId($installer->getAttributeSetId('catalog_product', 'Default')) + ->setWebsiteIds([1]) + ->setName('With Multiselect Source Model 2') + ->setSku('simple_mssm_2') + ->setPrice(10) + ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH) + ->setMultiselectAttrWithSource([$options[1]['value'], $options[2]['value'], $options[3]['value']]) + ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) + ->setStockData(['use_config_manage_stock' => 1, 'qty' => 100, 'is_qty_decimal' => 0, 'is_in_stock' => 1]) + ->save(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_with_source_model_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_with_source_model_rollback.php new file mode 100644 index 00000000000..a8121a7913e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_with_multiselect_attribute_with_source_model_rollback.php @@ -0,0 +1,32 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + +require __DIR__ . '/multiselect_attribute_with_source_model_rollback.php'; + +use Magento\Framework\Indexer\IndexerRegistry; + +/** + * Remove all products as strategy of isolation process + */ +$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\Registry'); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +/** @var $productCollection \Magento\Catalog\Model\ResourceModel\Product */ +$productCollection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Catalog\Model\Product') + ->getCollection(); + +foreach ($productCollection as $product) { + $product->delete(); +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); + +\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(IndexerRegistry::class) + ->get(Magento\CatalogInventory\Model\Indexer\Stock\Processor::INDEXER_ID) + ->reindexAll(); From 8daff66d9c4f750bd31ee7d0cc7570699ad9aeab Mon Sep 17 00:00:00 2001 From: Joel Rainwater <joel.rain2o@gmail.com> Date: Fri, 23 Nov 2018 17:46:49 +0100 Subject: [PATCH 076/131] moved new parameters to end of list and made them optional --- .../Product/Indexer/Eav/Source.php | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php index b7489bff18a..7730d7cc9a7 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php @@ -43,9 +43,9 @@ class Source extends AbstractEav * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Framework\Event\ManagerInterface $eventManager * @param \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper - * @param \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository - * @param \Magento\Framework\Api\SearchCriteriaBuilder $criteriaBuilder * @param null|string $connectionName + * @param \Magento\Eav\Api\AttributeRepositoryInterface|null $attributeRepository + * @param \Magento\Framework\Api\SearchCriteriaBuilder|null $criteriaBuilder */ public function __construct( \Magento\Framework\Model\ResourceModel\Db\Context $context, @@ -53,9 +53,9 @@ public function __construct( \Magento\Eav\Model\Config $eavConfig, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\ResourceModel\Helper $resourceHelper, - \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository, - \Magento\Framework\Api\SearchCriteriaBuilder $criteriaBuilder, - $connectionName = null + $connectionName = null, + \Magento\Eav\Api\AttributeRepositoryInterface $attributeRepository = null, + \Magento\Framework\Api\SearchCriteriaBuilder $criteriaBuilder = null ) { parent::__construct( $context, @@ -65,8 +65,12 @@ public function __construct( $connectionName ); $this->_resourceHelper = $resourceHelper; - $this->attributeRepository = $attributeRepository; - $this->criteriaBuilder = $criteriaBuilder; + $this->attributeRepository = $attributeRepository + ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Eav\Api\AttributeRepositoryInterface::class); + $this->criteriaBuilder = $criteriaBuilder + ?: \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Framework\Api\SearchCriteriaBuilder::class); } /** @@ -251,8 +255,9 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu $options[$row['attribute_id']][$row['option_id']] = true; } - // Include custom source model options - $options = $this->getMultiSelectAttributeWithSourceModels($attrIds, $options); + // Retrieve any custom source model options + $sourceModelOptions = $this->getMultiSelectAttributeWithSourceModels($attrIds); + $options = array_replace_recursive($options, $sourceModelOptions); // prepare get multiselect values query $productValueExpression = $connection->getCheckSql('pvs.value_id > 0', 'pvs.value', 'pvd.value'); @@ -323,11 +328,10 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu * https://github.com/magento/magento2/issues/417#issuecomment-265146285 * * @param array $attrIds - * @param array $options * * @return array */ - private function getMultiSelectAttributeWithSourceModels($attrIds, $options) + private function getMultiSelectAttributeWithSourceModels($attrIds) { // Add options from custom source models $this->criteriaBuilder @@ -339,11 +343,12 @@ private function getMultiSelectAttributeWithSourceModels($attrIds, $options) $criteria )->getItems(); + $options = []; foreach ($attributes as $attribute) { $sourceModelOptions = $attribute->getOptions(); // Add options to list used below - foreach ($sourceModelOptions as $o) { - $options[$attribute->getAttributeId()][$o->getValue()] = true; + foreach ($sourceModelOptions as $option) { + $options[$attribute->getAttributeId()][$option->getValue()] = true; } } From 4bf3aa79f5bfd68142fb304bad3ff3d0f2551c06 Mon Sep 17 00:00:00 2001 From: Tiago Sampaio <tiago@tiagosampaio.com> Date: Fri, 23 Nov 2018 15:45:12 -0200 Subject: [PATCH 077/131] Fixing a test for Magento Newsletter. --- app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php b/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php index 889fc11d71d..1de3e6096cd 100644 --- a/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php +++ b/app/code/Magento/Newsletter/Test/Unit/Model/ProblemTest.php @@ -68,6 +68,7 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); $this->subscriberFactoryMock = $this->getMockBuilder(SubscriberFactory::class) + ->disableOriginalConstructor() ->getMock(); $this->subscriberMock = $this->getMockBuilder(Subscriber::class) ->disableOriginalConstructor() From 7ef0c2c827588867d76ae3b981d9ae578303b105 Mon Sep 17 00:00:00 2001 From: Kajal Solanki <kajal.solanki@krishtechnolabs.com> Date: Mon, 26 Nov 2018 14:15:30 +0530 Subject: [PATCH 078/131] fix-issue-19399 into 2.3-develop branch --- .../source/module/main/_collapsible-blocks.less | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 6420738c6fb..a3124affffc 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 @@ -127,6 +127,21 @@ } } } + + td.admin__collapsible-block-wrapper { + .admin__collapsible-title { + &:before { + content: @icon-expand-open__content; + } + } + &._show { + .admin__collapsible-title { + &:before { + content: @icon-expand-close__content; + } + } + } + } } &.fieldset-wrapper { From bb946c446d64ceb447e5bdf3dd2b9611bb05a7ec Mon Sep 17 00:00:00 2001 From: David Manners <dmanners87@gmail.com> Date: Mon, 26 Nov 2018 11:34:39 +0000 Subject: [PATCH 079/131] magento-engcom/import-export-improvements#135: update storage class from phpcs tests --- .../Model/ResourceModel/Import/Customer/Storage.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php index 1046afeebbf..43623019c00 100644 --- a/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php +++ b/app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Customer/Storage.php @@ -13,6 +13,9 @@ use Magento\ImportExport\Model\ResourceModel\CollectionByPagesIteratorFactory; use Magento\ImportExport\Model\ResourceModel\CollectionByPagesIterator; +/** + * Storage to check existing customers. + */ class Storage { /** @@ -117,6 +120,8 @@ private function loadCustomersData(array $customerIdentifiers) } /** + * Add a customer by an array + * * @param array $customer * @return $this */ From 56be425e5f9f3f963042b48a7347f69130b50497 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Mon, 26 Nov 2018 10:24:12 -0600 Subject: [PATCH 080/131] MC-5319: Create tax rate, zip code range. Addressing code review comments. --- .../Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml | 2 -- .../Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml index 61999f3e2ea..057223f4fc5 100644 --- a/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml +++ b/app/code/Magento/Tax/Test/Mftf/Section/AdminTaxRateGridSection.xml @@ -16,7 +16,5 @@ <element name="filterByCountry" type="input" selector="#tax_rate_grid_filter_tax_country_id"/> <element name="filterByPostCode" type="input" selector="#tax_rate_grid_filter_tax_postcode"/> <element name="nthRow" type="block" selector="tr[data-role='row']:nth-of-type({{var}})" parameterized="true" timeout="30"/> - <element name="country" type="select" selector="#tax_rate_grid_filter_tax_country_id"/> - <element name="zipCode" type="text" selector="#tax_rate_grid_filter_tax_postcode"/> </section> </sections> \ No newline at end of file diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml index c4abd856354..7114e821c32 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml @@ -50,8 +50,8 @@ <!-- Create a tax rate for zipCodeRange and verify we see expected values on the tax rate grid page --> <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> - <selectOption selector="{{AdminTaxRateGridSection.country}}" userInput="United States" stepKey="selectCountry2" /> - <fillField selector="{{AdminTaxRateGridSection.zipCode}}" userInput="90001-96162" stepKey="seeTaxPostCode1"/> + <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="United States" stepKey="selectCountry2" /> + <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="90001-96162" stepKey="seeTaxPostCode1"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow3"/> <!-- Verify we see expected values on the tax rate form page --> From aa4fb0b8f409bde44777136e2b4e3749ca01eb11 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Mon, 26 Nov 2018 13:58:48 -0600 Subject: [PATCH 081/131] MC-5320: Create tax rate, specific postcode --- .../AdminCreateTaxRateSpecificPostcode.xml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcode.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcode.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcode.xml new file mode 100644 index 00000000000..cb6f852a764 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcode.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCreateTaxRateSpecificPostcode"> + <annotations> + <stories value="Create tax rate"/> + <title value="Create tax rate,specific postcode"/> + <description value="Test log in to Create Tax Rate and Create specific Postcode"/> + <testCaseId value="MC-5320"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + <click selector="{{AdminTaxRateFormSection.deleteRate}}" stepKey="clickDeleteRate"/> + <click selector="{{AdminTaxRateFormSection.ok}}" stepKey="clickOk"/> + </after> + + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddNewTaxRateButton"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + <!-- Create a tax rate with specific postcode --> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField1"/> + <fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="180" stepKey="fillTaxPostCode"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="Canada" stepKey="selectCountry" /> + <selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="*" stepKey="selectState" /> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput='25' stepKey="seeRate"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/> + <waitForPageLoad stepKey="waitForTaxRateIndex2"/> + <!-- Verify the tax rate grid page shows the specific postcode we just created --> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="Canada" stepKey="fillCountryFilter"/> + <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="180" stepKey="fillPostCodeFilter"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> + <!-- Verify we see expected values on the tax rate form page --> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxIdentifierField2"/> + <seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="180" stepKey="seePostCode"/> + <seeInField selector="{{AdminTaxRateFormSection.country}}" userInput="Canada" stepKey="seeCountry2"/> + + <!-- Verify we see expected values on the tax rule form page --> + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex4"/> + <click selector="{{AdminTaxRuleGridSection.add}}" stepKey="clickAdd"/> + <see selector="{{AdminTaxRulesSection.taxRateMultiSelectItems}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxRateOnNewTaxRulePage"/> + </test> +</tests> From df77a398683ca1f37af85d7241db1d3532c30844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= <karlasaaremae@gmail.com> Date: Mon, 26 Nov 2018 23:09:49 +0200 Subject: [PATCH 082/131] remove lib-url-check(); function was removed as this function does not exist anymore --- lib/web/css/docs/source/_utilities.less | 63 ------------------------- 1 file changed, 63 deletions(-) diff --git a/lib/web/css/docs/source/_utilities.less b/lib/web/css/docs/source/_utilities.less index 312eeffe488..1ce15a9a50e 100644 --- a/lib/web/css/docs/source/_utilities.less +++ b/lib/web/css/docs/source/_utilities.less @@ -367,66 +367,3 @@ // </tr> // </table> // </pre> - -// # .lib-url-check() -// -// The <code>.lib-url-check()</code> mixin wraps passed value with 'url( ... )' and returns <code>@lib-url-check-output</code> variable. Can be used with <code>.lib-css()</code> mixin. -// - -.example-url-check { - // Set image path variable - @_icon-image: '/images/test.png'; - - // "Call" the mixin - .lib-url-check(@_icon-image); - - // Will return url('/images/test.png') - .lib-css(background, #eee @lib-url-check-output no-repeat 0 0); -} - -// -// If the variable is set to <code>false</code>, the <code>.lib-url-check()</code> will return false. -// -// ``` -// <div class="example-url-check"> -// Block with background. -// </div> -// ``` -// - -.example-url-check-false { - // Set usage image path to false - @_icon-image: false; - - // "Call" the mixin - .lib-url-check(@_icon-image); - - // Will return 'false' and outputs nothing - .lib-css(background, #eee @lib-url-check-output no-repeat 0 0); -} - -// ``` -// <div class="example-url-check-false"> -// Block with no background. -// </div> -// ``` -// - -// # .lib-url-check() variables -// -// <pre> -// <table> -// <tr> -// <th class="vars_head">Mixin variable</th> -// <th class="vars_head">Allowed values</th> -// <th class="vars_head">Output variable</th> -// <th class="vars_head">Comment</th> -// </tr> -// <tr> -// <th>@_path</th> -// <td class="vars_value">'' | false | value</td> -// <td class="vars_value">@lib-url-check-output</td> -// <td>Passed url to wrap in 'url( ... )'. If the 'false' value passed mixin will return 'false'</td> -// </tr> -// </table> -// </pre> From ca55821d94f9f4b34acc1878f0b9d7cc9a768c27 Mon Sep 17 00:00:00 2001 From: dharmesh vaja <dharmesh.vaja@rocketbazaar.com> Date: Tue, 27 Nov 2018 12:28:49 +0530 Subject: [PATCH 083/131] 19404-Fixed-News-latter-issue --- .../Magento/Newsletter/Controller/Subscriber/NewAction.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php b/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php index fd2a61702e9..1a3a2445ce9 100644 --- a/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php +++ b/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php @@ -151,10 +151,7 @@ public function execute() $status = (int) $this->_subscriberFactory->create()->subscribe($email); $this->messageManager->addSuccessMessage($this->getSuccessMessage($status)); } catch (LocalizedException $e) { - $this->messageManager->addExceptionMessage( - $e, - __('There was a problem with the subscription: %1', $e->getMessage()) - ); + $this->messageManager->addErrorMessage(__('This email address is already subscribed.')); } catch (\Exception $e) { $this->messageManager->addExceptionMessage($e, __('Something went wrong with the subscription.')); } From 46b34797d20072e34e0cc87adcbc2cc36d49f281 Mon Sep 17 00:00:00 2001 From: dharmesh vaja <dharmesh.vaja@rocketbazaar.com> Date: Tue, 27 Nov 2018 15:09:31 +0530 Subject: [PATCH 084/131] 19404-Fixed-News-latter-issue --- app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php b/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php index 1a3a2445ce9..0ed09445796 100644 --- a/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php +++ b/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php @@ -151,7 +151,7 @@ public function execute() $status = (int) $this->_subscriberFactory->create()->subscribe($email); $this->messageManager->addSuccessMessage($this->getSuccessMessage($status)); } catch (LocalizedException $e) { - $this->messageManager->addErrorMessage(__('This email address is already subscribed.')); + $this->messageManager->addErrorMessage($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addExceptionMessage($e, __('Something went wrong with the subscription.')); } From 5937d865c4d6f358ac6ff66cc6217275f293e416 Mon Sep 17 00:00:00 2001 From: Vasilii Burlacu <v.burlacu@atwix.com> Date: Tue, 27 Nov 2018 13:26:21 +0200 Subject: [PATCH 085/131] magento/magento2:#19418 Cannot add additional field to Newsletter system configuration at desired position - Adjusted Newsletter system configuration fields sortOrder so they has a step of 10 --- .../Newsletter/etc/adminhtml/system.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/code/Magento/Newsletter/etc/adminhtml/system.xml b/app/code/Magento/Newsletter/etc/adminhtml/system.xml index 1173f643103..277005240ea 100644 --- a/app/code/Magento/Newsletter/etc/adminhtml/system.xml +++ b/app/code/Magento/Newsletter/etc/adminhtml/system.xml @@ -11,39 +11,39 @@ <label>Newsletter</label> <tab>customer</tab> <resource>Magento_Newsletter::newsletter</resource> - <group id="subscription" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1"> + <group id="subscription" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> <label>Subscription Options</label> - <field id="allow_guest_subscribe" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> + <field id="allow_guest_subscribe" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Allow Guest Subscription</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> </field> - <field id="confirm" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> + <field id="confirm" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Need to Confirm</label> <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> </field> - <field id="confirm_email_identity" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> + <field id="confirm_email_identity" translate="label" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Confirmation Email Sender</label> <source_model>Magento\Config\Model\Config\Source\Email\Identity</source_model> </field> - <field id="confirm_email_template" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> + <field id="confirm_email_template" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Confirmation Email Template</label> <comment>Email template chosen based on theme fallback when "Default" option is selected.</comment> <source_model>Magento\Config\Model\Config\Source\Email\Template</source_model> </field> - <field id="success_email_identity" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> + <field id="success_email_identity" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Success Email Sender</label> <source_model>Magento\Config\Model\Config\Source\Email\Identity</source_model> </field> - <field id="success_email_template" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> + <field id="success_email_template" translate="label comment" type="select" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Success Email Template</label> <comment>Email template chosen based on theme fallback when "Default" option is selected.</comment> <source_model>Magento\Config\Model\Config\Source\Email\Template</source_model> </field> - <field id="un_email_identity" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> + <field id="un_email_identity" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Unsubscription Email Sender</label> <source_model>Magento\Config\Model\Config\Source\Email\Identity</source_model> </field> - <field id="un_email_template" translate="label comment" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> + <field id="un_email_template" translate="label comment" type="select" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1"> <label>Unsubscription Email Template</label> <comment>Email template chosen based on theme fallback when "Default" option is selected.</comment> <source_model>Magento\Config\Model\Config\Source\Email\Template</source_model> From 4fa45ee22579149d4688319cf2dcde0c8d651e8f Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Tue, 27 Nov 2018 08:44:00 -0600 Subject: [PATCH 086/131] MC-5321: Create tax rate, wider zip code range --- .../AdminCreateTaxRateWiderZipCodeRange.xml | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml new file mode 100644 index 00000000000..ba65ea43a6a --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCreateTaxRateWiderZipCodeRange"> + <annotations> + <stories value="Create tax rate, wider zip code range"/> + <title value="Create Tax Rate"/> + <description value="Test log in to Create Tax Rate and Create Wider Zip Code Range"/> + <testCaseId value="MC-5321"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + <click selector="{{AdminTaxRateFormSection.deleteRate}}" stepKey="clickDeleteRate"/> + <click selector="{{AdminTaxRateFormSection.ok}}" stepKey="clickOk"/> + </after> + + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + <!-- Create a tax rate with range from 1-7800935 for zipCodes --> + <click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddNewTaxRateButton"/> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillRuleName"/> + <checkOption selector="{{AdminTaxRateFormSection.zipRange}}" stepKey="checkZipRange" /> + <fillField selector="{{AdminTaxRateFormSection.rangeFrom}}" userInput="1" stepKey="fillZipFrom"/> + <fillField selector="{{AdminTaxRateFormSection.rangeTo}}" userInput="7800935" stepKey="fillZipTo"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="United Kingdom" stepKey="selectCountry1"/> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="7.75" stepKey="seeRate"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/> + <waitForPageLoad stepKey="waitForTaxRateIndex3"/> + <!-- Create a tax rate for zipCodeRange and verify we see expected values on the tax rate grid page --> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="United Kingdom" stepKey="selectCountry2" /> + <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="1-7800935" stepKey="seeTaxPostCode1"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> + <!-- Verify we see expected values on the tax rate form page --> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxIdentifierField2"/> + <seeCheckboxIsChecked selector="{{AdminTaxRateFormSection.zipRange}}" stepKey="clickZipRange"/> + <seeInField selector="{{AdminTaxRateFormSection.rangeFrom}}" userInput="1" stepKey="seeTaxPostCode2"/> + <seeInField selector="{{AdminTaxRateFormSection.rangeTo}}" userInput="7800935" stepKey="seeTaxPostCode3"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="United Kingdom" stepKey="seeCountry2"/> + + <!-- Verify we see expected values on the tax rule form page --> + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex4"/> + <click selector="{{AdminTaxRuleGridSection.add}}" stepKey="clickAdd"/> + <see selector="{{AdminTaxRulesSection.taxRateMultiSelectItems}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxRateOnNewTaxRulePage"/> + </test> +</tests> From d42b74d2b8175283733626bf41c2c139cb223f4c Mon Sep 17 00:00:00 2001 From: Mastiuhin Olexandr <mastiuhin.olexandr@transoftgroup.com> Date: Tue, 27 Nov 2018 17:07:44 +0200 Subject: [PATCH 087/131] MAGETWO-95838: Custom product attribute does not update when using Catalog Product Flat tables --- .../Indexer/Product/Flat/Action/Eraser.php | 5 +- .../Indexer/Product/Flat/Action/Indexer.php | 35 +++---- .../Model/Indexer/Product/Flat/Action/Row.php | 12 ++- .../Product/Flat/Action/EraserTest.php | 9 +- .../Indexer/Product/Flat/Action/RowTest.php | 8 +- .../Flat/Action/CustomFlatAttributeTest.php | 91 +++++++++++++++++ .../Indexer/Product/Flat/Action/RowTest.php | 97 ++++++++++++------- ...t_simple_with_custom_attribute_in_flat.php | 79 +++++++++++++++ ...with_custom_attribute_in_flat_rollback.php | 41 ++++++++ 9 files changed, 310 insertions(+), 67 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/CustomFlatAttributeTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_attribute_in_flat.php create mode 100644 dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_attribute_in_flat_rollback.php diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Eraser.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Eraser.php index 6762602aeca..ad734b96d59 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Eraser.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Eraser.php @@ -118,9 +118,10 @@ public function removeDisabledProducts(array &$ids, $storeId) private function getSelectForProducts(array $ids) { $productTable = $this->productIndexerHelper->getTable('catalog_product_entity'); - $select = $this->connection->select()->from($productTable) + $select = $this->connection->select() + ->from(['product_table' => $productTable]) ->columns('entity_id') - ->where('entity_id IN(?)', $ids); + ->where('product_table.entity_id IN(?)', $ids); return $select; } diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Indexer.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Indexer.php index 466ba746fa1..a669fb73f64 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Indexer.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Indexer.php @@ -9,6 +9,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Framework\App\ResourceConnection; use Magento\Framework\EntityManager\MetadataPool; +use Magento\Store\Model\Store; /** * Class Indexer @@ -84,7 +85,7 @@ public function write($storeId, $productId, $valueFieldSuffix = '') [ 'entity_id' => 'e.entity_id', 'attribute_id' => 't.attribute_id', - 'value' => $this->_connection->getIfNullSql('`t2`.`value`', '`t`.`value`'), + 'value' => 't.value' ] ); @@ -99,32 +100,30 @@ public function write($storeId, $productId, $valueFieldSuffix = '') sprintf('e.%s = t.%s ', $linkField, $linkField) . $this->_connection->quoteInto( ' AND t.attribute_id IN (?)', array_keys($ids) - ) . ' AND t.store_id = 0', - [] - )->joinLeft( - ['t2' => $tableName], - sprintf('t.%s = t2.%s ', $linkField, $linkField) . - ' AND t.attribute_id = t2.attribute_id ' . - $this->_connection->quoteInto( - ' AND t2.store_id = ?', - $storeId - ), + ) . ' AND ' . $this->_connection->quoteInto('t.store_id IN(?)', [ + Store::DEFAULT_STORE_ID, + $storeId + ]), [] )->where( 'e.entity_id = ' . $productId - ); + )->order('t.store_id ASC'); $cursor = $this->_connection->query($select); while ($row = $cursor->fetch(\Zend_Db::FETCH_ASSOC)) { $updateData[$ids[$row['attribute_id']]] = $row['value']; $valueColumnName = $ids[$row['attribute_id']] . $valueFieldSuffix; if (isset($describe[$valueColumnName])) { - $valueColumns[$row['value']] = $valueColumnName; + $valueColumns[$row['attribute_id']] = [ + 'value' => $row['value'], + 'column_name' => $valueColumnName + ]; } } //Update not simple attributes (eg. dropdown) if (!empty($valueColumns)) { - $valueIds = array_keys($valueColumns); + $valueIds = array_column($valueColumns, 'value'); + $optionIdToAttributeName = array_column($valueColumns, 'column_name', 'value'); $select = $this->_connection->select()->from( ['t' => $this->_productIndexerHelper->getTable('eav_attribute_option_value')], @@ -133,14 +132,14 @@ public function write($storeId, $productId, $valueFieldSuffix = '') $this->_connection->quoteInto('t.option_id IN (?)', $valueIds) )->where( $this->_connection->quoteInto('t.store_id IN(?)', [ - \Magento\Store\Model\Store::DEFAULT_STORE_ID, + Store::DEFAULT_STORE_ID, $storeId ]) ) ->order('t.store_id ASC'); $cursor = $this->_connection->query($select); while ($row = $cursor->fetch(\Zend_Db::FETCH_ASSOC)) { - $valueColumnName = $valueColumns[$row['option_id']]; + $valueColumnName = $optionIdToAttributeName[$row['option_id']]; if (isset($describe[$valueColumnName])) { $updateData[$valueColumnName] = $row['value']; } @@ -150,6 +149,7 @@ public function write($storeId, $productId, $valueFieldSuffix = '') $columnNames = array_keys($columns); $columnNames[] = 'attribute_set_id'; $columnNames[] = 'type_id'; + $columnNames[] = $linkField; $select->from( ['e' => $entityTableName], $columnNames @@ -159,6 +159,7 @@ public function write($storeId, $productId, $valueFieldSuffix = '') $cursor = $this->_connection->query($select); $row = $cursor->fetch(\Zend_Db::FETCH_ASSOC); if (!empty($row)) { + $linkFieldId = $linkField; foreach ($row as $columnName => $value) { $updateData[$columnName] = $value; } @@ -170,7 +171,7 @@ public function write($storeId, $productId, $valueFieldSuffix = '') if (!empty($updateData)) { $updateData += ['entity_id' => $productId]; if ($linkField !== $metadata->getIdentifierField()) { - $updateData += [$linkField => $productId]; + $updateData += [$linkField => $linkFieldId]; } $updateFields = []; foreach ($updateData as $key => $value) { diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Row.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Row.php index d9bfc96b781..64a7c4be4e0 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Row.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Row.php @@ -96,15 +96,17 @@ public function execute($id = null) /* @var $status \Magento\Eav\Model\Entity\Attribute */ $status = $this->_productIndexerHelper->getAttribute(ProductInterface::STATUS); $statusTable = $status->getBackend()->getTable(); + $catalogProductEntityTable = $this->_productIndexerHelper->getTable('catalog_product_entity'); $statusConditions = [ - 'store_id IN(0,' . (int)$store->getId() . ')', - 'attribute_id = ' . (int)$status->getId(), - $linkField . ' = ' . (int)$id, + 's.store_id IN(0,' . (int)$store->getId() . ')', + 's.attribute_id = ' . (int)$status->getId(), + 'e.entity_id = ' . (int)$id, ]; $select = $this->_connection->select(); - $select->from($statusTable, ['value']) + $select->from(['e' => $catalogProductEntityTable], ['s.value']) ->where(implode(' AND ', $statusConditions)) - ->order('store_id DESC') + ->joinLeft(['s' => $statusTable], "e.{$linkField} = s.{$linkField}", []) + ->order('s.store_id DESC') ->limit(1); $result = $this->_connection->query($select); $status = $result->fetchColumn(0); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/EraserTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/EraserTest.php index c04428eadef..e1e2816d442 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/EraserTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/EraserTest.php @@ -53,9 +53,14 @@ public function testRemoveDeletedProducts() { $productsToDeleteIds = [1, 2]; $select = $this->createMock(\Magento\Framework\DB\Select::class); - $select->expects($this->once())->method('from')->with('catalog_product_entity')->will($this->returnSelf()); + $select->expects($this->once()) + ->method('from') + ->with(['product_table' => 'catalog_product_entity']) + ->will($this->returnSelf()); $select->expects($this->once())->method('columns')->with('entity_id')->will($this->returnSelf()); - $select->expects($this->once())->method('where')->with('entity_id IN(?)', $productsToDeleteIds) + $select->expects($this->once()) + ->method('where') + ->with('product_table.entity_id IN(?)', $productsToDeleteIds) ->will($this->returnSelf()); $products = [['entity_id' => 2]]; $statement = $this->createMock(\Zend_Db_Statement_Interface::class); diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php index 85d8dd8a149..11d07872fef 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Flat/Action/RowTest.php @@ -100,10 +100,10 @@ protected function setUp() ->disableOriginalConstructor() ->getMock(); $this->connection->expects($this->any())->method('select')->willReturn($selectMock); - $selectMock->expects($this->any())->method('from')->with( - $attributeTable, - ['value'] - )->willReturnSelf(); + $selectMock->method('from') + ->willReturnSelf(); + $selectMock->method('joinLeft') + ->willReturnSelf(); $selectMock->expects($this->any())->method('where')->willReturnSelf(); $selectMock->expects($this->any())->method('order')->willReturnSelf(); $selectMock->expects($this->any())->method('limit')->willReturnSelf(); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/CustomFlatAttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/CustomFlatAttributeTest.php new file mode 100644 index 00000000000..049e7c8d201 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/CustomFlatAttributeTest.php @@ -0,0 +1,91 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +namespace Magento\Catalog\Model\Indexer\Product\Flat\Action; + +use Magento\TestFramework\Indexer\TestCase as IndexerTestCase; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Indexer\Product\Flat\Processor; +use Magento\Catalog\Model\ResourceModel\Product\Flat; +use Magento\Framework\Api\SearchCriteriaBuilder; + +/** + * Custom Flat Attribute Test + */ +class CustomFlatAttributeTest extends IndexerTestCase +{ + /** + * @var Processor + */ + private $processor; + + /** + * @var \Magento\Framework\ObjectManagerInterface + */ + private $objectManager; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @inheritdoc + */ + protected function setUp(): void + { + $this->objectManager = Bootstrap::getObjectManager(); + $this->processor = $this->objectManager->get(Processor::class); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + } + + /** + * Tests that custom product attribute will appear in flat table and can be updated in it. + * + * @magentoDbIsolation disabled + * @magentoAppArea frontend + * @magentoConfigFixture current_store catalog/frontend/flat_catalog_product 1 + * @magentoDataFixture Magento/Catalog/_files/product_simple_with_custom_attribute_in_flat.php + * + * @return void + * @throws \Magento\Framework\Exception\CouldNotSaveException + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\StateException + */ + public function testProductUpdateCustomAttribute(): void + { + $product = $this->productRepository->get('simple_with_custom_flat_attribute'); + $product->setCustomAttribute('flat_attribute', 'changed flat attribute'); + $this->productRepository->save($product); + + /** @var SearchCriteriaBuilder $searchCriteriaBuilder */ + $searchCriteriaBuilder = $this->objectManager->create(SearchCriteriaBuilder::class); + /** @var \Magento\Framework\Api\SearchCriteriaInterface $searchCriteria */ + $searchCriteria = $searchCriteriaBuilder->addFilter('sku', 'simple_with_custom_flat_attribute') + ->create(); + + $items = $this->productRepository->getList($searchCriteria) + ->getItems(); + $product = reset($items); + $resourceModel = $product->getResourceCollection() + ->getEntity(); + + self::assertInstanceOf( + Flat::class, + $resourceModel, + 'Product should be received from flat resource' + ); + + self::assertEquals( + 'changed flat attribute', + $product->getFlatAttribute(), + 'Product flat attribute should be able to change.' + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php index 15c90891878..a32b476fe75 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Flat/Action/RowTest.php @@ -3,87 +3,110 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ +declare(strict_types=1); + namespace Magento\Catalog\Model\Indexer\Product\Flat\Action; +use Magento\TestFramework\Indexer\TestCase as IndexerTestCase; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\Indexer\Product\Flat\Processor; +use Magento\Catalog\Block\Product\ListProduct; +use Magento\Catalog\Api\CategoryRepositoryInterface; + /** * Class RowTest */ -class RowTest extends \Magento\TestFramework\Indexer\TestCase +class RowTest extends IndexerTestCase { /** - * @var \Magento\Catalog\Model\Product + * @var Processor */ - protected $_product; + private $processor; /** - * @var \Magento\Catalog\Model\Category + * @var \Magento\Framework\ObjectManagerInterface */ - protected $_category; + private $objectManager; /** - * @var \Magento\Catalog\Model\Indexer\Product\Flat\State + * @var ProductRepositoryInterface */ - protected $_state; + private $productRepository; /** - * @var \Magento\Catalog\Model\Indexer\Product\Flat\Processor + * @var CategoryRepositoryInterface */ - protected $_processor; + private $categoryRepository; - protected function setUp() + /** + * @inheritdoc + */ + protected function setUp(): void { - $this->_product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Product::class - ); - $this->_category = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Category::class - ); - $this->_processor = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - \Magento\Catalog\Model\Indexer\Product\Flat\Processor::class - ); + $this->objectManager = Bootstrap::getObjectManager(); + $this->processor = $this->objectManager->get(Processor::class); + $this->productRepository = $this->objectManager->get(ProductRepositoryInterface::class); + $this->categoryRepository = $this->objectManager->get(CategoryRepositoryInterface::class); } /** + * Tests product update + * * @magentoDbIsolation disabled * @magentoDataFixture Magento/Catalog/_files/row_fixture.php * @magentoConfigFixture current_store catalog/frontend/flat_catalog_product 1 * @magentoAppArea frontend + * + * @return void + * @throws \Magento\Framework\Exception\CouldNotSaveException + * @throws \Magento\Framework\Exception\InputException + * @throws \Magento\Framework\Exception\LocalizedException + * @throws \Magento\Framework\Exception\NoSuchEntityException + * @throws \Magento\Framework\Exception\StateException */ - public function testProductUpdate() + public function testProductUpdate(): void { - $categoryFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Catalog\Model\CategoryFactory::class); - $listProduct = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create(\Magento\Catalog\Block\Product\ListProduct::class); + /** @var ListProduct $listProduct */ + $listProduct = $this->objectManager->create(ListProduct::class); - $this->_processor->getIndexer()->setScheduled(false); - $this->assertFalse( - $this->_processor->getIndexer()->isScheduled(), + $this->processor->getIndexer() + ->setScheduled(false); + $isScheduled = $this->processor->getIndexer() + ->isScheduled(); + self::assertFalse( + $isScheduled, 'Indexer is in scheduled mode when turned to update on save mode' ); - $this->_product->load(1); - $this->_product->setName('Updated Product'); - $this->_product->save(); + $this->processor->reindexAll(); - $this->_processor->reindexAll(); - - $category = $categoryFactory->create()->load(9); + $product = $this->productRepository->get('simple'); + $product->setName('Updated Product'); + $this->productRepository->save($product); + + /** @var \Magento\Catalog\Api\Data\CategoryInterface $category */ + $category = $this->categoryRepository->get(9); + /** @var \Magento\Catalog\Model\Layer $layer */ $layer = $listProduct->getLayer(); $layer->setCurrentCategory($category); /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection */ $productCollection = $layer->getProductCollection(); - $this->assertTrue( + self::assertTrue( $productCollection->isEnabledFlat(), 'Product collection is not using flat resource when flat is on' ); - $this->assertEquals(2, $productCollection->count(), 'Product collection items count must be exactly 2'); + self::assertEquals( + 2, + $productCollection->count(), + 'Product collection items count must be exactly 2' + ); foreach ($productCollection as $product) { /** @var $product \Magento\Catalog\Model\Product */ - if ($product->getId() == 1) { - $this->assertEquals( + if ($product->getSku() === 'simple') { + self::assertEquals( 'Updated Product', $product->getName(), 'Product name from flat does not match with updated name' diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_attribute_in_flat.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_attribute_in_flat.php new file mode 100644 index 00000000000..2b1b271a8bb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_attribute_in_flat.php @@ -0,0 +1,79 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Catalog\Model\ProductFactory; +use Magento\Catalog\Api\Data\ProductAttributeInterface; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; +use Magento\Catalog\Model\Indexer\Product\Flat\Processor; +use Magento\Catalog\Setup\CategorySetup; +use Magento\Eav\Model\Entity; +use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Type; + +/** @var \Magento\TestFramework\ObjectManager $objectManager */ +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var ProductFactory $productFactory */ +$productFactory = $objectManager->get(ProductFactory::class); +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); + + +/** @var $installer CategorySetup */ +$installer = $objectManager->create(CategorySetup::class); +$entityModel = $objectManager->create(Entity::class); +$attributeSetId = $installer->getAttributeSetId(Product::ENTITY, 'Default'); +$entityTypeId = $entityModel->setType(Product::ENTITY) + ->getTypeId(); +$groupId = $installer->getDefaultAttributeGroupId($entityTypeId, $attributeSetId); + +/** @var ProductAttributeInterface $attribute */ +$attribute = $objectManager->create(ProductAttributeInterface::class); + +$attribute->setAttributeCode('flat_attribute') + ->setEntityTypeId($entityTypeId) + ->setIsVisible(true) + ->setFrontendInput('text') + ->setIsFilterable(1) + ->setIsUserDefined(1) + ->setUsedInProductListing(1) + ->setBackendType('varchar') + ->setIsUsedInGrid(1) + ->setIsVisibleInGrid(1) + ->setIsFilterableInGrid(1) + ->setFrontendLabel('nobody cares') + ->setAttributeGroupId($groupId) + ->setAttributeSetId(4); + +$attributeRepository->save($attribute); + +/** @var Processor $processor */ +$processor = $objectManager->create(Processor::class); +$scheduled = $processor->getIndexer() + ->isScheduled(); +$processor->reindexAll(); + +$product = $productFactory->create() + ->setTypeId(Type::TYPE_SIMPLE) + ->setAttributeSetId(4) + ->setName('Simple With Attribute That Used In Flat') + ->setSku('simple_with_custom_flat_attribute') + ->setPrice(100) + ->setVisibility(1) + ->setStockData( + [ + 'use_config_manage_stock' => 1, + 'qty' => 100, + 'is_in_stock' => 1, + ] + ) + ->setStatus(1); +$product->setCustomAttribute('flat_attribute', 'flat attribute value'); +$productRepository->save($product); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_attribute_in_flat_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_attribute_in_flat_rollback.php new file mode 100644 index 00000000000..c1892d504ec --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_custom_attribute_in_flat_rollback.php @@ -0,0 +1,41 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +declare(strict_types=1); + +use Magento\Framework\Registry; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Catalog\Api\ProductAttributeRepositoryInterface; + +/** @var Magento\Framework\ObjectManagerInterface $objectManager */ +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +/** @var ProductAttributeRepositoryInterface $attributeRepository */ +$attributeRepository = $objectManager->get(ProductAttributeRepositoryInterface::class); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +try { + /** @var \Magento\Catalog\Api\Data\ProductInterface $product */ + $product = $productRepository->get('simple_with_custom_flat_attribute'); + $productRepository->delete($product); +} catch (NoSuchEntityException $e) { +} + +try { + /** @var \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute */ + $attribute = $attributeRepository->get('flat_attribute'); + $attributeRepository->delete($attribute); +} catch (NoSuchEntityException $e) { +} + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); From 072660ea9b68a28f760554f7b348514f7209671e Mon Sep 17 00:00:00 2001 From: Daniel Ruf <daniel.ruf@ueberbit.de> Date: Tue, 27 Nov 2018 16:11:07 +0100 Subject: [PATCH 088/131] style: change b to strong (a11y) --- .../order/view/info/fraud_details.phtml | 4 ++-- .../view/adminhtml/email/failed_payment.html | 20 +++++++++---------- .../view/frontend/email/submitted_form.html | 8 ++++---- .../system/currency/rate/matrix.phtml | 4 ++-- .../templates/sample_email_content.phtml | 2 +- .../email/cron_error.html | 2 +- .../email/account_new_confirmed.html | 2 +- .../templates/sample_email_content.phtml | 2 +- .../sample_email_content_custom.phtml | 2 +- .../Magento_Customer/email/account_new.html | 2 +- .../email/account_new_confirmation.html | 2 +- lib/web/css/docs/forms.html | 2 +- lib/web/css/docs/variables.html | 2 +- setup/view/magento/setup/data-option.phtml | 4 ++-- setup/view/magento/setup/extension-grid.phtml | 4 ++-- setup/view/magento/setup/module-grid.phtml | 2 +- setup/view/magento/setup/select-version.phtml | 2 +- 17 files changed, 33 insertions(+), 33 deletions(-) diff --git a/app/code/Magento/Authorizenet/view/adminhtml/templates/order/view/info/fraud_details.phtml b/app/code/Magento/Authorizenet/view/adminhtml/templates/order/view/info/fraud_details.phtml index 60fec263352..ac91fa30bfb 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/templates/order/view/info/fraud_details.phtml +++ b/app/code/Magento/Authorizenet/view/adminhtml/templates/order/view/info/fraud_details.phtml @@ -44,8 +44,8 @@ $fraudDetails = $payment->getAdditionalInformation('fraud_details'); <?php endif; ?> <?php if(!empty($fraudDetails['fraud_filters'])): ?> - <b><?= $block->escapeHtml(__('Fraud Filters')) ?>: - </b></br> + <strong><?= $block->escapeHtml(__('Fraud Filters')) ?>: + </strong></br> <?php foreach($fraudDetails['fraud_filters'] as $filter): ?> <?= $block->escapeHtml($filter['name']) ?>: <?= $block->escapeHtml($filter['action']) ?> diff --git a/app/code/Magento/Checkout/view/adminhtml/email/failed_payment.html b/app/code/Magento/Checkout/view/adminhtml/email/failed_payment.html index fb55f9b601d..03ad7d9e8d8 100644 --- a/app/code/Magento/Checkout/view/adminhtml/email/failed_payment.html +++ b/app/code/Magento/Checkout/view/adminhtml/email/failed_payment.html @@ -23,43 +23,43 @@ <h1>{{trans "Payment Transaction Failed"}}</h1> <ul> <li> - <b>{{trans "Reason"}}</b><br /> + <strong>{{trans "Reason"}}</strong><br /> {{var reason}} </li> <li> - <b>{{trans "Checkout Type"}}</b><br /> + <strong>{{trans "Checkout Type"}}</strong><br /> {{var checkoutType}} </li> <li> - <b>{{trans "Customer:"}}</b><br /> + <strong>{{trans "Customer:"}}</strong><br /> <a href="mailto:{{var customerEmail}}">{{var customer}}</a> <{{var customerEmail}}> </li> <li> - <b>{{trans "Items"}}</b><br /> + <strong>{{trans "Items"}}</strong><br /> {{var items|raw}} </li> <li> - <b>{{trans "Total:"}}</b><br /> + <strong>{{trans "Total:"}}</strong><br /> {{var total}} </li> <li> - <b>{{trans "Billing Address:"}}</b><br /> + <strong>{{trans "Billing Address:"}}</strong><br /> {{var billingAddress.format('html')|raw}} </li> <li> - <b>{{trans "Shipping Address:"}}</b><br /> + <strong>{{trans "Shipping Address:"}}</strong><br /> {{var shippingAddress.format('html')|raw}} </li> <li> - <b>{{trans "Shipping Method:"}}</b><br /> + <strong>{{trans "Shipping Method:"}}</strong><br /> {{var shippingMethod}} </li> <li> - <b>{{trans "Payment Method:"}}</b><br /> + <strong>{{trans "Payment Method:"}}</strong><br /> {{var paymentMethod}} </li> <li> - <b>{{trans "Date & Time:"}}</b><br /> + <strong>{{trans "Date & Time:"}}</strong><br /> {{var dateAndTime}} </li> </ul> diff --git a/app/code/Magento/Contact/view/frontend/email/submitted_form.html b/app/code/Magento/Contact/view/frontend/email/submitted_form.html index 1bce6159c58..17146257aef 100644 --- a/app/code/Magento/Contact/view/frontend/email/submitted_form.html +++ b/app/code/Magento/Contact/view/frontend/email/submitted_form.html @@ -16,19 +16,19 @@ <table class="message-details"> <tr> - <td><b>{{trans "Name"}}</b></td> + <td><strong>{{trans "Name"}}</strong></td> <td>{{var data.name}}</td> </tr> <tr> - <td><b>{{trans "Email"}}</b></td> + <td><strong>{{trans "Email"}}</strong></td> <td>{{var data.email}}</td> </tr> <tr> - <td><b>{{trans "Phone"}}</b></td> + <td><strong>{{trans "Phone"}}</strong></td> <td>{{var data.telephone}}</td> </tr> </table> -<p><b>{{trans "Message"}}</b></p> +<p><strong>{{trans "Message"}}</strong></p> <p>{{var data.comment}}</p> {{template config_path="design/email/footer_template"}} diff --git a/app/code/Magento/CurrencySymbol/view/adminhtml/templates/system/currency/rate/matrix.phtml b/app/code/Magento/CurrencySymbol/view/adminhtml/templates/system/currency/rate/matrix.phtml index 8e0abcb3197..8a16eb71e08 100644 --- a/app/code/Magento/CurrencySymbol/view/adminhtml/templates/system/currency/rate/matrix.phtml +++ b/app/code/Magento/CurrencySymbol/view/adminhtml/templates/system/currency/rate/matrix.phtml @@ -45,7 +45,7 @@ $_rates = ($_newRates) ? $_newRates : $_oldRates; class="admin__control-text" <?= ($_currencyCode == $_rate) ? ' disabled' : '' ?> /> <?php if (isset($_newRates) && $_currencyCode != $_rate && isset($_oldRates[$_currencyCode][$_rate])): ?> - <div class="admin__field-note"><?= /* @escapeNotVerified */ __('Old rate:') ?> <b><?= /* @escapeNotVerified */ $_oldRates[$_currencyCode][$_rate] ?></b></div> + <div class="admin__field-note"><?= /* @escapeNotVerified */ __('Old rate:') ?> <strong><?= /* @escapeNotVerified */ $_oldRates[$_currencyCode][$_rate] ?></strong></div> <?php endif; ?> </td> <?php else: ?> @@ -56,7 +56,7 @@ $_rates = ($_newRates) ? $_newRates : $_oldRates; class="admin__control-text" <?= ($_currencyCode == $_rate) ? ' disabled' : '' ?> /> <?php if (isset($_newRates) && $_currencyCode != $_rate && isset($_oldRates[$_currencyCode][$_rate])): ?> - <div class="admin__field-note"><?= /* @escapeNotVerified */ __('Old rate:') ?> <b><?= /* @escapeNotVerified */ $_oldRates[$_currencyCode][$_rate] ?></b></div> + <div class="admin__field-note"><?= /* @escapeNotVerified */ __('Old rate:') ?> <strong><?= /* @escapeNotVerified */ $_oldRates[$_currencyCode][$_rate] ?></strong></div> <?php endif; ?> </td> <?php endif; ?> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/Magento_Email/templates/sample_email_content.phtml b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/Magento_Email/templates/sample_email_content.phtml index d53468a3837..bb0073cedee 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/Magento_Email/templates/sample_email_content.phtml +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/Magento_Email/templates/sample_email_content.phtml @@ -4,4 +4,4 @@ * See COPYING.txt for license details. */ ?> -<b>Email content for adminhtml/Magento/default theme</b> +<strong>Email content for adminhtml/Magento/default theme</strong> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/Magento_ProductAlert/email/cron_error.html b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/Magento_ProductAlert/email/cron_error.html index f13e54edf93..d65f9d4c408 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/Magento_ProductAlert/email/cron_error.html +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/adminhtml/Magento/default/Magento_ProductAlert/email/cron_error.html @@ -4,4 +4,4 @@ * See COPYING.txt for license details. */ --> -<b>catalog_productalert_cron_error_email_template template from Magento/default</b> +<strong>catalog_productalert_cron_error_email_template template from Magento/default</strong> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Customer/email/account_new_confirmed.html b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Customer/email/account_new_confirmed.html index f687fc041db..ffc4d8893fe 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Customer/email/account_new_confirmed.html +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Customer/email/account_new_confirmed.html @@ -4,4 +4,4 @@ * See COPYING.txt for license details. */ --> -<b>customer_create_account_email_confirmed_template template from Magento/default</b> +<strong>customer_create_account_email_confirmed_template template from Magento/default</strong> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Email/templates/sample_email_content.phtml b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Email/templates/sample_email_content.phtml index acbdf16d474..9c973818272 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Email/templates/sample_email_content.phtml +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Email/templates/sample_email_content.phtml @@ -4,4 +4,4 @@ * See COPYING.txt for license details. */ ?> -<b>Email content for frontend/Magento/default theme</b> +<strong>Email content for frontend/Magento/default theme</strong> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Email/templates/sample_email_content_custom.phtml b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Email/templates/sample_email_content_custom.phtml index 1730bf904bb..4ed5685ee01 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Email/templates/sample_email_content_custom.phtml +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Magento/default/Magento_Email/templates/sample_email_content_custom.phtml @@ -4,4 +4,4 @@ * See COPYING.txt for license details. */ ?> -<b>Custom Email content for frontend/Magento/default theme</b> +<strong>Custom Email content for frontend/Magento/default theme</strong> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/Magento_Customer/email/account_new.html b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/Magento_Customer/email/account_new.html index 7e8f9bd1b12..46257060f82 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/Magento_Customer/email/account_new.html +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/custom_theme/Magento_Customer/email/account_new.html @@ -4,4 +4,4 @@ * See COPYING.txt for license details. */ --> -<b>customer_create_account_email_template template from Vendor/custom_theme</b> +<strong>customer_create_account_email_template template from Vendor/custom_theme</strong> diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/Magento_Customer/email/account_new_confirmation.html b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/Magento_Customer/email/account_new_confirmation.html index c5801b6557a..9c52c5a1b38 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/Magento_Customer/email/account_new_confirmation.html +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/Vendor/default/Magento_Customer/email/account_new_confirmation.html @@ -4,4 +4,4 @@ * See COPYING.txt for license details. */ --> -<b>customer_create_account_email_confirmation_template template from Vendor/default</b> +<strong>customer_create_account_email_confirmation_template template from Vendor/default</strong> diff --git a/lib/web/css/docs/forms.html b/lib/web/css/docs/forms.html index 211a9bd650b..dc08ddffd20 100644 --- a/lib/web/css/docs/forms.html +++ b/lib/web/css/docs/forms.html @@ -713,7 +713,7 @@ <h2 id="simple-form-with-required-fields-message">Simple form with "require <th>@_type</th> <td class="vars_value">@form-element-input-type</td> <td class="vars_value">'' [input-text | select | textarea | input-radio | input-checkbox]</td> - <td>Form control type.<br/><b>@form-element-input__[]</b> global variables are used to set up all form elements style. Control-specific global variables use these <b>@form-element-input__[]</b> variables by default. Control-specific global variables can be set up separately.<br/><b>@input-text__[]</b> is used to set up input-text controls style<br/><b>@select__[]</b> is used to set up selects style<br/><b>@textarea__[]</b> is used to set up textarea style</td> + <td>Form control type.<br/><strong>@form-element-input__[]</strong> global variables are used to set up all form elements style. Control-specific global variables use these <strong>@form-element-input__[]</strong> variables by default. Control-specific global variables can be set up separately.<br/><strong>@input-text__[]</strong> is used to set up input-text controls style<br/><strong>@select__[]</strong> is used to set up selects style<br/><strong>@textarea__[]</strong> is used to set up textarea style</td> </tr> <tr> <th>@_background</th> diff --git a/lib/web/css/docs/variables.html b/lib/web/css/docs/variables.html index 4f353dc1554..ebbf2122ab2 100644 --- a/lib/web/css/docs/variables.html +++ b/lib/web/css/docs/variables.html @@ -3507,7 +3507,7 @@ <h4 id="the-codelibformelementinputcoed-mixin-variables">The <code>.lib-form-ele <th>@_type</th> <td class="vars_value">@form-element-input-type</td> <td class="vars_value">'' [input-text | select | textarea | input-radio | input-checkbox]</td> - <td>Form control type.<br/><b>@form-element-input__[]</b> global variables are used to set up all form elements style. Control-specific global variables use these <b>@form-element-input__[]</b> variables by default. Control-specific global variables can be set up separately.<br/><b>@input-text__[]</b> is used to set up input-text controls style<br/><b>@select__[]</b> is used to set up selects style<br/><b>@textarea__[]</b> is used to set up textarea style</td> + <td>Form control type.<br/><strong>@form-element-input__[]</strong> global variables are used to set up all form elements style. Control-specific global variables use these <strong>@form-element-input__[]</strong> variables by default. Control-specific global variables can be set up separately.<br/><strong>@input-text__[]</strong> is used to set up input-text controls style<br/><strong>@select__[]</strong> is used to set up selects style<br/><strong>@textarea__[]</strong> is used to set up textarea style</td> </tr> <tr> <th>@_background</th> diff --git a/setup/view/magento/setup/data-option.phtml b/setup/view/magento/setup/data-option.phtml index cb31d96013f..656b04876c4 100644 --- a/setup/view/magento/setup/data-option.phtml +++ b/setup/view/magento/setup/data-option.phtml @@ -43,7 +43,7 @@ value="false" > <label class="form-label" for="keepData"> - <b>Keep data</b> + <strong>Keep data</strong> <br/><br/> Note: You can see the associated data in your database, however your customer will not see this in your online store. @@ -59,7 +59,7 @@ value="true" > <label class="form-label" for="removeData"> - <b>Remove data</b> + <strong>Remove data</strong> <br/><br/> Did you back up first? Choosing to remove data means the data is unavailable unless you recover it from a backup in the preceding step. diff --git a/setup/view/magento/setup/extension-grid.phtml b/setup/view/magento/setup/extension-grid.phtml index 47e5f7eec30..df2203df2c0 100644 --- a/setup/view/magento/setup/extension-grid.phtml +++ b/setup/view/magento/setup/extension-grid.phtml @@ -66,8 +66,8 @@ <div class="row" ng-show="$root.isMarketplaceAuthorized && extensionsProcessed && total == 0"> <label class="form-label not-found"> - <b>You haven't purchased any extensions yet. Visit <a href="https://marketplace.magento.com">Marketplace</a> - for purchasing extensions.</b><br/> + <strong>You haven't purchased any extensions yet. Visit <a href="https://marketplace.magento.com">Marketplace</a> + for purchasing extensions.</strong><br/> </label> </div> <div class="admin__data-grid-outer-wrap" diff --git a/setup/view/magento/setup/module-grid.phtml b/setup/view/magento/setup/module-grid.phtml index 5fe0447b7c7..3bf9377104d 100644 --- a/setup/view/magento/setup/module-grid.phtml +++ b/setup/view/magento/setup/module-grid.phtml @@ -8,7 +8,7 @@ <div class="row" ng-show="modulesProcessed && total == 0"> <label class="form-label"> - <b>We didn't find any modules at this time. Please try later.</b><br/> + <strong>We didn't find any modules at this time. Please try later.</strong><br/> </label> </div> <div class="admin__data-grid-outer-wrap" ng-show="modulesProcessed && total > 0"> diff --git a/setup/view/magento/setup/select-version.phtml b/setup/view/magento/setup/select-version.phtml index 920ab862525..66264e46d50 100644 --- a/setup/view/magento/setup/select-version.phtml +++ b/setup/view/magento/setup/select-version.phtml @@ -128,7 +128,7 @@ </div> <div class="row" ng-show="componentsProcessed && total == 0"> <label class="form-label"> - <b>We didn't find any components to upgrade. Click "Next" to continue.<br/> + <strong>We didn't find any components to upgrade. Click "Next" to continue.</strong><br/> </label> </div> <div class="admin__data-grid-outer-wrap" ng-show="componentsProcessed && total > 0"> From 98591b458ecf24291876a7ae0d02de08d293e986 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Tue, 27 Nov 2018 11:20:30 -0600 Subject: [PATCH 089/131] MC-5321: Create tax rate, wider zip code range --- .../Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml index ba65ea43a6a..0920ac52278 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml @@ -10,8 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminCreateTaxRateWiderZipCodeRange"> <annotations> - <stories value="Create tax rate, wider zip code range"/> - <title value="Create Tax Rate"/> + <stories value="Create tax rate"/> + <title value="Create Tax Rate, wider zip code range"/> <description value="Test log in to Create Tax Rate and Create Wider Zip Code Range"/> <testCaseId value="MC-5321"/> <severity value="CRITICAL"/> From 1d0820625eba1602cc929494a9692a193d822873 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Tue, 27 Nov 2018 12:58:33 -0600 Subject: [PATCH 090/131] MC-5322: Create tax rate, large rate --- .../Mftf/Test/AdminCreateTaxRateLargeRate.xml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRate.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRate.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRate.xml new file mode 100644 index 00000000000..db029359b83 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRate.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="AdminCreateTaxRateLargeRate"> + <annotations> + <stories value="Create tax rate"/> + <title value="Create Tax Rate, large rate"/> + <description value="Test log in to Create Tax Rate and Create Large Rate"/> + <testCaseId value="MC-5322"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillNameFilter"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow"/> + <click selector="{{AdminTaxRateFormSection.deleteRate}}" stepKey="clickDeleteRate"/> + <click selector="{{AdminTaxRateFormSection.ok}}" stepKey="clickOk"/> + </after> + + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + <!-- Create a tax rate for large postcodes --> + <click selector="{{AdminTaxRateGridSection.add}}" stepKey="clickAddNewTaxRateButton"/> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillRuleName"/> + <fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="*" stepKey="fillPostCode"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="France" stepKey="selectCountry1"/> + <selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="Val-d'Oise" stepKey="selectState" /> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="999" stepKey="fillRate"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/> + <waitForPageLoad stepKey="waitForTaxRateIndex3"/> + <!-- Create a tax rate for large postcodes and verify we see expected values on the tax rate grid page --> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <selectOption selector="{{AdminTaxRateGridSection.filterByCountry}}" userInput="France" stepKey="selectCountry2" /> + <fillField selector="{{AdminTaxRateGridSection.filterByPostCode}}" userInput="*" stepKey="seeTaxPostCode1"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow3"/> + <!-- Verify we see expected values on the tax rate form page --> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxIdentifierField2"/> + <seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="*" stepKey="seeZipCode"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="France" stepKey="seeCountry2"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="Val-d'Oise" stepKey="seeState"/> + <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="999" stepKey="seeRate"/> + + <!-- Verify we see expected values on the tax rule form page --> + <amOnPage url="{{AdminTaxRuleGridPage.url}}" stepKey="goToTaxRuleIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex4"/> + <click selector="{{AdminTaxRuleGridSection.add}}" stepKey="clickAdd"/> + <see selector="{{AdminTaxRulesSection.taxRateMultiSelectItems}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeTaxRateOnNewTaxRulePage"/> + </test> +</tests> From 43325d2ccebb77bfb1639a921836ec82dbaa644a Mon Sep 17 00:00:00 2001 From: Tommy Wiebell <twiebell@adobe.com> Date: Tue, 27 Nov 2018 13:05:14 -0600 Subject: [PATCH 091/131] MAGETWO-96009: Restricted admin still able to send order comment email modifying POST request - Add additional ACL check to make sure user also has permissions to send comment email - Add unit test coverage for this functionality --- .../Controller/Adminhtml/Order/AddComment.php | 22 ++- .../Adminhtml/Order/AddCommentTest.php | 176 ++++++++++++++++++ 2 files changed, 192 insertions(+), 6 deletions(-) create mode 100644 app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/AddCommentTest.php diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/AddComment.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/AddComment.php index 07716314ec6..e85083a50d7 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/AddComment.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/AddComment.php @@ -1,16 +1,17 @@ <?php /** - * * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ - namespace Magento\Sales\Controller\Adminhtml\Order; -use Magento\Backend\App\Action; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Sales\Model\Order\Email\Sender\OrderCommentSender; -class AddComment extends \Magento\Sales\Controller\Adminhtml\Order +/** + * Class AddComment + */ +class AddComment extends \Magento\Sales\Controller\Adminhtml\Order implements HttpPostActionInterface { /** * Authorization level of a basic admin session @@ -19,6 +20,11 @@ class AddComment extends \Magento\Sales\Controller\Adminhtml\Order */ const ADMIN_RESOURCE = 'Magento_Sales::comment'; + /** + * ACL resource needed to send comment email notification + */ + const ADMIN_SALES_EMAIL_RESOURCE = 'Magento_Sales::emails'; + /** * Add order comment action * @@ -36,8 +42,12 @@ public function execute() ); } - $notify = isset($data['is_customer_notified']) ? $data['is_customer_notified'] : false; - $visible = isset($data['is_visible_on_front']) ? $data['is_visible_on_front'] : false; + $notify = $data['is_customer_notified'] ?? false; + $visible = $data['is_visible_on_front'] ?? false; + + if ($notify && !$this->_authorization->isAllowed(self::ADMIN_SALES_EMAIL_RESOURCE)) { + $notify = false; + } $history = $order->addStatusHistoryComment($data['comment'], $data['status']); $history->setIsVisibleOnFront($visible); diff --git a/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/AddCommentTest.php b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/AddCommentTest.php new file mode 100644 index 00000000000..3a4157df5c7 --- /dev/null +++ b/app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/AddCommentTest.php @@ -0,0 +1,176 @@ +<?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +namespace Magento\Sales\Test\Unit\Controller\Adminhtml\Order; + +class AddCommentTest extends \PHPUnit\Framework\TestCase +{ + /** + * @var \Magento\Sales\Controller\Adminhtml\Order\AddComment + */ + private $addCommentController; + + /** + * @var \Magento\Backend\App\Action\Context|\PHPUnit_Framework_MockObject_MockObject + */ + private $contextMock; + + /** + * @var \Magento\Sales\Model\Order|\PHPUnit_Framework_MockObject_MockObject + */ + private $orderMock; + + /** + * @var \Magento\Backend\Model\View\Result\RedirectFactory|\PHPUnit_Framework_MockObject_MockObject + */ + private $resultRedirectFactoryMock; + + /** + * @var \Magento\Backend\Model\View\Result\Redirect|\PHPUnit_Framework_MockObject_MockObject + */ + private $resultRedirectMock; + + /** + * @var \Magento\Framework\App\Request\Http|\PHPUnit_Framework_MockObject_MockObject + */ + private $requestMock; + + /** + * @var \Magento\Sales\Api\OrderRepositoryInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $orderRepositoryMock; + + /** + * @var \Magento\Framework\AuthorizationInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $authorizationMock; + + /** + * @var \Magento\Sales\Model\Order\Status\History|\PHPUnit_Framework_MockObject_MockObject + */ + private $statusHistoryCommentMock; + + /** + * @var \Magento\Framework\ObjectManagerInterface|\PHPUnit_Framework_MockObject_MockObject + */ + private $objectManagerMock; + + /** + * Test setup + */ + protected function setUp() + { + $this->contextMock = $this->createMock(\Magento\Backend\App\Action\Context::class); + $this->requestMock = $this->createMock(\Magento\Framework\App\Request\Http::class); + $this->orderRepositoryMock = $this->createMock(\Magento\Sales\Api\OrderRepositoryInterface::class); + $this->orderMock = $this->createMock(\Magento\Sales\Model\Order::class); + $this->resultRedirectFactoryMock = $this->createMock(\Magento\Backend\Model\View\Result\RedirectFactory::class); + $this->resultRedirectMock = $this->createMock(\Magento\Backend\Model\View\Result\Redirect::class); + $this->authorizationMock = $this->createMock(\Magento\Framework\AuthorizationInterface::class); + $this->statusHistoryCommentMock = $this->createMock(\Magento\Sales\Model\Order\Status\History::class); + $this->objectManagerMock = $this->createMock(\Magento\Framework\ObjectManagerInterface::class); + + $this->contextMock->expects($this->once())->method('getRequest')->willReturn($this->requestMock); + + $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); + $this->addCommentController = $objectManagerHelper->getObject( + \Magento\Sales\Controller\Adminhtml\Order\AddComment::class, + [ + 'context' => $this->contextMock, + 'orderRepository' => $this->orderRepositoryMock, + '_authorization' => $this->authorizationMock, + '_objectManager' => $this->objectManagerMock + ] + ); + } + + /** + * @param array $historyData + * @param bool $userHasResource + * @param bool $expectedNotify + * + * @dataProvider executeWillNotifyCustomerDataProvider + */ + public function testExecuteWillNotifyCustomer(array $historyData, bool $userHasResource, bool $expectedNotify) + { + $orderId = 30; + $this->requestMock->expects($this->once())->method('getParam')->with('order_id')->willReturn($orderId); + $this->orderRepositoryMock->expects($this->once()) + ->method('get') + ->willReturn($this->orderMock); + $this->requestMock->expects($this->once())->method('getPost')->with('history')->willReturn($historyData); + $this->authorizationMock->expects($this->any())->method('isAllowed')->willReturn($userHasResource); + $this->orderMock->expects($this->once()) + ->method('addStatusHistoryComment') + ->willReturn($this->statusHistoryCommentMock); + $this->statusHistoryCommentMock->expects($this->once())->method('setIsCustomerNotified')->with($expectedNotify); + $this->objectManagerMock->expects($this->once())->method('create')->willReturn( + $this->createMock(\Magento\Sales\Model\Order\Email\Sender\OrderCommentSender::class) + ); + + $this->addCommentController->execute(); + } + + /** + * @return array + */ + public function executeWillNotifyCustomerDataProvider() + { + return [ + 'User Has Access - Notify True' => [ + 'postData' => [ + 'comment' => 'Great Product!', + 'is_customer_notified' => true, + 'status' => 'Processing' + ], + 'userHasResource' => true, + 'expectedNotify' => true + ], + 'User Has Access - Notify False' => [ + 'postData' => [ + 'comment' => 'Great Product!', + 'is_customer_notified' => false, + 'status' => 'Processing' + ], + 'userHasResource' => true, + 'expectedNotify' => false + ], + 'User Has Access - Notify Unset' => [ + 'postData' => [ + 'comment' => 'Great Product!', + 'status' => 'Processing' + ], + 'userHasResource' => true, + 'expectedNotify' => false + ], + 'User No Access - Notify True' => [ + 'postData' => [ + 'comment' => 'Great Product!', + 'is_customer_notified' => true, + 'status' => 'Processing' + ], + 'userHasResource' => false, + 'expectedNotify' => false + ], + 'User No Access - Notify False' => [ + 'postData' => [ + 'comment' => 'Great Product!', + 'is_customer_notified' => false, + 'status' => 'Processing' + ], + 'userHasResource' => false, + 'expectedNotify' => false + ], + 'User No Access - Notify Unset' => [ + 'postData' => [ + 'comment' => 'Great Product!', + 'status' => 'Processing' + ], + 'userHasResource' => false, + 'expectedNotify' => false + ], + ]; + } +} From 4d3347c78da87dac832e72b896ca23485b1a508e Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun <mitry@atwix.com> Date: Wed, 28 Nov 2018 11:23:38 +0200 Subject: [PATCH 092/131] Fix: SalesQuoteSaveAfterObserver fails to update the checkout session quote id when applicable #19424 --- .../Checkout/Observer/SalesQuoteSaveAfterObserver.php | 10 ++++++++-- .../Unit/Observer/SalesQuoteSaveAfterObserverTest.php | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Checkout/Observer/SalesQuoteSaveAfterObserver.php b/app/code/Magento/Checkout/Observer/SalesQuoteSaveAfterObserver.php index d926e33d541..6bc7965ff5e 100644 --- a/app/code/Magento/Checkout/Observer/SalesQuoteSaveAfterObserver.php +++ b/app/code/Magento/Checkout/Observer/SalesQuoteSaveAfterObserver.php @@ -7,6 +7,9 @@ use Magento\Framework\Event\ObserverInterface; +/** + * Class SalesQuoteSaveAfterObserver + */ class SalesQuoteSaveAfterObserver implements ObserverInterface { /** @@ -24,15 +27,18 @@ public function __construct(\Magento\Checkout\Model\Session $checkoutSession) } /** + * Assign quote to session + * * @param \Magento\Framework\Event\Observer $observer * @return void */ public function execute(\Magento\Framework\Event\Observer $observer) { + /* @var \Magento\Quote\Model\Quote $quote */ $quote = $observer->getEvent()->getQuote(); - /* @var $quote \Magento\Quote\Model\Quote */ + if ($quote->getIsCheckoutCart()) { - $this->checkoutSession->getQuoteId($quote->getId()); + $this->checkoutSession->setQuoteId($quote->getId()); } } } diff --git a/app/code/Magento/Checkout/Test/Unit/Observer/SalesQuoteSaveAfterObserverTest.php b/app/code/Magento/Checkout/Test/Unit/Observer/SalesQuoteSaveAfterObserverTest.php index 6070bb5d424..dabaf173d90 100644 --- a/app/code/Magento/Checkout/Test/Unit/Observer/SalesQuoteSaveAfterObserverTest.php +++ b/app/code/Magento/Checkout/Test/Unit/Observer/SalesQuoteSaveAfterObserverTest.php @@ -30,13 +30,14 @@ protected function setUp() public function testSalesQuoteSaveAfter() { + $quoteId = 7; $observer = $this->createMock(\Magento\Framework\Event\Observer::class); $observer->expects($this->once())->method('getEvent')->will( $this->returnValue(new \Magento\Framework\DataObject( - ['quote' => new \Magento\Framework\DataObject(['is_checkout_cart' => 1, 'id' => 7])] + ['quote' => new \Magento\Framework\DataObject(['is_checkout_cart' => 1, 'id' => $quoteId])] )) ); - $this->checkoutSession->expects($this->once())->method('getQuoteId')->with(7); + $this->checkoutSession->expects($this->once())->method('setQuoteId')->with($quoteId); $this->object->execute($observer); } From 114f792296c7fbc7c925f2855b7cbbd7c580d4f1 Mon Sep 17 00:00:00 2001 From: Daniel Ruf <daniel.ruf@ueberbit.de> Date: Wed, 28 Nov 2018 12:09:20 +0100 Subject: [PATCH 093/131] fix: remove unused params in categorySubmit invocation --- .../Magento/Catalog/view/adminhtml/web/catalog/category/edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js index 75ee3019cf4..41f7a874c26 100644 --- a/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js +++ b/app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js @@ -82,7 +82,7 @@ define([ return function (config, element) { config = config || {}; jQuery(element).on('click', function () { - categorySubmit(config.url, config.ajax); + categorySubmit(); }); }; }); From 4bf63dadd2df27035063eb24d34c33bc57863470 Mon Sep 17 00:00:00 2001 From: Mahesh Singh <mahesh721@webkul.com> Date: Sun, 18 Nov 2018 17:14:31 +0530 Subject: [PATCH 094/131] issue #19205 fixed --- app/code/Magento/Bundle/Model/Product/Type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index b61df8d7cb1..e5755df2291 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -827,7 +827,7 @@ private function multiToFlatArray(array $array) if (is_array($value)) { $flatArray = array_merge($flatArray, $this->multiToFlatArray($value)); } else { - $flatArray[$key] = $value; + $flatArray[] = $value; } } From 98ae6ae5f81ed8d9a2de2016390289d110756ac6 Mon Sep 17 00:00:00 2001 From: Mahesh Singh <mahesh721@webkul.com> Date: Sun, 18 Nov 2018 18:55:08 +0530 Subject: [PATCH 095/131] removed unused variable --- app/code/Magento/Bundle/Model/Product/Type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Bundle/Model/Product/Type.php b/app/code/Magento/Bundle/Model/Product/Type.php index e5755df2291..c8cd8c15fdb 100644 --- a/app/code/Magento/Bundle/Model/Product/Type.php +++ b/app/code/Magento/Bundle/Model/Product/Type.php @@ -823,7 +823,7 @@ private function recursiveIntval(array $array) private function multiToFlatArray(array $array) { $flatArray = []; - foreach ($array as $key => $value) { + foreach ($array as $value) { if (is_array($value)) { $flatArray = array_merge($flatArray, $this->multiToFlatArray($value)); } else { From 8f22688c3129b973c2bfce69f5871fec1fbcbc92 Mon Sep 17 00:00:00 2001 From: Fabrizio Balliano <fabrizio.balliano@gmail.com> Date: Thu, 29 Nov 2018 11:20:05 +0000 Subject: [PATCH 096/131] min php version fix as written here: https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html the min php version is 7.1.3 but the check in this file was wrong (so also the error messages) --- app/bootstrap.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/bootstrap.php b/app/bootstrap.php index 8e901cac9bf..19283f37d59 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -11,15 +11,15 @@ #ini_set('display_errors', 1); /* PHP version validation */ -if (!defined('PHP_VERSION_ID') || !(PHP_VERSION_ID === 70002 || PHP_VERSION_ID === 70004 || PHP_VERSION_ID >= 70006)) { +if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70103) { if (PHP_SAPI == 'cli') { - echo 'Magento supports 7.0.2, 7.0.4, and 7.0.6 or later. ' . - 'Please read http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html'; + echo 'Magento supports 7.1.3 or later. ' . + 'Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html'; } else { echo <<<HTML <div style="font:12px/1.35em arial, helvetica, sans-serif;"> - <p>Magento supports PHP 7.0.2, 7.0.4, and 7.0.6 or later. Please read - <a target="_blank" href="http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements.html"> + <p>Magento supports PHP 7.1.3 or later. Please read + <a target="_blank" href="https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html"> Magento System Requirements</a>. </div> HTML; From 381c3a04b114c14e442157747b2ab90834104753 Mon Sep 17 00:00:00 2001 From: Fabrizio Balliano <fabrizio.balliano@gmail.com> Date: Thu, 29 Nov 2018 11:52:04 +0000 Subject: [PATCH 097/131] sys requirements link updated --- app/bootstrap.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/bootstrap.php b/app/bootstrap.php index 19283f37d59..40043d4b01c 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -14,12 +14,12 @@ if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70103) { if (PHP_SAPI == 'cli') { echo 'Magento supports 7.1.3 or later. ' . - 'Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html'; + 'Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html'; } else { echo <<<HTML <div style="font:12px/1.35em arial, helvetica, sans-serif;"> <p>Magento supports PHP 7.1.3 or later. Please read - <a target="_blank" href="https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html"> + <a target="_blank" href="https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html"> Magento System Requirements</a>. </div> HTML; From ebce9f357021babb30fcffe01cc8ae7bfbdfe8d9 Mon Sep 17 00:00:00 2001 From: Vlad Veselov <orlangur@users.noreply.github.com> Date: Thu, 29 Nov 2018 14:09:11 +0200 Subject: [PATCH 098/131] Make messages consistent --- app/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/bootstrap.php b/app/bootstrap.php index 40043d4b01c..0b13d12cece 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -13,7 +13,7 @@ /* PHP version validation */ if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70103) { if (PHP_SAPI == 'cli') { - echo 'Magento supports 7.1.3 or later. ' . + echo 'Magento supports PHP 7.1.3 or later. ' . 'Please read https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html'; } else { echo <<<HTML From e3a8af60bd5cd7bc141da21bb57ec99d743f7db2 Mon Sep 17 00:00:00 2001 From: Max <omaxmo@users.noreply.github.com> Date: Thu, 29 Nov 2018 16:54:14 +0200 Subject: [PATCH 099/131] Update Invoice.php you can't cancel invoice if state == paid, If state == paid, you can do the credit memo. When you create an invoice and realise that it needs to be cancelled, be aware that there are some legal restrictions involved. Technically, you should never delete an issued invoice but instead use a credit note to cancel the invoice. --- app/code/Magento/Sales/Model/Order/Invoice.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/Invoice.php b/app/code/Magento/Sales/Model/Order/Invoice.php index 3f2fa1f72f6..e0cd96cd54d 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Order/Invoice.php @@ -445,10 +445,6 @@ public function cancel() $order->setBaseDiscountInvoiced($order->getBaseDiscountInvoiced() - $this->getBaseDiscountAmount()); $order->setBaseTotalInvoicedCost($order->getBaseTotalInvoicedCost() - $this->getBaseCost()); - if ($this->getState() == self::STATE_PAID) { - $order->setTotalPaid($order->getTotalPaid() - $this->getGrandTotal()); - $order->setBaseTotalPaid($order->getBaseTotalPaid() - $this->getBaseGrandTotal()); - } $this->setState(self::STATE_CANCELED); $order->setState(\Magento\Sales\Model\Order::STATE_PROCESSING) ->setStatus($order->getConfig()->getStateDefaultStatus(\Magento\Sales\Model\Order::STATE_PROCESSING)); From db6e9046bf91a74b2119aaf9df3b2a0b9c519dd5 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Thu, 29 Nov 2018 08:56:33 -0600 Subject: [PATCH 100/131] MC-5328: Update tax rate, 100 rate --- .../Tax/Test/Mftf/Data/TaxRateData.xml | 48 +++++++++++++++ .../Tax/Test/Mftf/Metadata/tax_rate-meta.xml | 25 ++++++++ .../Mftf/Test/Update100TaxRateEntityTest.xml | 60 +++++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 app/code/Magento/Tax/Test/Mftf/Metadata/tax_rate-meta.xml create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml index 7a8dc35e796..de40b448311 100644 --- a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml +++ b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml @@ -10,4 +10,52 @@ <entity name="SimpleTaxRate" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> </entity> + <entity name="taxRateCustomRateUS" type="taxRate"> + <data key="code" unique="suffix">Tax Rate </data> + <data key="tax_country_id">US</data> + <data key="tax_region_id">12</data> + <data key="tax_postcode">90001</data> + <data key="zip_is_range">0</data> + <data key="rate">100</data> + </entity> + <entity name="defaultTaxRateWithZipRange" type="taxRate"> + <data key="code" unique="suffix">Tax Rate </data> + <data key="tax_country_id">United States</data> + <data key="tax_region_id">12</data> + <data key="zip_is_range">1</data> + <data key="zip_from">90001</data> + <data key="zip_to">96162</data> + <data key="rate">15.05</data> + </entity> + <entity name="defaultTaxRateWithLargeRate" type="taxRate"> + <data key="code" unique="suffix">TaxRate</data> + <data key="tax_country_id">United Kingdom</data> + <data key="tax_postcode">*</data> + <data key="zip_is_range">0</data> + <data key="rate">777</data> + </entity> + <entity name="taxRateCustomRateCanada" type="taxRate"> + <data key="code" unique="suffix">TaxRate</data> + <data key="tax_country_id">Canada</data> + <data key="tax_region_id">*</data> + <data key="tax_postcode">180</data> + <data key="zip_is_range">0</data> + <data key="rate">25</data> + </entity> + <entity name="taxRateCustomRateUK" type="taxRate"> + <data key="code" unique="suffix">TaxRate</data> + <data key="tax_country_id">United Kingdom</data> + <data key="zip_is_range">1</data> + <data key="zip_from">1</data> + <data key="zip_to">7800935</data> + <data key="rate">12.99</data> + </entity> + <entity name="taxRateCustomRateFrance" type="taxRate"> + <data key="code" unique="suffix">TaxRate</data> + <data key="tax_country_id">France</data> + <data key="tax_region_id">277</data> + <data key="tax_postcode">*</data> + <data key="zip_is_range">0</data> + <data key="rate">0.1</data> + </entity> </entities> diff --git a/app/code/Magento/Tax/Test/Mftf/Metadata/tax_rate-meta.xml b/app/code/Magento/Tax/Test/Mftf/Metadata/tax_rate-meta.xml new file mode 100644 index 00000000000..1951ae05831 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Metadata/tax_rate-meta.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd"> + <operation name="CreateTaxRate" dataType="taxRate" type="create" auth="adminOauth" url="/V1/taxRates" method="POST"> + <contentType>application/json</contentType> + <object key="taxRate" dataType="taxRate"> + <field key="id">integer</field> + <field key="tax_country_id">string</field> + <field key="tax_region_id">integer</field> + <field key="tax_postcode">string</field> + <field key="zip_is_range">integer</field> + <field key="rate">integer</field> + <field key="code">string</field> + </object> + </operation> + <operation name="DeleteTaxRate" dataType="taxRate" type="delete" auth="adminOauth" url="/V1/taxRates/{id}" method="DELETE"> + <contentType>application/json</contentType> + </operation> +</operations> \ No newline at end of file diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml new file mode 100644 index 00000000000..31c9a017389 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="Update100TaxRateEntityTest"> + <annotations> + <stories value="Update Tax Rate"/> + <title value="Update tax rate, 100 rate"/> + <description value="Test log in to Tax Rate and Update 100 Rate"/> + <testCaseId value="MC-5328"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <createData entity="taxRateCustomRateUS" stepKey="createTaxRateCustomRateUS"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData stepKey="deleteTaxRate" createDataKey="createTaxRateCustomRateUS" /> + </after> + + <!-- Search the tax rate on tax grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$createTaxRateCustomRateUS.code$$" stepKey="fillCode"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> + + <!-- Update values on the tax rate form page --> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="United States" stepKey="selectCountry1"/> + <selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="California" stepKey="selectState"/> + <fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="90001" stepKey="fillPostCode"/> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="100" stepKey="fillRate1"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <!-- Verify we see updated TaxIdentifier(from the above step) on the tax rate grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex4"/> + <waitForPageLoad stepKey="waitForTaxRateIndex2"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField3"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> + <!-- Verify we see updated values on the tax rate form page --> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeRTaxIdentifier"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="United States" stepKey="seeCountry2"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="California" stepKey="seeState2"/> + <seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="90001" stepKey="seeZipCode"/> + <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="100" stepKey="seeRate2"/> + </test> +</tests> From 447ad4763d9b614e2e86862f137578a9b1e47637 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Thu, 29 Nov 2018 11:22:47 -0600 Subject: [PATCH 101/131] MC-5328: Update tax rate, 100 rate - Fix test to update all fields --- .../Tax/Test/Mftf/Data/TaxRateData.xml | 22 +++++++++++---- .../Mftf/Test/Update100TaxRateEntityTest.xml | 28 +++++++++---------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml index de40b448311..22eef75989d 100644 --- a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml +++ b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml @@ -10,17 +10,27 @@ <entity name="SimpleTaxRate" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> </entity> + <entity name="defaultTaxRate" type="taxRate"> + <data key="code" unique="suffix">Tax Rate </data> + <data key="tax_country_id">US</data> + <data key="tax_region_id">12</data> + <data key="tax_postcode">*</data> + <data key="zip_is_range">0</data> + <data key="rate">10</data> + </entity> <entity name="taxRateCustomRateUS" type="taxRate"> <data key="code" unique="suffix">Tax Rate </data> <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> <data key="tax_region_id">12</data> + <data key="tax_region">California</data> <data key="tax_postcode">90001</data> <data key="zip_is_range">0</data> - <data key="rate">100</data> + <data key="rate">100.0000</data> </entity> <entity name="defaultTaxRateWithZipRange" type="taxRate"> <data key="code" unique="suffix">Tax Rate </data> - <data key="tax_country_id">United States</data> + <data key="tax_country_id">US</data> <data key="tax_region_id">12</data> <data key="zip_is_range">1</data> <data key="zip_from">90001</data> @@ -29,14 +39,14 @@ </entity> <entity name="defaultTaxRateWithLargeRate" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">United Kingdom</data> + <data key="tax_country_id">GB</data> <data key="tax_postcode">*</data> <data key="zip_is_range">0</data> <data key="rate">777</data> </entity> <entity name="taxRateCustomRateCanada" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">Canada</data> + <data key="tax_country_id">CA</data> <data key="tax_region_id">*</data> <data key="tax_postcode">180</data> <data key="zip_is_range">0</data> @@ -44,7 +54,7 @@ </entity> <entity name="taxRateCustomRateUK" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">United Kingdom</data> + <data key="tax_country_id">GB</data> <data key="zip_is_range">1</data> <data key="zip_from">1</data> <data key="zip_to">7800935</data> @@ -52,7 +62,7 @@ </entity> <entity name="taxRateCustomRateFrance" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">France</data> + <data key="tax_country_id">FR</data> <data key="tax_region_id">277</data> <data key="tax_postcode">*</data> <data key="zip_is_range">0</data> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml index 31c9a017389..27a7f2c5172 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update100TaxRateEntityTest.xml @@ -19,27 +19,27 @@ <group value="mtf_migrated"/> </annotations> <before> - <createData entity="taxRateCustomRateUS" stepKey="createTaxRateCustomRateUS"/> + <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> </before> <after> - <deleteData stepKey="deleteTaxRate" createDataKey="createTaxRateCustomRateUS" /> + <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> </after> <!-- Search the tax rate on tax grid page --> <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> <waitForPageLoad stepKey="waitForTaxRateIndex1"/> <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$createTaxRateCustomRateUS.code$$" stepKey="fillCode"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> <!-- Update values on the tax rate form page --> - <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField2"/> - <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="United States" stepKey="selectCountry1"/> - <selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="California" stepKey="selectState"/> - <fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="90001" stepKey="fillPostCode"/> - <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="100" stepKey="fillRate1"/> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{taxRateCustomRateUS.code}}" stepKey="fillTaxIdentifierField2"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="{{taxRateCustomRateUS.tax_country_id}}" stepKey="selectCountry1"/> + <selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="{{taxRateCustomRateUS.tax_region_id}}" stepKey="selectState"/> + <fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="{{taxRateCustomRateUS.tax_postcode}}" stepKey="fillPostCode"/> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{taxRateCustomRateUS.rate}}" stepKey="fillRate1"/> <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> @@ -47,14 +47,14 @@ <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex4"/> <waitForPageLoad stepKey="waitForTaxRateIndex2"/> <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> - <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="fillTaxIdentifierField3"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateUS.code}}" stepKey="fillTaxIdentifierField3"/> <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> <!-- Verify we see updated values on the tax rate form page --> - <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{SimpleTaxRate.code}}" stepKey="seeRTaxIdentifier"/> - <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="United States" stepKey="seeCountry2"/> - <seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="California" stepKey="seeState2"/> - <seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="90001" stepKey="seeZipCode"/> - <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="100" stepKey="seeRate2"/> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{taxRateCustomRateUS.code}}" stepKey="seeRTaxIdentifier"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="{{taxRateCustomRateUS.tax_country}}" stepKey="seeCountry2"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="{{taxRateCustomRateUS.tax_region}}" stepKey="seeState2"/> + <seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="{{taxRateCustomRateUS.tax_postcode}}" stepKey="seeZipCode"/> + <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{taxRateCustomRateUS.rate}}" stepKey="seeRate2"/> </test> </tests> From c25ff0615ff0e072d57ea02b9a5e02a318b693d6 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Thu, 29 Nov 2018 13:27:43 -0600 Subject: [PATCH 102/131] MC-5329: Update tax rate, decimal rate --- .../Tax/Test/Mftf/Data/TaxRateData.xml | 33 +--------- .../Tax/Test/Mftf/Metadata/tax_rate-meta.xml | 2 + .../Test/UpdateDecimalTaxRateEntityTest.xml | 64 +++++++++++++++++++ 3 files changed, 68 insertions(+), 31 deletions(-) create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml index 22eef75989d..463aeda5b6c 100644 --- a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml +++ b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml @@ -31,41 +31,12 @@ <entity name="defaultTaxRateWithZipRange" type="taxRate"> <data key="code" unique="suffix">Tax Rate </data> <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> <data key="tax_region_id">12</data> + <data key="tax_region">California</data> <data key="zip_is_range">1</data> <data key="zip_from">90001</data> <data key="zip_to">96162</data> <data key="rate">15.05</data> </entity> - <entity name="defaultTaxRateWithLargeRate" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">GB</data> - <data key="tax_postcode">*</data> - <data key="zip_is_range">0</data> - <data key="rate">777</data> - </entity> - <entity name="taxRateCustomRateCanada" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">CA</data> - <data key="tax_region_id">*</data> - <data key="tax_postcode">180</data> - <data key="zip_is_range">0</data> - <data key="rate">25</data> - </entity> - <entity name="taxRateCustomRateUK" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">GB</data> - <data key="zip_is_range">1</data> - <data key="zip_from">1</data> - <data key="zip_to">7800935</data> - <data key="rate">12.99</data> - </entity> - <entity name="taxRateCustomRateFrance" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">FR</data> - <data key="tax_region_id">277</data> - <data key="tax_postcode">*</data> - <data key="zip_is_range">0</data> - <data key="rate">0.1</data> - </entity> </entities> diff --git a/app/code/Magento/Tax/Test/Mftf/Metadata/tax_rate-meta.xml b/app/code/Magento/Tax/Test/Mftf/Metadata/tax_rate-meta.xml index 1951ae05831..3f192920c5c 100644 --- a/app/code/Magento/Tax/Test/Mftf/Metadata/tax_rate-meta.xml +++ b/app/code/Magento/Tax/Test/Mftf/Metadata/tax_rate-meta.xml @@ -15,6 +15,8 @@ <field key="tax_region_id">integer</field> <field key="tax_postcode">string</field> <field key="zip_is_range">integer</field> + <field key="zip_from">integer</field> + <field key="zip_to">integer</field> <field key="rate">integer</field> <field key="code">string</field> </object> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml new file mode 100644 index 00000000000..30024521969 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateDecimalTaxRateEntityTest.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="UpdateDecimalTaxRateEntityTest"> + <annotations> + <stories value="Update Tax Rate"/> + <title value="Update tax rate, decimal rate"/> + <description value="Test log in to Tax Rate and Update Decimal Tax Rate"/> + <testCaseId value="MC-5329"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> + </after> + + <!-- Search the tax rate on tax grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> + + <!-- Update decimal tax rate on the tax rate form page --> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{defaultTaxRateWithZipRange.code}}" stepKey="fillTaxIdentifierField2"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="{{defaultTaxRateWithZipRange.tax_country_id}}" stepKey="selectCountry1"/> + <selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="{{defaultTaxRateWithZipRange.tax_region_id}}" stepKey="selectState"/> + <checkOption selector="{{AdminTaxRateFormSection.zipRange}}" stepKey="checkZipRange"/> + <fillField selector="{{AdminTaxRateFormSection.rangeFrom}}" userInput="{{defaultTaxRateWithZipRange.zip_from}}" stepKey="fillZipFrom"/> + <fillField selector="{{AdminTaxRateFormSection.rangeTo}}" userInput="{{defaultTaxRateWithZipRange.zip_to}}" stepKey="fillZipTo"/> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{defaultTaxRateWithZipRange.rate}}" stepKey="fillRate1"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <!-- Verify we see updated tax rate(from the above step) on the tax rate grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/> + <waitForPageLoad stepKey="waitForTaxRateIndex2"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{defaultTaxRateWithZipRange.code}}" stepKey="fillTaxIdentifierField3"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> + <!-- Verify we see updated tax rate on the tax rate form page --> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{defaultTaxRateWithZipRange.code}}" stepKey="seeRTaxIdentifier"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="{{defaultTaxRateWithZipRange.tax_country}}" stepKey="seeCountry2"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="{{defaultTaxRateWithZipRange.tax_region}}" stepKey="seeState2"/> + <seeCheckboxIsChecked selector="{{AdminTaxRateFormSection.zipRange}}" stepKey="seeZipRange"/> + <seeInField selector="{{AdminTaxRateFormSection.rangeFrom}}" userInput="{{defaultTaxRateWithZipRange.zip_from}}" stepKey="seeTaxPostCode2"/> + <seeInField selector="{{AdminTaxRateFormSection.rangeTo}}" userInput="{{defaultTaxRateWithZipRange.zip_to}}" stepKey="seeTaxPostCode3"/> + <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{defaultTaxRateWithZipRange.rate}}" stepKey="seeRate2"/> + </test> +</tests> From 1e919a577dd950d8e4d776c050ddbc94e6135492 Mon Sep 17 00:00:00 2001 From: Kajal Solanki <kajal.solanki@krishtechnolabs.com> Date: Fri, 30 Nov 2018 11:41:33 +0530 Subject: [PATCH 103/131] solved Customer group textbox-selectbox alignment issue-19472 --- .../Magento/backend/web/css/source/forms/_controls.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/_controls.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/_controls.less index bb51abaa0f1..f971246ab46 100644 --- a/app/design/adminhtml/Magento/backend/web/css/source/forms/_controls.less +++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/_controls.less @@ -75,9 +75,9 @@ max-width: 100%; min-width: 8.5rem; - padding-bottom: @field-control__padding-bottom - .1rem; + padding-bottom: @field-control__padding-bottom; padding-right: 4.4rem; // Distance between select switch and inner text - padding-top: @field-control__padding-top - .1rem; + padding-top: @field-control__padding-top; transition: @smooth__border-color; &:hover { From c3f6889257908193cce7051ee908cc6c2c833733 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Fri, 30 Nov 2018 11:38:39 +0200 Subject: [PATCH 104/131] ENGCOM-3576: Integration test fix. --- .../testsuite/Magento/Email/Model/TemplateTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php index a83de07443e..7789a79794f 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php @@ -315,25 +315,25 @@ public function templateDirectiveDataProvider() Area::AREA_FRONTEND, TemplateTypesInterface::TYPE_HTML, '{{template config_path="customer/create_account/email_template"}}', - '<b>customer_create_account_email_template template from Vendor/custom_theme</b>', + '<strong>customer_create_account_email_template template from Vendor/custom_theme</strong>', ], 'Template from parent theme - frontend' => [ Area::AREA_FRONTEND, TemplateTypesInterface::TYPE_HTML, '{{template config_path="customer/create_account/email_confirmation_template"}}', - '<b>customer_create_account_email_confirmation_template template from Vendor/default</b>', + '<strong>customer_create_account_email_confirmation_template template from Vendor/default</strong', ], 'Template from grandparent theme - frontend' => [ Area::AREA_FRONTEND, TemplateTypesInterface::TYPE_HTML, '{{template config_path="customer/create_account/email_confirmed_template"}}', - '<b>customer_create_account_email_confirmed_template template from Magento/default</b>', + '<strong>customer_create_account_email_confirmed_template template from Magento/default</strong', ], 'Template from grandparent theme - adminhtml' => [ BackendFrontNameResolver::AREA_CODE, TemplateTypesInterface::TYPE_HTML, '{{template config_path="catalog/productalert_cron/error_email_template"}}', - '<b>catalog_productalert_cron_error_email_template template from Magento/default</b>', + '<strong>catalog_productalert_cron_error_email_template template from Magento/default</strong', null, null, true, From ca0da34ee2691bfaca1c74d94a0db33377d4e54c Mon Sep 17 00:00:00 2001 From: GovindaSharma <govindpokhrelsharma@cedcoss.com> Date: Mon, 26 Nov 2018 16:55:35 +0530 Subject: [PATCH 105/131] Fixed issue related to 'product_attribute' attribute. Added condition for validating product attribute. --- .../Catalog/Controller/Adminhtml/Product/Attribute/Validate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8a9d0c9b612..381ca5d08d8 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Attribute/Validate.php @@ -105,7 +105,7 @@ public function execute() $attributeCode ); - if ($attribute->getId() && !$attributeId) { + if ($attribute->getId() && !$attributeId || $attributeCode === 'product_type') { $message = strlen($this->getRequest()->getParam('attribute_code')) ? __('An attribute with this code already exists.') : __('An attribute with the same code (%1) already exists.', $attributeCode); From 6475ef2cebde6321ab8ddb6a5234d99a2fb491ad Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Fri, 30 Nov 2018 14:42:52 +0200 Subject: [PATCH 106/131] ENGCOM-3594: Static test fix. --- .../Magento/Sales/Model/Order/Invoice.php | 107 ++++++++++-------- 1 file changed, 59 insertions(+), 48 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/Invoice.php b/app/code/Magento/Sales/Model/Order/Invoice.php index e0cd96cd54d..14dd0b14ac1 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Order/Invoice.php @@ -11,6 +11,8 @@ use Magento\Sales\Model\EntityInterface; /** + * Invoice model. + * * @api * @method \Magento\Sales\Model\Order\Invoice setSendEmail(bool $value) * @method \Magento\Sales\Model\Order\Invoice setCustomerNote(string $value) @@ -504,6 +506,8 @@ public function getItemsCollection() } /** + * Get all Invoice Items. + * * @return array */ public function getAllItems() @@ -518,6 +522,8 @@ public function getAllItems() } /** + * Get Invoice Item by id. + * * @param int|string $itemId * @return bool|\Magento\Sales\Model\Order\Invoice\Item */ @@ -532,8 +538,11 @@ public function getItemById($itemId) } /** + * Add Item to Invoice. + * * @param \Magento\Sales\Model\Order\Invoice\Item $item * @return $this + * @throws \Exception */ public function addItem(\Magento\Sales\Model\Order\Invoice\Item $item) { @@ -678,13 +687,13 @@ public function isLast() } /** - * Adds comment to invoice with additional possibility to send it to customer via email - * and show it in customer account + * Add comment with possibility to send it to customer via email and show it in customer account. * * @param string $comment * @param bool $notify * @param bool $visibleOnFront * @return $this + * @throws \Exception */ public function addComment($comment, $notify = false, $visibleOnFront = false) { @@ -706,6 +715,8 @@ public function addComment($comment, $notify = false, $visibleOnFront = false) } /** + * Get Invoice comments. + * * @param bool $reload * @return \Magento\Sales\Model\ResourceModel\Order\Invoice\Comment\Collection */ @@ -835,7 +846,7 @@ public function getDiscountDescription() } /** - * {@inheritdoc} + * @inheritdoc */ public function setItems($items) { @@ -1003,7 +1014,7 @@ public function getCreatedAt() } /** - * {@inheritdoc} + * @inheritdoc */ public function setCreatedAt($createdAt) { @@ -1262,7 +1273,7 @@ public function getUpdatedAt() } /** - * {@inheritdoc} + * @inheritdoc */ public function setComments($comments) { @@ -1270,7 +1281,7 @@ public function setComments($comments) } /** - * {@inheritdoc} + * @inheritdoc */ public function setUpdatedAt($timestamp) { @@ -1278,7 +1289,7 @@ public function setUpdatedAt($timestamp) } /** - * {@inheritdoc} + * @inheritdoc */ public function setStoreId($id) { @@ -1286,7 +1297,7 @@ public function setStoreId($id) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseGrandTotal($amount) { @@ -1294,7 +1305,7 @@ public function setBaseGrandTotal($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setShippingTaxAmount($amount) { @@ -1302,7 +1313,7 @@ public function setShippingTaxAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setTaxAmount($amount) { @@ -1310,7 +1321,7 @@ public function setTaxAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseTaxAmount($amount) { @@ -1318,7 +1329,7 @@ public function setBaseTaxAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setStoreToOrderRate($rate) { @@ -1326,7 +1337,7 @@ public function setStoreToOrderRate($rate) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseShippingTaxAmount($amount) { @@ -1334,7 +1345,7 @@ public function setBaseShippingTaxAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseDiscountAmount($amount) { @@ -1342,7 +1353,7 @@ public function setBaseDiscountAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseToOrderRate($rate) { @@ -1350,7 +1361,7 @@ public function setBaseToOrderRate($rate) } /** - * {@inheritdoc} + * @inheritdoc */ public function setGrandTotal($amount) { @@ -1358,7 +1369,7 @@ public function setGrandTotal($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setShippingAmount($amount) { @@ -1366,7 +1377,7 @@ public function setShippingAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setSubtotalInclTax($amount) { @@ -1374,7 +1385,7 @@ public function setSubtotalInclTax($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseSubtotalInclTax($amount) { @@ -1382,7 +1393,7 @@ public function setBaseSubtotalInclTax($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setStoreToBaseRate($rate) { @@ -1390,7 +1401,7 @@ public function setStoreToBaseRate($rate) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseShippingAmount($amount) { @@ -1398,7 +1409,7 @@ public function setBaseShippingAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setTotalQty($qty) { @@ -1406,7 +1417,7 @@ public function setTotalQty($qty) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseToGlobalRate($rate) { @@ -1414,7 +1425,7 @@ public function setBaseToGlobalRate($rate) } /** - * {@inheritdoc} + * @inheritdoc */ public function setSubtotal($amount) { @@ -1422,7 +1433,7 @@ public function setSubtotal($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseSubtotal($amount) { @@ -1430,7 +1441,7 @@ public function setBaseSubtotal($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setDiscountAmount($amount) { @@ -1438,7 +1449,7 @@ public function setDiscountAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBillingAddressId($id) { @@ -1446,7 +1457,7 @@ public function setBillingAddressId($id) } /** - * {@inheritdoc} + * @inheritdoc */ public function setIsUsedForRefund($isUsedForRefund) { @@ -1454,7 +1465,7 @@ public function setIsUsedForRefund($isUsedForRefund) } /** - * {@inheritdoc} + * @inheritdoc */ public function setOrderId($id) { @@ -1462,7 +1473,7 @@ public function setOrderId($id) } /** - * {@inheritdoc} + * @inheritdoc */ public function setEmailSent($emailSent) { @@ -1470,7 +1481,7 @@ public function setEmailSent($emailSent) } /** - * {@inheritdoc} + * @inheritdoc */ public function setCanVoidFlag($canVoidFlag) { @@ -1478,7 +1489,7 @@ public function setCanVoidFlag($canVoidFlag) } /** - * {@inheritdoc} + * @inheritdoc */ public function setState($state) { @@ -1486,7 +1497,7 @@ public function setState($state) } /** - * {@inheritdoc} + * @inheritdoc */ public function setShippingAddressId($id) { @@ -1494,7 +1505,7 @@ public function setShippingAddressId($id) } /** - * {@inheritdoc} + * @inheritdoc */ public function setStoreCurrencyCode($code) { @@ -1502,7 +1513,7 @@ public function setStoreCurrencyCode($code) } /** - * {@inheritdoc} + * @inheritdoc */ public function setOrderCurrencyCode($code) { @@ -1510,7 +1521,7 @@ public function setOrderCurrencyCode($code) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseCurrencyCode($code) { @@ -1518,7 +1529,7 @@ public function setBaseCurrencyCode($code) } /** - * {@inheritdoc} + * @inheritdoc */ public function setGlobalCurrencyCode($code) { @@ -1526,7 +1537,7 @@ public function setGlobalCurrencyCode($code) } /** - * {@inheritdoc} + * @inheritdoc */ public function setIncrementId($id) { @@ -1534,7 +1545,7 @@ public function setIncrementId($id) } /** - * {@inheritdoc} + * @inheritdoc */ public function setDiscountTaxCompensationAmount($amount) { @@ -1542,7 +1553,7 @@ public function setDiscountTaxCompensationAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseDiscountTaxCompensationAmount($amount) { @@ -1550,7 +1561,7 @@ public function setBaseDiscountTaxCompensationAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setShippingDiscountTaxCompensationAmount($amount) { @@ -1558,7 +1569,7 @@ public function setShippingDiscountTaxCompensationAmount($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseShippingDiscountTaxCompensationAmnt($amnt) { @@ -1566,7 +1577,7 @@ public function setBaseShippingDiscountTaxCompensationAmnt($amnt) } /** - * {@inheritdoc} + * @inheritdoc */ public function setShippingInclTax($amount) { @@ -1574,7 +1585,7 @@ public function setShippingInclTax($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseShippingInclTax($amount) { @@ -1582,7 +1593,7 @@ public function setBaseShippingInclTax($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setBaseTotalRefunded($amount) { @@ -1590,7 +1601,7 @@ public function setBaseTotalRefunded($amount) } /** - * {@inheritdoc} + * @inheritdoc */ public function setDiscountDescription($description) { @@ -1598,7 +1609,7 @@ public function setDiscountDescription($description) } /** - * {@inheritdoc} + * @inheritdoc * * @return \Magento\Sales\Api\Data\InvoiceExtensionInterface|null */ @@ -1608,7 +1619,7 @@ public function getExtensionAttributes() } /** - * {@inheritdoc} + * @inheritdoc * * @param \Magento\Sales\Api\Data\InvoiceExtensionInterface $extensionAttributes * @return $this From 8e8aa0db64b4d48f4875684890ab9600887cfff7 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Fri, 30 Nov 2018 09:06:05 -0600 Subject: [PATCH 107/131] MC-5330: Update tax rate, large rate --- .../Tax/Test/Mftf/Data/TaxRateData.xml | 25 +------- .../Test/UpdateLargeTaxRateEntityTest.xml | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+), 24 deletions(-) create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml index 22eef75989d..a42579763e1 100644 --- a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml +++ b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml @@ -40,32 +40,9 @@ <entity name="defaultTaxRateWithLargeRate" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> <data key="tax_country_id">GB</data> + <data key="tax_country">United Kingdom</data> <data key="tax_postcode">*</data> <data key="zip_is_range">0</data> <data key="rate">777</data> </entity> - <entity name="taxRateCustomRateCanada" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">CA</data> - <data key="tax_region_id">*</data> - <data key="tax_postcode">180</data> - <data key="zip_is_range">0</data> - <data key="rate">25</data> - </entity> - <entity name="taxRateCustomRateUK" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">GB</data> - <data key="zip_is_range">1</data> - <data key="zip_from">1</data> - <data key="zip_to">7800935</data> - <data key="rate">12.99</data> - </entity> - <entity name="taxRateCustomRateFrance" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">FR</data> - <data key="tax_region_id">277</data> - <data key="tax_postcode">*</data> - <data key="zip_is_range">0</data> - <data key="rate">0.1</data> - </entity> </entities> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml new file mode 100644 index 00000000000..6c81a6aeb3f --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateLargeTaxRateEntityTest.xml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="UpdateLargeTaxRateEntityTest"> + <annotations> + <stories value="Update Tax Rate"/> + <title value="Update tax rate, large rate"/> + <description value="Test log in to Tax Rate and Update Large Rate"/> + <testCaseId value="MC-5330"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> + </after> + + <!-- Search the tax rate on tax grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> + + <!-- Update large tax rate on the tax rate form page --> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{defaultTaxRateWithLargeRate.code}}" stepKey="fillTaxIdentifierField2"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="{{defaultTaxRateWithLargeRate.tax_country_id}}" stepKey="selectCountry1"/> + <fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="{{defaultTaxRateWithLargeRate.tax_postcode}}" stepKey="fillPostCode"/> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{defaultTaxRateWithLargeRate.rate}}" stepKey="fillRate1"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <!-- Verify we see updated large tax rate(from the above step) on the tax rate grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex4"/> + <waitForPageLoad stepKey="waitForTaxRateIndex2"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{defaultTaxRateWithLargeRate.code}}" stepKey="fillTaxIdentifierField3"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> + <!-- Verify we see updated large tax rate on the tax rate form page --> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{defaultTaxRateWithLargeRate.code}}" stepKey="seeRTaxIdentifier"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="{{defaultTaxRateWithLargeRate.tax_country}}" stepKey="seeCountry2"/> + <seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="{{defaultTaxRateWithLargeRate.tax_postcode}}" stepKey="seeZipCode"/> + <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{defaultTaxRateWithLargeRate.rate}}" stepKey="seeRate2"/> + </test> +</tests> From fe7ab8cfb177065cf697e60dede502dc75cd27d5 Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Thu, 29 Nov 2018 20:20:58 -0600 Subject: [PATCH 108/131] MC-5596: Comments are not being added in Credit memo emails --- app/code/Magento/Sales/Model/Order/Creditmemo.php | 6 +++--- .../Magento/Sales/Model/Order/CreditmemoDocumentFactory.php | 4 ++++ .../Test/Unit/Model/Order/CreditmemoDocumentFactoryTest.php | 5 ++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Creditmemo.php index 20cec812402..cba45be6dfb 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo.php @@ -19,10 +19,10 @@ * Order creditmemo model * * @api - * @method \Magento\Sales\Model\Order\Invoice setSendEmail(bool $value) - * @method \Magento\Sales\Model\Order\Invoice setCustomerNote(string $value) + * @method \Magento\Sales\Model\Order\Creditmemo setSendEmail(bool $value) + * @method \Magento\Sales\Model\Order\Creditmemo setCustomerNote(string $value) * @method string getCustomerNote() - * @method \Magento\Sales\Model\Order\Invoice setCustomerNoteNotify(bool $value) + * @method \Magento\Sales\Model\Order\Creditmemo setCustomerNoteNotify(bool $value) * @method bool getCustomerNoteNotify() * @SuppressWarnings(PHPMD.ExcessivePublicCount) * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) diff --git a/app/code/Magento/Sales/Model/Order/CreditmemoDocumentFactory.php b/app/code/Magento/Sales/Model/Order/CreditmemoDocumentFactory.php index 65c1788c68d..6939988ba3d 100644 --- a/app/code/Magento/Sales/Model/Order/CreditmemoDocumentFactory.php +++ b/app/code/Magento/Sales/Model/Order/CreditmemoDocumentFactory.php @@ -99,11 +99,13 @@ private function attachComment( ->setCreditmemo($creditmemo) ->setIsCustomerNotified($appendComment); $creditmemo->setComments([$comment]); + $creditmemo->setCustomerNote($comment->getComment()); return $creditmemo; } /** * Create new Creditmemo + * * @param \Magento\Sales\Api\Data\OrderInterface $order * @param \Magento\Sales\Api\Data\CreditmemoItemCreationInterface[] $items * @param \Magento\Sales\Api\Data\CreditmemoCommentCreationInterface|null $comment @@ -128,6 +130,8 @@ public function createFromOrder( } /** + * Create credit memo from invoice + * * @param \Magento\Sales\Api\Data\InvoiceInterface $invoice * @param \Magento\Sales\Api\Data\CreditmemoItemCreationInterface[] $items * @param \Magento\Sales\Api\Data\CreditmemoCommentCreationInterface|null $comment diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoDocumentFactoryTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoDocumentFactoryTest.php index cb65b70b827..dc183069427 100644 --- a/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoDocumentFactoryTest.php +++ b/app/code/Magento/Sales/Test/Unit/Model/Order/CreditmemoDocumentFactoryTest.php @@ -12,7 +12,6 @@ use Magento\Sales\Api\Data\CreditmemoCommentInterface; use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Invoice; -use Magento\Sales\Api\Data\CreditmemoInterface; use Magento\Sales\Api\Data\CreditmemoItemCreationInterface; use Magento\Sales\Api\Data\CreditmemoCommentCreationInterface; use Magento\Framework\EntityManager\HydratorPool; @@ -82,7 +81,7 @@ class CreditmemoDocumentFactoryTest extends \PHPUnit\Framework\TestCase private $commentCreationArgumentsMock; /** - * @var CreditmemoInterface|\PHPUnit_Framework_MockObject_MockObject + * @var Order\Creditmemo|\PHPUnit_Framework_MockObject_MockObject */ private $creditmemoMock; @@ -121,7 +120,7 @@ public function setUp() $this->creditmemoItemCreationMock = $this->getMockBuilder(CreditmemoItemCreationInterface::class) ->disableOriginalConstructor() ->getMock(); - $this->creditmemoMock = $this->getMockBuilder(CreditmemoInterface::class) + $this->creditmemoMock = $this->getMockBuilder(Order\Creditmemo::class) ->disableOriginalConstructor() ->getMock(); $this->hydratorMock = $this->getMockBuilder(HydratorInterface::class) From 897ef9490372901c67c327436ab592117067fd69 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Fri, 30 Nov 2018 10:21:34 -0600 Subject: [PATCH 109/131] MC-5331: Update tax rate, any region --- .../Tax/Test/Mftf/Data/TaxRateData.xml | 20 ++----- .../Test/UpdateAnyRegionTaxRateEntityTest.xml | 60 +++++++++++++++++++ 2 files changed, 64 insertions(+), 16 deletions(-) create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml index 22eef75989d..893a08faeaf 100644 --- a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml +++ b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml @@ -31,7 +31,9 @@ <entity name="defaultTaxRateWithZipRange" type="taxRate"> <data key="code" unique="suffix">Tax Rate </data> <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> <data key="tax_region_id">12</data> + <data key="tax_region">California</data> <data key="zip_is_range">1</data> <data key="zip_from">90001</data> <data key="zip_to">96162</data> @@ -40,6 +42,7 @@ <entity name="defaultTaxRateWithLargeRate" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> <data key="tax_country_id">GB</data> + <data key="tax_country">United Kingdom</data> <data key="tax_postcode">*</data> <data key="zip_is_range">0</data> <data key="rate">777</data> @@ -47,25 +50,10 @@ <entity name="taxRateCustomRateCanada" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> <data key="tax_country_id">CA</data> + <data key="tax_country">Canada</data> <data key="tax_region_id">*</data> <data key="tax_postcode">180</data> <data key="zip_is_range">0</data> <data key="rate">25</data> </entity> - <entity name="taxRateCustomRateUK" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">GB</data> - <data key="zip_is_range">1</data> - <data key="zip_from">1</data> - <data key="zip_to">7800935</data> - <data key="rate">12.99</data> - </entity> - <entity name="taxRateCustomRateFrance" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">FR</data> - <data key="tax_region_id">277</data> - <data key="tax_postcode">*</data> - <data key="zip_is_range">0</data> - <data key="rate">0.1</data> - </entity> </entities> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml new file mode 100644 index 00000000000..d7b25da6c14 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/UpdateAnyRegionTaxRateEntityTest.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="UpdateAnyRegionTaxRateEntityTest"> + <annotations> + <stories value="Update Tax Rate"/> + <title value="Update tax rate, any region"/> + <description value="Test log in to Tax Rate and Update Any Region"/> + <testCaseId value="MC-5331"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> + </after> + + <!-- Search the tax rate on tax grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> + + <!-- Update any region tax rate on the tax rate form page --> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{taxRateCustomRateCanada.code}}" stepKey="fillTaxIdentifierField2"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="{{taxRateCustomRateCanada.tax_country_id}}" stepKey="selectCountry1"/> + <selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="{{taxRateCustomRateCanada.tax_region_id}}" stepKey="selectState"/> + <fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="{{taxRateCustomRateCanada.tax_postcode}}" stepKey="fillPostCode"/> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{taxRateCustomRateCanada.rate}}" stepKey="fillRate1"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <!-- Verify we see updated any region tax rate(from the above step) on the tax rate grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/> + <waitForPageLoad stepKey="waitForTaxRateIndex2"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateCanada.code}}" stepKey="fillTaxIdentifierField3"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> + <!-- Verify we see updated any region tax rate on the tax rate form page --> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{taxRateCustomRateCanada.code}}" stepKey="seeRTaxIdentifier"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="{{taxRateCustomRateCanada.tax_country}}" stepKey="seeCountry2"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="{{taxRateCustomRateCanada.tax_region_id}}" stepKey="seeState2"/> + <seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="{{taxRateCustomRateCanada.tax_postcode}}" stepKey="seeZipCode"/> + <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{taxRateCustomRateCanada.rate}}" stepKey="seeRate2"/> + </test> +</tests> From 9f790d3ae117ce0cb8eaa8a51b5165f8356f0730 Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Fri, 30 Nov 2018 12:10:17 -0600 Subject: [PATCH 110/131] MC-5574: Flaky MFTF Tests - fix EndToEndB2CGuestUserTest --- .../Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml index 0499a57a921..72c5648991e 100644 --- a/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml +++ b/app/code/Magento/Checkout/Test/Mftf/ActionGroup/StorefrontProductCartActionGroup.xml @@ -90,7 +90,7 @@ <checkOption selector="{{CheckoutCartSummarySection.flatRateShippingMethod}}" stepKey="selectShippingMethod"/> <see userInput="${{subtotal}}" selector="{{CheckoutCartSummarySection.subtotal}}" stepKey="assertSubtotal"/> <see userInput="({{shippingMethod}})" selector="{{CheckoutCartSummarySection.shippingMethod}}" stepKey="assertShippingMethod"/> - <waitForText userInput="${{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="30" stepKey="assertShipping"/> + <waitForText userInput="${{shipping}}" selector="{{CheckoutCartSummarySection.shipping}}" time="45" stepKey="assertShipping"/> <see userInput="${{total}}" selector="{{CheckoutCartSummarySection.total}}" stepKey="assertTotal"/> </actionGroup> From 1252948442421ffc28084ebf443058ea68711c9e Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Fri, 30 Nov 2018 14:39:32 -0600 Subject: [PATCH 111/131] MC-5332: Update tax rate, 12.99 rate --- .../Tax/Test/Mftf/Data/TaxRateData.xml | 13 ++-- .../Mftf/Test/Update1299TaxRateEntityTest.xml | 62 +++++++++++++++++++ 2 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml index 22eef75989d..6c0ffa08bbf 100644 --- a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml +++ b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml @@ -31,7 +31,9 @@ <entity name="defaultTaxRateWithZipRange" type="taxRate"> <data key="code" unique="suffix">Tax Rate </data> <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> <data key="tax_region_id">12</data> + <data key="tax_region">California</data> <data key="zip_is_range">1</data> <data key="zip_from">90001</data> <data key="zip_to">96162</data> @@ -40,6 +42,7 @@ <entity name="defaultTaxRateWithLargeRate" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> <data key="tax_country_id">GB</data> + <data key="tax_country">United Kingdom</data> <data key="tax_postcode">*</data> <data key="zip_is_range">0</data> <data key="rate">777</data> @@ -47,6 +50,7 @@ <entity name="taxRateCustomRateCanada" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> <data key="tax_country_id">CA</data> + <data key="tax_country">Canada</data> <data key="tax_region_id">*</data> <data key="tax_postcode">180</data> <data key="zip_is_range">0</data> @@ -55,17 +59,10 @@ <entity name="taxRateCustomRateUK" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> <data key="tax_country_id">GB</data> + <data key="tax_country">United Kingdom</data> <data key="zip_is_range">1</data> <data key="zip_from">1</data> <data key="zip_to">7800935</data> <data key="rate">12.99</data> </entity> - <entity name="taxRateCustomRateFrance" type="taxRate"> - <data key="code" unique="suffix">TaxRate</data> - <data key="tax_country_id">FR</data> - <data key="tax_region_id">277</data> - <data key="tax_postcode">*</data> - <data key="zip_is_range">0</data> - <data key="rate">0.1</data> - </entity> </entities> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml new file mode 100644 index 00000000000..aa46a5fdae0 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update1299TaxRateEntityTest.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="Update1299TaxRateEntityTest"> + <annotations> + <stories value="Update Tax Rate"/> + <title value="Update tax rate, 12.99 rate"/> + <description value="Test log in to Tax Rate and Update 12.99 Rate"/> + <testCaseId value="MC-5332"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> + </after> + + <!-- Search the tax identifier on tax grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode1"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> + + <!-- Update 12.99 tax rate on the tax rate form page --> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{taxRateCustomRateUK.code}}" stepKey="fillTaxIdentifierField1"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="{{taxRateCustomRateUK.tax_country_id}}" stepKey="selectCountry1"/> + <checkOption selector="{{AdminTaxRateFormSection.zipRange}}" stepKey="checkZipRange"/> + <fillField selector="{{AdminTaxRateFormSection.rangeFrom}}" userInput="{{taxRateCustomRateUK.zip_from}}" stepKey="fillZipFrom"/> + <fillField selector="{{AdminTaxRateFormSection.rangeTo}}" userInput="{{taxRateCustomRateUK.zip_to}}" stepKey="fillZipTo"/> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{taxRateCustomRateUK.rate}}" stepKey="fillRate1"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <!-- Verify we see updated tax rate(from the above step) on the tax rate grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex2"/> + <waitForPageLoad stepKey="waitForTaxRateIndex2"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateUK.code}}" stepKey="fillTaxIdentifierField2"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> + <!-- Verify we see updated tax rate on the tax rate form page --> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{taxRateCustomRateUK.code}}" stepKey="seeRTaxIdentifier"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="{{taxRateCustomRateUK.tax_country}}" stepKey="seeCountry2"/> + <seeCheckboxIsChecked selector="{{AdminTaxRateFormSection.zipRange}}" stepKey="seeZipRange"/> + <seeInField selector="{{AdminTaxRateFormSection.rangeFrom}}" userInput="{{taxRateCustomRateUK.zip_from}}" stepKey="seeZipFrom"/> + <seeInField selector="{{AdminTaxRateFormSection.rangeTo}}" userInput="{{taxRateCustomRateUK.zip_to}}" stepKey="seeZipTo"/> + <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{taxRateCustomRateUK.rate}}" stepKey="seeRate"/> + </test> +</tests> From 96ca4d7bc4e75e62dc332c77d90c40b545ccd725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20S=C5=82awik?= <maciej.slawik@lizardmedia.pl> Date: Thu, 22 Nov 2018 16:22:53 +0100 Subject: [PATCH 112/131] Framework Escaper - remove direct Object Manager usage --- lib/internal/Magento/Framework/Escaper.php | 55 +++++++------------ .../Filter/Test/Unit/StripTagsTest.php | 3 +- .../Framework/Test/Unit/EscaperTest.php | 5 +- .../Magento/Framework/Test/Unit/UrlTest.php | 2 +- 4 files changed, 24 insertions(+), 41 deletions(-) diff --git a/lib/internal/Magento/Framework/Escaper.php b/lib/internal/Magento/Framework/Escaper.php index 80979c3db09..2e7c41c5256 100644 --- a/lib/internal/Magento/Framework/Escaper.php +++ b/lib/internal/Magento/Framework/Escaper.php @@ -46,6 +46,21 @@ class Escaper */ private $escapeAsUrlAttributes = ['href']; + /** + * Escaper constructor. + * @param \Magento\Framework\ZendEscaper|null $escaper + * @param \Psr\Log\LoggerInterface|null $logger + */ + public function __construct( + \Magento\Framework\ZendEscaper $escaper = null, + \Psr\Log\LoggerInterface $logger = null + ) { + $this->escaper = $escaper ?? \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Magento\Framework\ZendEscaper::class); + $this->logger = $logger ?? \Magento\Framework\App\ObjectManager::getInstance() + ->get(\Psr\Log\LoggerInterface::class); + } + /** * Escape string for HTML context. * @@ -84,7 +99,7 @@ function ($errorNumber, $errorString) { ); } catch (\Exception $e) { restore_error_handler(); - $this->getLogger()->critical($e); + $this->logger->critical($e); } restore_error_handler(); @@ -201,7 +216,7 @@ private function escapeAttributeValue($name, $value) public function escapeHtmlAttr($string, $escapeSingleQuote = true) { if ($escapeSingleQuote) { - return $this->getEscaper()->escapeHtmlAttr((string) $string); + return $this->escaper->escapeHtmlAttr((string) $string); } return htmlspecialchars((string)$string, ENT_COMPAT, 'UTF-8', false); } @@ -226,7 +241,7 @@ public function escapeUrl($string) */ public function encodeUrlParam($string) { - return $this->getEscaper()->escapeUrl($string); + return $this->escaper->escapeUrl($string); } /** @@ -265,7 +280,7 @@ function ($matches) { */ public function escapeCss($string) { - return $this->getEscaper()->escapeCss($string); + return $this->escaper->escapeCss($string); } /** @@ -340,36 +355,6 @@ public function escapeQuote($data, $addSlashes = false) return htmlspecialchars($data, ENT_QUOTES, null, false); } - /** - * Get escaper - * - * @return \Magento\Framework\ZendEscaper - * @deprecated 100.2.0 - */ - private function getEscaper() - { - if ($this->escaper == null) { - $this->escaper = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Magento\Framework\ZendEscaper::class); - } - return $this->escaper; - } - - /** - * Get logger - * - * @return \Psr\Log\LoggerInterface - * @deprecated 100.2.0 - */ - private function getLogger() - { - if ($this->logger == null) { - $this->logger = \Magento\Framework\App\ObjectManager::getInstance() - ->get(\Psr\Log\LoggerInterface::class); - } - return $this->logger; - } - /** * Filter prohibited tags. * @@ -384,7 +369,7 @@ private function filterProhibitedTags(array $allowedTags): array ); if (!empty($notAllowedTags)) { - $this->getLogger()->critical( + $this->logger->critical( 'The following tag(s) are not allowed: ' . implode(', ', $notAllowedTags) ); $allowedTags = array_diff($allowedTags, $this->notAllowedTags); diff --git a/lib/internal/Magento/Framework/Filter/Test/Unit/StripTagsTest.php b/lib/internal/Magento/Framework/Filter/Test/Unit/StripTagsTest.php index 2c42eb3d1c8..f0dc0d9bd78 100644 --- a/lib/internal/Magento/Framework/Filter/Test/Unit/StripTagsTest.php +++ b/lib/internal/Magento/Framework/Filter/Test/Unit/StripTagsTest.php @@ -12,7 +12,8 @@ class StripTagsTest extends \PHPUnit\Framework\TestCase */ public function testStripTags() { - $stripTags = new \Magento\Framework\Filter\StripTags(new \Magento\Framework\Escaper()); + $escaper = $this->createMock(\Magento\Framework\Escaper::class); + $stripTags = new \Magento\Framework\Filter\StripTags($escaper); $this->assertEquals('three', $stripTags->filter('<two>three</two>')); } } diff --git a/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php b/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php index ec05478b90d..30d373822de 100644 --- a/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/EscaperTest.php @@ -30,12 +30,9 @@ class EscaperTest extends \PHPUnit\Framework\TestCase protected function setUp() { - $this->escaper = new Escaper(); $this->zendEscaper = new \Magento\Framework\ZendEscaper(); $this->loggerMock = $this->getMockForAbstractClass(\Psr\Log\LoggerInterface::class); - $objectManagerHelper = new ObjectManager($this); - $objectManagerHelper->setBackwardCompatibleProperty($this->escaper, 'escaper', $this->zendEscaper); - $objectManagerHelper->setBackwardCompatibleProperty($this->escaper, 'logger', $this->loggerMock); + $this->escaper = new Escaper($this->zendEscaper, $this->loggerMock); } /** diff --git a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php index 3713978d0f7..c6a0aa8a00a 100644 --- a/lib/internal/Magento/Framework/Test/Unit/UrlTest.php +++ b/lib/internal/Magento/Framework/Test/Unit/UrlTest.php @@ -141,7 +141,7 @@ protected function getUrlModel($arguments = []) $modelProperty->setValue($model, $this->urlModifier); $zendEscaper = new \Magento\Framework\ZendEscaper(); - $escaper = new \Magento\Framework\Escaper(); + $escaper = $objectManager->getObject(\Magento\Framework\Escaper::class); $objectManager->setBackwardCompatibleProperty($escaper, 'escaper', $zendEscaper); $objectManager->setBackwardCompatibleProperty($model, 'escaper', $escaper); From 4d0efab39fd1fae43c10d1afc5c5aa143fa143d5 Mon Sep 17 00:00:00 2001 From: sathakur <sathakur@adobe.com> Date: Mon, 3 Dec 2018 09:15:03 -0600 Subject: [PATCH 113/131] MC-5333: Update tax rate, 0.1 rate --- .../Tax/Test/Mftf/Data/TaxRateData.xml | 7 +++ .../Mftf/Test/Update01TaxRateEntityTest.xml | 60 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml diff --git a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml index 22eef75989d..666ced6d0ab 100644 --- a/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml +++ b/app/code/Magento/Tax/Test/Mftf/Data/TaxRateData.xml @@ -31,7 +31,9 @@ <entity name="defaultTaxRateWithZipRange" type="taxRate"> <data key="code" unique="suffix">Tax Rate </data> <data key="tax_country_id">US</data> + <data key="tax_country">United States</data> <data key="tax_region_id">12</data> + <data key="tax_region">California</data> <data key="zip_is_range">1</data> <data key="zip_from">90001</data> <data key="zip_to">96162</data> @@ -40,6 +42,7 @@ <entity name="defaultTaxRateWithLargeRate" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> <data key="tax_country_id">GB</data> + <data key="tax_country">United Kingdom</data> <data key="tax_postcode">*</data> <data key="zip_is_range">0</data> <data key="rate">777</data> @@ -47,6 +50,7 @@ <entity name="taxRateCustomRateCanada" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> <data key="tax_country_id">CA</data> + <data key="tax_country">Canada</data> <data key="tax_region_id">*</data> <data key="tax_postcode">180</data> <data key="zip_is_range">0</data> @@ -55,6 +59,7 @@ <entity name="taxRateCustomRateUK" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> <data key="tax_country_id">GB</data> + <data key="tax_country">United Kingdom</data> <data key="zip_is_range">1</data> <data key="zip_from">1</data> <data key="zip_to">7800935</data> @@ -63,7 +68,9 @@ <entity name="taxRateCustomRateFrance" type="taxRate"> <data key="code" unique="suffix">TaxRate</data> <data key="tax_country_id">FR</data> + <data key="tax_country">France</data> <data key="tax_region_id">277</data> + <data key="tax_region">Val-d'Oise</data> <data key="tax_postcode">*</data> <data key="zip_is_range">0</data> <data key="rate">0.1</data> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml new file mode 100644 index 00000000000..433e390d776 --- /dev/null +++ b/app/code/Magento/Tax/Test/Mftf/Test/Update01TaxRateEntityTest.xml @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> + +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> + <test name="Update01TaxRateEntityTest"> + <annotations> + <stories value="Update Tax Rate"/> + <title value="Update tax rate, 0.1 rate"/> + <description value="Test log in to Tax Rate and Update 0.1 Rate"/> + <testCaseId value="MC-5333"/> + <severity value="CRITICAL"/> + <group value="tax"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <createData entity="defaultTaxRate" stepKey="initialTaxRate"/> + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData stepKey="deleteTaxRate" createDataKey="initialTaxRate" /> + </after> + + <!-- Search the tax rate on tax grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex1"/> + <waitForPageLoad stepKey="waitForTaxRateIndex1"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters1"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="$$initialTaxRate.code$$" stepKey="fillCode"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch1"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow1"/> + + <!-- Update 0.1 tax rate on the tax rate form page --> + <fillField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{taxRateCustomRateFrance.code}}" stepKey="fillTaxIdentifierField2"/> + <selectOption selector="{{AdminTaxRateFormSection.country}}" userInput="{{taxRateCustomRateFrance.tax_country_id}}" stepKey="selectCountry1"/> + <selectOption selector="{{AdminTaxRateFormSection.state}}" userInput="{{taxRateCustomRateFrance.tax_region_id}}" stepKey="selectState"/> + <fillField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="{{taxRateCustomRateFrance.tax_postcode}}" stepKey="fillPostCode"/> + <fillField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{taxRateCustomRateFrance.rate}}" stepKey="fillRate1"/> + <click selector="{{AdminTaxRateFormSection.save}}" stepKey="clickSave"/> + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the tax rate." stepKey="seeSuccess"/> + + <!-- Verify we see updated 0.1 tax rate(from the above step) on the tax rate grid page --> + <amOnPage url="{{AdminTaxRateGridPage.url}}" stepKey="goToTaxRateIndex4"/> + <waitForPageLoad stepKey="waitForTaxRateIndex2"/> + <click selector="{{AdminDataGridHeaderSection.clearFilters}}" stepKey="clickClearFilters2"/> + <fillField selector="{{AdminTaxRateGridSection.filterByTaxIdentifier}}" userInput="{{taxRateCustomRateFrance.code}}" stepKey="fillTaxIdentifierField3"/> + <click selector="{{AdminTaxRateGridSection.search}}" stepKey="clickSearch2"/> + <click selector="{{AdminTaxRateGridSection.nthRow('1')}}" stepKey="clickFirstRow2"/> + <!-- Verify we see updated 0.1 tax rate on the tax rate form page --> + <seeInField selector="{{AdminTaxRateFormSection.taxIdentifier}}" userInput="{{taxRateCustomRateFrance.code}}" stepKey="seeRTaxIdentifier"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.country}}" userInput="{{taxRateCustomRateFrance.tax_country}}" stepKey="seeCountry2"/> + <seeOptionIsSelected selector="{{AdminTaxRateFormSection.state}}" userInput="{{taxRateCustomRateFrance.tax_region}}" stepKey="seeState2"/> + <seeInField selector="{{AdminTaxRateFormSection.zipCode}}" userInput="{{taxRateCustomRateFrance.tax_postcode}}" stepKey="seeZipCode"/> + <seeInField selector="{{AdminTaxRateFormSection.rate}}" userInput="{{taxRateCustomRateFrance.rate}}" stepKey="seeRate2"/> + </test> +</tests> From 2e3b28a8797dc250a3267569cb1dc0d2b277ea72 Mon Sep 17 00:00:00 2001 From: Nathan Smith <nathsmit@adobe.com> Date: Mon, 3 Dec 2018 11:12:49 -0600 Subject: [PATCH 114/131] MAGETWO-96656: Failed funtional test Magento\FunctionalTestingFramework.functional.CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest - Unskip test --- ...tomerGroupMembershipArePersistedUnderLongTermCookieTest.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml index 8d766f4daab..2e09ee71347 100644 --- a/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml +++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/CatalogPriceRuleAndCustomerGroupMembershipArePersistedUnderLongTermCookieTest.xml @@ -17,9 +17,6 @@ <severity value="CRITICAL"/> <testCaseId value="MAGETWO-69455"/> <group value="persistent"/> - <skip> - <issueId value="MAGETWO-96656"/> - </skip> </annotations> <before> <createData entity="PersistentConfigEnabled" stepKey="enablePersistent"/> From 6f30fbaee8d97937483b0cfa7bdc19130436a33b Mon Sep 17 00:00:00 2001 From: Nathan Smith <nathsmit@adobe.com> Date: Mon, 3 Dec 2018 11:24:29 -0600 Subject: [PATCH 115/131] MAGETWO-95212: Dynamic block call to getCurrentUrl method is returning ajax request value - Fixed new static test error- --- app/code/Magento/CatalogWidget/Block/Product/ProductsList.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php index 851f9e3fc5e..2b95de24d02 100644 --- a/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php +++ b/app/code/Magento/CatalogWidget/Block/Product/ProductsList.php @@ -163,6 +163,7 @@ protected function _construct() * Get key pieces for caching block content * * @return array + * @SuppressWarnings(PHPMD.RequestAwareBlockMethod) */ public function getCacheKeyInfo() { @@ -240,6 +241,7 @@ protected function _beforeToHtml() * Prepare and return product collection * * @return \Magento\Catalog\Model\ResourceModel\Product\Collection + * @SuppressWarnings(PHPMD.RequestAwareBlockMethod) */ public function createCollection() { From d35309fd3744361ec6daef399e7997d07560d217 Mon Sep 17 00:00:00 2001 From: Nathan Smith <nathsmit@adobe.com> Date: Mon, 3 Dec 2018 11:46:06 -0600 Subject: [PATCH 116/131] MAGETWO-96223: MFTF Test Failure AdminConfigurationIndustryTest - Unskipped test --- .../Test/Mftf/Test/AdminConfigurationIndustryTest.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationIndustryTest.xml b/app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationIndustryTest.xml index 624aa952fbc..bb682c44680 100644 --- a/app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationIndustryTest.xml +++ b/app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationIndustryTest.xml @@ -17,9 +17,6 @@ <severity value="MAJOR"/> <testCaseId value="MAGETWO-63898"/> <group value="analytics"/> - <skip> - <issueId value="MAGETWO-96223"/> - </skip> </annotations> <actionGroup ref="LoginActionGroup" stepKey="loginAsAdmin"/> From 68754f253fdb05a7415fc3be7fccc26834a8300e Mon Sep 17 00:00:00 2001 From: Krissy Hiserote <khiserote@magento.com> Date: Tue, 4 Dec 2018 11:54:07 -0600 Subject: [PATCH 117/131] MAGETWO-96266: Magento\FunctionalTestingFramework.functional.StorefrontTaxQuoteCartGuestSimple randomly fails - unskip test --- .../Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml index 73e018ec831..7263db10073 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/StorefrontTaxQuoteCartTest.xml @@ -251,9 +251,6 @@ <severity value="CRITICAL"/> <testCaseId value="MC-297"/> <group value="Tax"/> - <skip> - <issueId value="MAGETWO-96266"/> - </skip> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> From ecaf14ed313708eb62e2a1322de5d0910756ed94 Mon Sep 17 00:00:00 2001 From: Deepty Thampy <dthampy@adobe.com> Date: Tue, 4 Dec 2018 12:06:33 -0600 Subject: [PATCH 118/131] MC-5574: Unskipping MFTF Test - unskip test --- .../Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml | 3 --- .../Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml | 3 --- .../Test/AdminRemoveDefaultVideoDownloadableProductTest.xml | 3 --- .../Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml | 3 --- 4 files changed, 12 deletions(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml index d38a8e4190c..03f3e93bb30 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminAddImageToWYSIWYGProductTest.xml @@ -16,9 +16,6 @@ <description value="Admin should be able to add image to WYSIWYG Editor on Product Page"/> <severity value="CRITICAL"/> <testCaseId value="MAGETWO-84375"/> - <skip> - <issueId value="MAGETWO-94438"/> - </skip> </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="login"/> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml index 4b3d5c92587..11bf03c1d5e 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToCMSPageTinyMCE3Test.xml @@ -17,9 +17,6 @@ <description value="Verify that admin is able to upload image to CMS Page with TinyMCE3 enabled"/> <severity value="MAJOR"/> <testCaseId value="MAGETWO-95725"/> - <skip> - <issueId value="MC-5371" /> - </skip> </annotations> <before> <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> diff --git a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml index 83d859ee742..d8bbbb2b4d6 100644 --- a/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml +++ b/app/code/Magento/Downloadable/Test/Mftf/Test/AdminRemoveDefaultVideoDownloadableProductTest.xml @@ -17,9 +17,6 @@ <severity value="MAJOR"/> <testCaseId value="MC-207"/> <group value="Downloadable"/> - <skip> - <issueId value="MAGETWO-94795"/> - </skip> </annotations> <!-- Create a downloadable product --> diff --git a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml index ed3eea30c8b..02b8d3686fd 100644 --- a/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml +++ b/app/code/Magento/Tinymce3/Test/Mftf/Test/AdminSwitchWYSIWYGOptionsTest.xml @@ -17,9 +17,6 @@ <description value="Admin should able to switch between versions of TinyMCE"/> <severity value="CRITICAL"/> <testCaseId value="MAGETWO-82936"/> - <skip> - <issueId value="MAGETWO-89417"/> - </skip> </annotations> <before> <actionGroup ref="LoginActionGroup" stepKey="loginGetFromGeneralFile"/> From aa8101543e49147a7e3e9df39479a31ccfb04f37 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov <sidolov@adobe.com> Date: Tue, 4 Dec 2018 14:01:46 -0600 Subject: [PATCH 119/131] Fixed static test failure --- lib/internal/Magento/Framework/Model/AbstractModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index 1c3e67281c1..567d174938b 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -778,7 +778,7 @@ protected function _getValidationRulesBeforeSave() /** * Get list of cache tags applied to model object. - * + * * Return false if cache tags are not supported by model * * @return array|false From 31e8a66fbc78d5394d1bddec22adf14ddce7cc8e Mon Sep 17 00:00:00 2001 From: nmalevanec <mikola.malevanec@transoftgroup.com> Date: Wed, 5 Dec 2018 13:15:28 +0200 Subject: [PATCH 120/131] Fix integration test. --- .../testsuite/Magento/Email/Model/Template/FilterTest.php | 8 ++++---- .../testsuite/Magento/Email/Model/TemplateTest.php | 8 ++++---- setup/view/magento/setup/extension-grid.phtml | 3 +++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php index a68b0942ec0..dd55dcc8b47 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php @@ -130,22 +130,22 @@ public function layoutDirectiveDataProvider() 'area parameter - omitted' => [ 'adminhtml', 'handle="email_template_test_handle"', - '<b>Email content for frontend/Magento/default theme</b>', + '<strong>Email content for frontend/Magento/default theme</strong>', ], 'area parameter - frontend' => [ 'adminhtml', 'handle="email_template_test_handle" area="frontend"', - '<b>Email content for frontend/Magento/default theme</b>', + '<strong>Email content for frontend/Magento/default theme</strong>', ], 'area parameter - backend' => [ 'frontend', 'handle="email_template_test_handle" area="adminhtml"', - '<b>Email content for adminhtml/Magento/default theme</b>', + '<strong>Email content for adminhtml/Magento/default theme</strong>', ], 'custom parameter' => [ 'frontend', 'handle="email_template_test_handle" template="Magento_Email::sample_email_content_custom.phtml"', - '<b>Custom Email content for frontend/Magento/default theme</b>', + '<strong>Custom Email content for frontend/Magento/default theme</strong>', ], ]; return $result; diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php index a83de07443e..7789a79794f 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php @@ -315,25 +315,25 @@ public function templateDirectiveDataProvider() Area::AREA_FRONTEND, TemplateTypesInterface::TYPE_HTML, '{{template config_path="customer/create_account/email_template"}}', - '<b>customer_create_account_email_template template from Vendor/custom_theme</b>', + '<strong>customer_create_account_email_template template from Vendor/custom_theme</strong>', ], 'Template from parent theme - frontend' => [ Area::AREA_FRONTEND, TemplateTypesInterface::TYPE_HTML, '{{template config_path="customer/create_account/email_confirmation_template"}}', - '<b>customer_create_account_email_confirmation_template template from Vendor/default</b>', + '<strong>customer_create_account_email_confirmation_template template from Vendor/default</strong', ], 'Template from grandparent theme - frontend' => [ Area::AREA_FRONTEND, TemplateTypesInterface::TYPE_HTML, '{{template config_path="customer/create_account/email_confirmed_template"}}', - '<b>customer_create_account_email_confirmed_template template from Magento/default</b>', + '<strong>customer_create_account_email_confirmed_template template from Magento/default</strong', ], 'Template from grandparent theme - adminhtml' => [ BackendFrontNameResolver::AREA_CODE, TemplateTypesInterface::TYPE_HTML, '{{template config_path="catalog/productalert_cron/error_email_template"}}', - '<b>catalog_productalert_cron_error_email_template template from Magento/default</b>', + '<strong>catalog_productalert_cron_error_email_template template from Magento/default</strong', null, null, true, diff --git a/setup/view/magento/setup/extension-grid.phtml b/setup/view/magento/setup/extension-grid.phtml index df2203df2c0..4800d45e12d 100644 --- a/setup/view/magento/setup/extension-grid.phtml +++ b/setup/view/magento/setup/extension-grid.phtml @@ -3,6 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +// @codingStandardsIgnoreFile + ?> <h2 class="page-title">{{$state.current.header}}</h2> From 491e91853826c75ba852732643b5679e5bff17ce Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Wed, 5 Dec 2018 14:56:13 +0200 Subject: [PATCH 121/131] ENGCOM-3535: Static tests fix. --- .../Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php b/lib/internal/Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php index 62b0d30b294..f25cd219e3e 100644 --- a/lib/internal/Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php +++ b/lib/internal/Magento/Framework/Webapi/Rest/Response/Renderer/Xml.php @@ -7,6 +7,9 @@ */ namespace Magento\Framework\Webapi\Rest\Response\Renderer; +/** + * Renders response data in Xml format. + */ class Xml implements \Magento\Framework\Webapi\Rest\Response\RendererInterface { /** @@ -165,4 +168,3 @@ protected function _prepareKey($key) return $key; } } - From 773ddd3d3ef0ea7f675d44f944609e6d673c6683 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky <p.bystritsky@yandex.ru> Date: Wed, 5 Dec 2018 17:38:27 +0200 Subject: [PATCH 122/131] ENGCOM-3518: Static tests fix. --- lib/internal/Magento/Framework/Escaper.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/internal/Magento/Framework/Escaper.php b/lib/internal/Magento/Framework/Escaper.php index 2e7c41c5256..ae6872ab0c6 100644 --- a/lib/internal/Magento/Framework/Escaper.php +++ b/lib/internal/Magento/Framework/Escaper.php @@ -47,7 +47,6 @@ class Escaper private $escapeAsUrlAttributes = ['href']; /** - * Escaper constructor. * @param \Magento\Framework\ZendEscaper|null $escaper * @param \Psr\Log\LoggerInterface|null $logger */ From fab3c3bee2f3a53952eaaa083a2899640d49f433 Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Wed, 5 Dec 2018 17:25:24 -0600 Subject: [PATCH 123/131] MC-5596: Comments are not being added in Credit memo emails --- app/code/Magento/Sales/Model/Order/CreditmemoDocumentFactory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Sales/Model/Order/CreditmemoDocumentFactory.php b/app/code/Magento/Sales/Model/Order/CreditmemoDocumentFactory.php index 6939988ba3d..b86acbab208 100644 --- a/app/code/Magento/Sales/Model/Order/CreditmemoDocumentFactory.php +++ b/app/code/Magento/Sales/Model/Order/CreditmemoDocumentFactory.php @@ -100,6 +100,7 @@ private function attachComment( ->setIsCustomerNotified($appendComment); $creditmemo->setComments([$comment]); $creditmemo->setCustomerNote($comment->getComment()); + $creditmemo->setCustomerNoteNotify($appendComment); return $creditmemo; } From 29ec8350c44bae07ef8b4fb1c2438194dcb1ae2a Mon Sep 17 00:00:00 2001 From: Sergii Ivashchenko <serg.ivashchenko@gmail.com> Date: Thu, 6 Dec 2018 14:49:51 +0200 Subject: [PATCH 124/131] magento/magento2#19404: Fixed integration test --- .../testsuite/Magento/Newsletter/Controller/SubscriberTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Controller/SubscriberTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Controller/SubscriberTest.php index 5347881f5e7..92e4f31064e 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Controller/SubscriberTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Controller/SubscriberTest.php @@ -57,7 +57,7 @@ public function testNewActionUsedEmail() $this->dispatch('newsletter/subscriber/new'); $this->assertSessionMessages($this->equalTo([ - 'There was a problem with the subscription: This email address is already assigned to another user.', + 'This email address is already assigned to another user.', ])); $this->assertRedirect($this->anything()); } From f91201c5d4c20c2d0cc828094d63567600a7fee4 Mon Sep 17 00:00:00 2001 From: Sergii Ivashchenko <serg.ivashchenko@gmail.com> Date: Thu, 6 Dec 2018 14:54:12 +0200 Subject: [PATCH 125/131] magento/magento2#19404: Fixed code styles --- .../Magento/Newsletter/Controller/Subscriber/NewAction.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php b/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php index 0ed09445796..c776ca65407 100644 --- a/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php +++ b/app/code/Magento/Newsletter/Controller/Subscriber/NewAction.php @@ -10,6 +10,7 @@ use Magento\Customer\Model\Session; use Magento\Customer\Model\Url as CustomerUrl; use Magento\Framework\App\Action\Context; +use Magento\Framework\App\Action\HttpPostActionInterface; use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ObjectManager; use Magento\Framework\Exception\LocalizedException; @@ -22,9 +23,11 @@ use Magento\Newsletter\Model\SubscriberFactory; /** + * New newsletter subscription action + * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class NewAction extends SubscriberController +class NewAction extends SubscriberController implements HttpPostActionInterface { /** * @var CustomerAccountManagement @@ -160,6 +163,8 @@ public function execute() } /** + * Get success message + * * @param int $status * @return Phrase */ From bad8596dfece39d4b510edc7e801e4b644e40ee3 Mon Sep 17 00:00:00 2001 From: Sergii Ivashchenko <serg.ivashchenko@gmail.com> Date: Thu, 6 Dec 2018 14:56:10 +0200 Subject: [PATCH 126/131] magento/magento2#19206: Fixed code styles --- .../CatalogInventory/Block/Stockqty/AbstractStockqty.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php b/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php index 7b27125f73f..4c8f356519e 100644 --- a/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php +++ b/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php @@ -131,7 +131,9 @@ public function getPlaceholderId() */ public function isMsgVisible() { - return $this->getStockQty() > 0 && $this->getStockQtyLeft() > 0 && $this->getStockQtyLeft() <= $this->getThresholdQty(); + return $this->getStockQty() > 0 + && $this->getStockQtyLeft() > 0 + && $this->getStockQtyLeft() <= $this->getThresholdQty(); } /** From 86ccd991afa316cf8f05d5e4d824fc5a0dba0e40 Mon Sep 17 00:00:00 2001 From: Deepty Thampy <dthampy@adobe.com> Date: Thu, 6 Dec 2018 12:11:12 -0600 Subject: [PATCH 127/131] MC-5496: Dynamic block call to getCurrentUrl method is returning ajax request value - updated test with correct selector --- .../Test/Mftf/Section/StorefrontCategoryProductSection.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryProductSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryProductSection.xml index 7ea74d79137..178e58ef2d6 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryProductSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryProductSection.xml @@ -28,7 +28,8 @@ <element name="productPriceLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]" parameterized="true"/> <element name="productPriceLinkAfterLabel" type="text" selector="//span[@class='price-label'][contains(text(),'{{var1}}')]/following::span[contains(text(), '{{var2}}')]" parameterized="true"/> <element name="ProductAddToCartByName" type="button" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//a[contains(@class, 'tocart')]" parameterized="true"/> - <element name="ProductAddToCompareByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//a[contains(@class, 'tocompare')]" parameterized="true"/> + <!--<element name="ProductAddToCompareByName" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//a[contains(@class, 'tocompare')]" parameterized="true"/>--> + <element name="ProductAddToCompareByName" type="text" selector="//*[contains(@class,'product-item-info')][descendant::a[contains(text(), '{{var1}}')]]//a[contains(@class, 'tocompare')]" parameterized="true"/> <element name="ProductImageByNameAndSrc" type="text" selector="//main//li[.//a[contains(text(), '{{var1}}')]]//img[contains(@src, '{{src}}')]" parameterized="true"/> </section> </sections> From 669014b817c05c41da147c7e261e7794626918f6 Mon Sep 17 00:00:00 2001 From: Joan He <johe@magento.com> Date: Thu, 6 Dec 2018 10:48:01 -0600 Subject: [PATCH 128/131] MC-5904: Integration test Magento\MessageQueue\Model\Cron\ConsumersRunnerTest failed randomly --- .../Magento/MessageQueue/Model/Cron/ConsumersRunnerTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev/tests/integration/testsuite/Magento/MessageQueue/Model/Cron/ConsumersRunnerTest.php b/dev/tests/integration/testsuite/Magento/MessageQueue/Model/Cron/ConsumersRunnerTest.php index 4acba63d98e..3fa80a2dcda 100644 --- a/dev/tests/integration/testsuite/Magento/MessageQueue/Model/Cron/ConsumersRunnerTest.php +++ b/dev/tests/integration/testsuite/Magento/MessageQueue/Model/Cron/ConsumersRunnerTest.php @@ -116,6 +116,7 @@ protected function setUp() */ public function testCheckThatPidFilesWasCreated() { + $this->markTestSkipped('MC-5904: Test Fails randomly,'); $this->consumersRunner->run(); foreach ($this->consumerConfig->getConsumers() as $consumer) { $this->waitConsumerPidFile($consumer->getName()); @@ -129,6 +130,8 @@ public function testCheckThatPidFilesWasCreated() */ public function testSpecificConsumerAndRerun() { + $this->markTestSkipped('MC-5904: Test Fails randomly,'); + $specificConsumer = 'quoteItemCleaner'; $pidFilePath = $this->getPidFileName($specificConsumer); $config = $this->config; From 9ec1bed34fd236cabdfe8384a49880239859b5bd Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Fri, 7 Dec 2018 11:24:25 -0600 Subject: [PATCH 129/131] Deliver MTF to MFTF conversion --- ...ateLargeRate.xml => AdminCreateTaxRateLargeRateTest.xml} | 2 +- ...tcode.xml => AdminCreateTaxRateSpecificPostcodeTest.xml} | 2 +- ...ange.xml => AdminCreateTaxRateWiderZipCodeRangeTest.xml} | 2 +- ...CodeRange.xml => AdminCreateTaxRateZipCodeRangeTest.xml} | 2 +- .../Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.php | 1 + .../Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml | 5 +++++ .../Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.php | 1 + .../Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml | 6 ++++++ .../Magento/Mtf/TestSuite/InjectableTests/basic_green.xml | 2 ++ 9 files changed, 19 insertions(+), 4 deletions(-) rename app/code/Magento/Tax/Test/Mftf/Test/{AdminCreateTaxRateLargeRate.xml => AdminCreateTaxRateLargeRateTest.xml} (98%) rename app/code/Magento/Tax/Test/Mftf/Test/{AdminCreateTaxRateSpecificPostcode.xml => AdminCreateTaxRateSpecificPostcodeTest.xml} (98%) rename app/code/Magento/Tax/Test/Mftf/Test/{AdminCreateTaxRateWiderZipCodeRange.xml => AdminCreateTaxRateWiderZipCodeRangeTest.xml} (98%) rename app/code/Magento/Tax/Test/Mftf/Test/{AdminCreateTaxRateZipCodeRange.xml => AdminCreateTaxRateZipCodeRangeTest.xml} (98%) diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRate.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml similarity index 98% rename from app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRate.xml rename to app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml index db029359b83..2c8e245371d 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRate.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCreateTaxRateLargeRate"> + <test name="AdminCreateTaxRateLargeRateTest"> <annotations> <stories value="Create tax rate"/> <title value="Create Tax Rate, large rate"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcode.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml similarity index 98% rename from app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcode.xml rename to app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml index cb6f852a764..4c5f6045d41 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcode.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCreateTaxRateSpecificPostcode"> + <test name="AdminCreateTaxRateSpecificPostcodeTest"> <annotations> <stories value="Create tax rate"/> <title value="Create tax rate,specific postcode"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml similarity index 98% rename from app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml rename to app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml index 0920ac52278..38c74f817d8 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRange.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCreateTaxRateWiderZipCodeRange"> + <test name="AdminCreateTaxRateWiderZipCodeRangeTest"> <annotations> <stories value="Create tax rate"/> <title value="Create Tax Rate, wider zip code range"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml similarity index 98% rename from app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml rename to app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml index 7114e821c32..dcd6ce0270d 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRange.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml @@ -8,7 +8,7 @@ <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> - <test name="AdminCreateTaxRateZipCodeRange"> + <test name="AdminCreateTaxRateZipCodeRangeTest"> <annotations> <stories value="Create Tax Rate"/> <title value="Create Tax Rate,zip code range"/> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.php index aa74de5afe5..8b4f233f355 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.php @@ -28,6 +28,7 @@ class CreateTaxRateEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const MFTF_MIGRATED = 'yes'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml index 62e91f39fcc..b4b76fd62cc 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRateEntityTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Tax\Test\TestCase\CreateTaxRateEntityTest" summary="Create Tax Rate" ticketId="MAGETWO-23286"> <variation name="CreateTaxRateEntityTestVariation1"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> <data name="taxRate/data/zip_from" xsi:type="string">-</data> @@ -21,6 +22,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateInTaxRule" /> </variation> <variation name="CreateTaxRateEntityTestVariation2"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">Yes</data> <data name="taxRate/data/zip_from" xsi:type="string">90001</data> @@ -35,6 +37,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateInTaxRule" /> </variation> <variation name="CreateTaxRateEntityTestVariation3"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> <data name="taxRate/data/zip_from" xsi:type="string">-</data> @@ -48,6 +51,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateInTaxRule" /> </variation> <variation name="CreateTaxRateEntityTestVariation4"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">Yes</data> <data name="taxRate/data/zip_from" xsi:type="string">1</data> @@ -60,6 +64,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateInTaxRule" /> </variation> <variation name="CreateTaxRateEntityTestVariation5"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> <data name="taxRate/data/zip_from" xsi:type="string">-</data> diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.php index 1e66ad61b6c..10f41e68b65 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.php +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.php @@ -33,6 +33,7 @@ class UpdateTaxRateEntityTest extends Injectable { /* tags */ const MVP = 'yes'; + const MFTF_MIGRATED = 'yes'; /* end tags */ /** diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml index f8d9a00958b..1fef659a3de 100644 --- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml +++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRateEntityTest.xml @@ -8,6 +8,7 @@ <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> <testCase name="Magento\Tax\Test\TestCase\UpdateTaxRateEntityTest" summary="Edit Tax Rate" ticketId="MAGETWO-23299"> <variation name="UpdateTaxRateEntityTestVariation1"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="initialTaxRate/dataset" xsi:type="string">default</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> @@ -20,6 +21,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> </variation> <variation name="UpdateTaxRateEntityTestVariation2"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="initialTaxRate/dataset" xsi:type="string">default</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">Yes</data> @@ -33,6 +35,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> </variation> <variation name="UpdateTaxRateEntityTestVariation3"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="initialTaxRate/dataset" xsi:type="string">default</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> @@ -44,6 +47,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> </variation> <variation name="UpdateTaxRateEntityTestVariation4"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="initialTaxRate/dataset" xsi:type="string">withZipRange</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> @@ -56,6 +60,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> </variation> <variation name="UpdateTaxRateEntityTestVariation5"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="initialTaxRate/dataset" xsi:type="string">withZipRange</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">Yes</data> @@ -67,6 +72,7 @@ <constraint name="Magento\Tax\Test\Constraint\AssertTaxRateForm" /> </variation> <variation name="UpdateTaxRateEntityTestVariation6"> + <data name="tag" xsi:type="string">mftf_migrated:yes</data> <data name="initialTaxRate/dataset" xsi:type="string">withZipRange</data> <data name="taxRate/data/code" xsi:type="string">TaxIdentifier%isolation%</data> <data name="taxRate/data/zip_is_range" xsi:type="string">No</data> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic_green.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic_green.xml index 7eea71a955c..17578fcfe85 100644 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic_green.xml +++ b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic_green.xml @@ -11,6 +11,7 @@ <deny> <tag group="stable" value="no" /> <tag group="to_maintain" value="yes" /> + <tag group="mftf_migrated" value="yes" /> </deny> </rule> <rule scope="testsuite"> @@ -23,6 +24,7 @@ <deny> <tag group="test_type" value="3rd_party_test, 3rd_party_test_single_flow" /> <tag group="stable" value="no" /> + <tag group="mftf_migrated" value="yes" /> <tag group="to_maintain" value="yes" /> </deny> </rule> From cd10fac5b5334390c1e27d4df4a20c737dacd686 Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@magento.com> Date: Mon, 3 Dec 2018 10:48:42 -0600 Subject: [PATCH 130/131] MQE-1187: Fix MFTF skipped tests - Unskipped working tests --- .../Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml | 3 +-- .../Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml | 3 --- ...SortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml | 3 --- .../Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml | 3 --- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml index 496bb793430..26f8817c0a1 100644 --- a/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml +++ b/app/code/Magento/Backup/Test/Mftf/Test/AdminCreateAndDeleteBackupsTest.xml @@ -18,8 +18,7 @@ <testCaseId value="MAGETWO-94176"/> <group value="backup"/> <skip> - <issueId value="MQE-1187"/> - <issueId value="DEVOPS-3512"/> + <issueId value="MC-5807"/> </skip> </annotations> diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml index 9d19f7307dd..03edc69e6d6 100644 --- a/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml +++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminAddImageToWYSIWYGBlockTest.xml @@ -16,9 +16,6 @@ <description value="Admin should be able to add image to WYSIWYG content of Block"/> <severity value="CRITICAL"/> <testCaseId value="MAGETWO-84376"/> - <skip> - <issueId value="MQE-1187" /> - </skip> </annotations> <before> <createData entity="_defaultCmsPage" stepKey="createCMSPage" /> diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml index f44ba8a041c..c93b216fc89 100644 --- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml +++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Test/StorefrontSortingByPriceForConfigurableWithCatalogRuleAppliedTest.xml @@ -17,9 +17,6 @@ <severity value="CRITICAL"/> <testCaseId value="MAGETWO-69988"/> <group value="сonfigurable_product"/> - <skip> - <issueId value="MAGETWO-96658"/> - </skip> </annotations> <before> <createData entity="ApiCategory" stepKey="createCategory"/> diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml index 3b9361f7987..0d9df9176d2 100644 --- a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml +++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminUrlRewritesForProductInAnchorCategoriesTest.xml @@ -16,9 +16,6 @@ <severity value="CRITICAL"/> <testCaseId value="MAGETWO-69826"/> <group value="urlRewrite"/> - <skip> - <issueId value="MAGETWO-96713"/> - </skip> </annotations> <!-- Preconditions--> From c442739a0f2bd949918ec5584c22b058d69177f3 Mon Sep 17 00:00:00 2001 From: Tom Reece <treece@adobe.com> Date: Fri, 7 Dec 2018 13:04:49 -0600 Subject: [PATCH 131/131] MQE-1383: Deliver mtf-eol-pr branch to mainline --- .../Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml | 2 +- .../Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml | 2 +- .../Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml | 2 +- .../Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml index 2c8e245371d..cb79de19ce2 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateLargeRateTest.xml @@ -11,7 +11,7 @@ <test name="AdminCreateTaxRateLargeRateTest"> <annotations> <stories value="Create tax rate"/> - <title value="Create Tax Rate, large rate"/> + <title value="Create tax rate, large rate"/> <description value="Test log in to Create Tax Rate and Create Large Rate"/> <testCaseId value="MC-5322"/> <severity value="CRITICAL"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml index 4c5f6045d41..696d6c4c877 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateSpecificPostcodeTest.xml @@ -11,7 +11,7 @@ <test name="AdminCreateTaxRateSpecificPostcodeTest"> <annotations> <stories value="Create tax rate"/> - <title value="Create tax rate,specific postcode"/> + <title value="Create tax rate, specific postcode"/> <description value="Test log in to Create Tax Rate and Create specific Postcode"/> <testCaseId value="MC-5320"/> <severity value="CRITICAL"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml index 38c74f817d8..c6c5e318cc7 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateWiderZipCodeRangeTest.xml @@ -11,7 +11,7 @@ <test name="AdminCreateTaxRateWiderZipCodeRangeTest"> <annotations> <stories value="Create tax rate"/> - <title value="Create Tax Rate, wider zip code range"/> + <title value="Create tax rate, wider zip code range"/> <description value="Test log in to Create Tax Rate and Create Wider Zip Code Range"/> <testCaseId value="MC-5321"/> <severity value="CRITICAL"/> diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml index dcd6ce0270d..6d9717318ef 100644 --- a/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml +++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminCreateTaxRateZipCodeRangeTest.xml @@ -10,8 +10,8 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminCreateTaxRateZipCodeRangeTest"> <annotations> - <stories value="Create Tax Rate"/> - <title value="Create Tax Rate,zip code range"/> + <stories value="Create tax rate"/> + <title value="Create tax tate, zip code range"/> <description value="Test log in to Create Tax Rate and Create Zip Code Range"/> <testCaseId value="MC-5319"/> <severity value="CRITICAL"/>