From ab769ad412470244e9d3694bfea58479afa0332a Mon Sep 17 00:00:00 2001 From: MaxNovik Date: Tue, 10 Jul 2018 21:43:44 +0300 Subject: [PATCH 01/10] [Backport] MAGETWO-91411: Delete action in grid could be sent multiple times --- .../Adminhtml/Product/MassDelete.php | 9 +- .../Ui/Component/MassAction/Filter.php | 12 +- .../Adminhtml/Index/MassAssignGroupTest.php | 101 +++++++++--- .../Adminhtml/Index/MassDeleteTest.php | 154 +++++++++++++++--- .../Adminhtml/Index/MassSubscribeTest.php | 76 +++++++-- .../_files/five_repository_customers.php | 47 ++++++ .../five_repository_customers_rollback.php | 28 ++++ 7 files changed, 355 insertions(+), 72 deletions(-) create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php create mode 100644 dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers_rollback.php diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php index a27783ab3f3fe..361f1ca8422d5 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/MassDelete.php @@ -54,9 +54,12 @@ public function execute() $product->delete(); $productDeleted++; } - $this->messageManager->addSuccess( - __('A total of %1 record(s) have been deleted.', $productDeleted) - ); + + if ($productDeleted) { + $this->messageManager->addSuccess( + __('A total of %1 record(s) have been deleted.', $productDeleted) + ); + } return $this->resultFactory->create(ResultFactory::TYPE_REDIRECT)->setPath('catalog/*/index'); } diff --git a/app/code/Magento/Ui/Component/MassAction/Filter.php b/app/code/Magento/Ui/Component/MassAction/Filter.php index 43d8c177c9792..1bb4cbb1c5420 100644 --- a/app/code/Magento/Ui/Component/MassAction/Filter.php +++ b/app/code/Magento/Ui/Component/MassAction/Filter.php @@ -101,13 +101,11 @@ public function getCollection(AbstractDb $collection) throw new LocalizedException(__('Please select item(s).')); } } - $idsArray = $this->getFilterIds(); - if (!empty($idsArray)) { - $collection->addFieldToFilter( - $collection->getIdFieldName(), - ['in' => $idsArray] - ); - } + + $collection->addFieldToFilter( + $collection->getIdFieldName(), + ['in' => $this->getFilterIds()] + ); return $collection; } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php index 71b11df5b1334..725078d8b1cfa 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php @@ -5,13 +5,17 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; -use Magento\TestFramework\Helper\Bootstrap; use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Message\MessageInterface; +use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\AbstractBackendController; /** * @magentoAppArea adminhtml */ -class MassAssignGroupTest extends \Magento\TestFramework\TestCase\AbstractBackendController +class MassAssignGroupTest extends AbstractBackendController { /** * Base controller URL @@ -28,9 +32,7 @@ class MassAssignGroupTest extends \Magento\TestFramework\TestCase\AbstractBacken protected function setUp() { parent::setUp(); - $this->customerRepository = Bootstrap::getObjectManager()->get( - 'Magento\Customer\Api\CustomerRepositoryInterface' - ); + $this->customerRepository = Bootstrap::getObjectManager()->get(CustomerRepositoryInterface::class); } protected function tearDown() @@ -47,39 +49,100 @@ protected function tearDown() } /** - * @magentoDataFixture Magento/Customer/_files/customer.php + * Tests os update a single customer record. + * + * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php + * @magentoDbIsolation disabled */ public function testMassAssignGroupAction() { - $customer = $this->customerRepository->getById(1); - $this->assertEquals(1, $customer->getGroupId()); + $customerEmail = 'customer1@example.com'; + try { + /** @var CustomerInterface $customer */ + $customer = $this->customerRepository->get($customerEmail); + $this->assertEquals(1, $customer->getGroupId()); + + $params = [ + 'group' => 0, + 'namespace' => 'customer_listing', + 'selected' => [$customer->getId()] + ]; + + $this->getRequest()->setParams($params); + $this->dispatch('backend/customer/index/massAssignGroup'); + $this->assertSessionMessages( + self::equalTo(['A total of 1 record(s) were updated.']), + MessageInterface::TYPE_SUCCESS + ); + $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl)); + + $customer = $this->customerRepository->get($customerEmail); + $this->assertEquals(0, $customer->getGroupId()); + } catch (LocalizedException $e) { + self::fail($e->getMessage()); + } + } + + /** + * Tests os update a multiple customer records. + * + * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php + * @magentoDbIsolation disabled + */ + public function testLargeGroupMassAssignGroupAction() + { + $ids = []; + for ($i = 1; $i <= 5; $i++) { + /** @var CustomerInterface $customer */ + try { + $customer = $this->customerRepository->get('customer'.$i.'@example.com'); + $this->assertEquals(1, $customer->getGroupId()); + $ids[] = $customer->getId(); + } catch (\Exception $e) { + self::fail($e->getMessage()); + } + } + + $params = [ + 'group' => 0, + 'namespace' => 'customer_listing', + 'selected' => $ids, + ]; - $this->getRequest() - ->setParam('group', 0) - ->setPostValue('namespace', 'customer_listing') - ->setPostValue('selected', [1]); + $this->getRequest()->setParams($params); $this->dispatch('backend/customer/index/massAssignGroup'); $this->assertSessionMessages( - $this->equalTo(['A total of 1 record(s) were updated.']), - \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS + self::equalTo(['A total of 5 record(s) were updated.']), + MessageInterface::TYPE_SUCCESS ); $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl)); - - $customer = $this->customerRepository->getById(1); - $this->assertEquals(0, $customer->getGroupId()); + for ($i = 1; $i < 5; $i++) { + try { + /** @var CustomerInterface $customer */ + $customer = $this->customerRepository->get('customer'.$i.'@example.com'); + $this->assertEquals(0, $customer->getGroupId()); + } catch (\Exception $e) { + self::fail($e->getMessage()); + } + } } /** * Valid group Id but no customer Ids specified + * * @magentoDbIsolation enabled */ public function testMassAssignGroupActionNoCustomerIds() { - $this->getRequest()->setParam('group', 0)->setPostValue('namespace', 'customer_listing'); + $params = [ + 'group' => 0, + 'namespace' => 'customer_listing', + ]; + $this->getRequest()->setParams($params); $this->dispatch('backend/customer/index/massAssignGroup'); $this->assertSessionMessages( $this->equalTo(['Please select item(s).']), - \Magento\Framework\Message\MessageInterface::TYPE_ERROR + MessageInterface::TYPE_ERROR ); } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php index b57cddd0d3834..081b36f45f775 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php @@ -5,58 +5,162 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; +use Magento\Framework\Exception\LocalizedException; +use PHPUnit\Framework\Constraint\Constraint; +use Magento\Framework\Message\MessageInterface; use Magento\TestFramework\Helper\Bootstrap; +use Magento\TestFramework\TestCase\AbstractBackendController; /** * @magentoAppArea adminhtml */ -class MassDeleteTest extends \Magento\TestFramework\TestCase\AbstractBackendController +class MassDeleteTest extends AbstractBackendController { + /** + * @var CustomerRepositoryInterface + */ + private $customerRepository; + /** * Base controller URL * * @var string */ - protected $baseControllerUrl = 'http://localhost/index.php/backend/customer/index/index'; + private $baseControllerUrl = 'http://localhost/index.php/backend/customer/index/index'; - protected function tearDown() + protected function setUp() { - /** - * Unset customer data - */ - Bootstrap::getObjectManager()->get('Magento\Backend\Model\Session')->setCustomerData(null); + parent::setUp(); + $this->customerRepository = Bootstrap::getObjectManager()->get(CustomerRepositoryInterface::class); + } - /** - * Unset messages - */ - Bootstrap::getObjectManager()->get('Magento\Backend\Model\Session')->getMessages(true); + /** + * Validates failure attempts to delete customers from grid. + * + * @param array|null $ids + * @param Constraint $constraint + * @param string|null $messageType + * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php + * @magentoDbIsolation disabled + * @dataProvider failedRequestDataProvider + */ + public function testFailedMassDeleteAction($ids, Constraint $constraint, $messageType) + { + $this->massDeleteAssertions($ids, $constraint, $messageType); } /** - * @magentoDataFixture Magento/Customer/_files/customer.php + * Validates success attempt to delete customer from grid. + * + * @param array $emails + * @param Constraint $constraint + * @param string $messageType + * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php + * @magentoDbIsolation disabled + * @dataProvider successRequestDataProvider + */ + public function testSuccessMassDeleteAction(array $emails, Constraint $constraint, string $messageType) + { + try { + $ids = []; + foreach ($emails as $email) { + /** @var CustomerInterface $customer */ + $customer = $this->customerRepository->get($email); + $ids[] = $customer->getId(); + } + + $this->massDeleteAssertions( + $ids, + $constraint, + $messageType + ); + } catch (LocalizedException $e) { + self::fail($e->getMessage()); + } + } + + /** + * Performs required request and assertions. + * + * @param array|null $ids + * @param Constraint $constraint + * @param string|null $messageType */ - public function testMassDeleteAction() + private function massDeleteAssertions($ids, Constraint $constraint, $messageType) { - $this->getRequest()->setPostValue('selected', [1])->setPostValue('namespace', 'customer_listing'); + $requestData = [ + 'selected' => $ids, + 'namespace' => 'customer_listing', + ]; + + $this->getRequest()->setParams($requestData); $this->dispatch('backend/customer/index/massDelete'); $this->assertSessionMessages( - $this->equalTo(['A total of 1 record(s) were deleted.']), - \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS + $constraint, + $messageType ); $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl)); } /** - * Valid group Id but no customer Ids specified - * @magentoDbIsolation enabled + * Provides sets of data for unsuccessful attempts. + * + * @return array */ - public function testMassDeleteActionNoCustomerIds() + public function failedRequestDataProvider() { - $this->getRequest()->setPostValue('namespace', 'customer_listing'); - $this->dispatch('backend/customer/index/massDelete'); - $this->assertSessionMessages( - $this->equalTo(['Please select item(s).']), - \Magento\Framework\Message\MessageInterface::TYPE_ERROR - ); + return [ + [ + 'ids' => [], + 'constraint' => self::equalTo(['Please select item(s).']), + 'messageType' => MessageInterface::TYPE_ERROR, + ], + [ + 'ids' => [111], + 'constraint' => self::isEmpty(), + 'messageType' => null, + ], + [ + 'ids' => null, + 'constraint' => self::equalTo(['Please select item(s).']), + 'messageType' => MessageInterface::TYPE_ERROR, + ] + ]; + } + + /** + * Provides sets of data for successful attempts. + * + * @return array + */ + public function successRequestDataProvider() + { + return [ + [ + 'customerEmails' => ['customer1@example.com'], + 'constraint' => self::equalTo(['A total of 1 record(s) were deleted.']), + 'messageType' => MessageInterface::TYPE_SUCCESS, + ], + [ + 'customerEmails' => ['customer2@example.com', 'customer3@example.com'], + 'constraint' => self::equalTo(['A total of 2 record(s) were deleted.']), + 'messageType' => MessageInterface::TYPE_SUCCESS, + ], + ]; + } + + protected function tearDown() + { + /** + * Unset customer data + */ + Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->setCustomerData(null); + + /** + * Unset messages + */ + Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->getMessages(true); } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php index 91f04df7ba471..5347c23f95b77 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassSubscribeTest.php @@ -5,8 +5,12 @@ */ namespace Magento\Customer\Controller\Adminhtml\Index; +use Magento\Framework\Message\MessageInterface; use Magento\Newsletter\Model\Subscriber; +use Magento\Newsletter\Model\SubscriberFactory; use Magento\TestFramework\Helper\Bootstrap; +use Magento\Customer\Api\CustomerRepositoryInterface; +use Magento\Customer\Api\Data\CustomerInterface; /** * @magentoAppArea adminhtml @@ -25,58 +29,94 @@ protected function tearDown() /** * Unset customer data */ - Bootstrap::getObjectManager()->get('Magento\Backend\Model\Session')->setCustomerData(null); + Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->setCustomerData(null); /** * Unset messages */ - Bootstrap::getObjectManager()->get('Magento\Backend\Model\Session')->getMessages(true); + Bootstrap::getObjectManager()->get(\Magento\Backend\Model\Session::class)->getMessages(true); } /** - * @magentoDataFixture Magento/Customer/_files/two_customers.php + * Tests subscriber status of customers. + * + * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php + * @magentoDbIsolation disabled */ public function testMassSubscriberAction() { - // Pre-condition - /** @var \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory */ - $subscriberFactory = Bootstrap::getObjectManager()->get('Magento\Newsletter\Model\SubscriberFactory'); - $this->assertNull($subscriberFactory->create()->loadByCustomerId(1)->getSubscriberStatus()); - $this->assertNull($subscriberFactory->create()->loadByCustomerId(2)->getSubscriberStatus()); - // Setup - $this->getRequest()->setPostValue('selected', [1, 2])->setPostValue('namespace', 'customer_listing'); + /** @var SubscriberFactory $subscriberFactory */ + $subscriberFactory = Bootstrap::getObjectManager()->get(SubscriberFactory::class); + $customerRepository = Bootstrap::getObjectManager()->get(CustomerRepositoryInterface::class); + + $this->assertNull( + $subscriberFactory->create() + ->loadByEmail('customer1@example.com') + ->getSubscriberStatus() + ); + $this->assertNull( + $subscriberFactory->create() + ->loadByEmail('customer2@example.com') + ->getSubscriberStatus() + ); + + try { + /** @var CustomerInterface $customer1 */ + $customer1 = $customerRepository->get('customer1@example.com'); + /** @var CustomerInterface $customer2 */ + $customer2 = $customerRepository->get('customer2@example.com'); + } catch (\Exception $e) { + self::fail($e->getMessage()); + } + + $params = [ + 'selected' => [ + $customer1->getId(), + $customer2->getId(), + ], + 'namespace' => 'customer_listing', + ]; + $this->getRequest()->setParams($params); - // Test $this->dispatch('backend/customer/index/massSubscribe'); // Assertions $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl)); $this->assertSessionMessages( - $this->equalTo(['A total of 2 record(s) were updated.']), - \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS + self::equalTo(['A total of 2 record(s) were updated.']), + MessageInterface::TYPE_SUCCESS ); $this->assertEquals( Subscriber::STATUS_SUBSCRIBED, - $subscriberFactory->create()->loadByCustomerId(1)->getSubscriberStatus() + $subscriberFactory->create() + ->loadByEmail('customer1@example.com') + ->getSubscriberStatus() ); $this->assertEquals( Subscriber::STATUS_SUBSCRIBED, - $subscriberFactory->create()->loadByCustomerId(2)->getSubscriberStatus() + $subscriberFactory->create() + ->loadByEmail('customer2@example.com') + ->getSubscriberStatus() ); } /** + * @magentoAppIsolation enabled * @magentoDbIsolation enabled */ public function testMassSubscriberActionNoSelection() { - $this->getRequest()->setPostValue('namespace', 'customer_listing'); + $params = [ + 'namespace' => 'customer_listing' + ]; + + $this->getRequest()->setParams($params); $this->dispatch('backend/customer/index/massSubscribe'); $this->assertRedirect($this->stringStartsWith($this->baseControllerUrl)); $this->assertSessionMessages( - $this->equalTo(['Please select item(s).']), - \Magento\Framework\Message\MessageInterface::TYPE_ERROR + self::equalTo(['Please select item(s).']), + MessageInterface::TYPE_ERROR ); } } diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php new file mode 100644 index 0000000000000..e7613ba733173 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php @@ -0,0 +1,47 @@ +create(CustomerRepositoryInterface::class); +/** @var CustomerInterfaceFactory $customerFactory */ +$customerFactory = $objectManager->get(CustomerInterfaceFactory::class); + +for ($i=1; $i<=5; $i++) { + /** @var CustomerInterface $customer */ + $customer = $customerFactory->create(); + $customer->setFirstname('John') + ->setGroupId(1) + ->setLastname('Smith') + ->setWebsiteId(1) + ->setEmail('customer'.$i.'@example.com'); + try { + $customerRepository->save($customer, 'password'); + } catch (\Exception $e) { + } +} + +/** @var EavModelConfig $eavConfig */ +$eavConfig = $objectManager->get(EavModelConfig::class); +$eavConfig->clear(); + +/** @var IndexerRegistry $indexerRegistry */ +$indexerRegistry = $objectManager->create(IndexerRegistry::class); +/** @var IndexerInterface $indexer */ +$indexer = $indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID); +try { + $indexer->reindexAll(); +} catch (\Exception $e) { +} diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers_rollback.php b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers_rollback.php new file mode 100644 index 0000000000000..12888235a17ba --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers_rollback.php @@ -0,0 +1,28 @@ +create(CustomerRepositoryInterface::class); + +for ($i=1; $i<=5; $i++) { + try { + /** @var CustomerInterface $customer */ + $customer = $customerRepository->get('customer'.$i.'@example.com'); + $customerRepository->delete($customer); + } catch (\Exception $e) { + } +} + +/** @var EavModelConfig $eavConfig */ +$eavConfig = $objectManager->get(EavModelConfig::class); +$eavConfig->clear(); From 92320d74b10cd34dbf2115f0e7885ea459735698 Mon Sep 17 00:00:00 2001 From: Maksym Novik Date: Thu, 12 Jul 2018 19:30:10 +0300 Subject: [PATCH 02/10] [Backport] MAGETWO-91411: Delete action in grid could be sent multiple times. Fixed integration tests. --- .../Controller/Adminhtml/Index/MassDeleteTest.php | 14 +++++++------- .../Customer/_files/five_repository_customers.php | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php index 081b36f45f775..d0695cf17c80b 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassDeleteTest.php @@ -8,10 +8,10 @@ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\Exception\LocalizedException; -use PHPUnit\Framework\Constraint\Constraint; use Magento\Framework\Message\MessageInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\TestCase\AbstractBackendController; +use PHPUnit_Framework_Constraint; /** * @magentoAppArea adminhtml @@ -40,13 +40,13 @@ protected function setUp() * Validates failure attempts to delete customers from grid. * * @param array|null $ids - * @param Constraint $constraint + * @param \PHPUnit_Framework_Constraint $constraint * @param string|null $messageType * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php * @magentoDbIsolation disabled * @dataProvider failedRequestDataProvider */ - public function testFailedMassDeleteAction($ids, Constraint $constraint, $messageType) + public function testFailedMassDeleteAction($ids, PHPUnit_Framework_Constraint $constraint, $messageType) { $this->massDeleteAssertions($ids, $constraint, $messageType); } @@ -55,13 +55,13 @@ public function testFailedMassDeleteAction($ids, Constraint $constraint, $messag * Validates success attempt to delete customer from grid. * * @param array $emails - * @param Constraint $constraint + * @param PHPUnit_Framework_Constraint $constraint * @param string $messageType * @magentoDataFixture Magento/Customer/_files/five_repository_customers.php * @magentoDbIsolation disabled * @dataProvider successRequestDataProvider */ - public function testSuccessMassDeleteAction(array $emails, Constraint $constraint, string $messageType) + public function testSuccessMassDeleteAction(array $emails, PHPUnit_Framework_Constraint $constraint, $messageType) { try { $ids = []; @@ -85,10 +85,10 @@ public function testSuccessMassDeleteAction(array $emails, Constraint $constrain * Performs required request and assertions. * * @param array|null $ids - * @param Constraint $constraint + * @param PHPUnit_Framework_Constraint $constraint * @param string|null $messageType */ - private function massDeleteAssertions($ids, Constraint $constraint, $messageType) + private function massDeleteAssertions($ids, PHPUnit_Framework_Constraint $constraint, $messageType) { $requestData = [ 'selected' => $ids, diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php index e7613ba733173..97143262cd161 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php @@ -2,7 +2,7 @@ /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. - +*/ use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Api\Data\CustomerInterfaceFactory; @@ -12,9 +12,9 @@ use Magento\Framework\Indexer\IndexerRegistry; use Magento\TestFramework\Helper\Bootstrap; +/** @var CustomerRepositoryInterface $customerRepository */ $objectManager = Bootstrap::getObjectManager(); -/** @var CustomerRepositoryInterface $customerRepository */ $customerRepository = $objectManager->create(CustomerRepositoryInterface::class); /** @var CustomerInterfaceFactory $customerFactory */ $customerFactory = $objectManager->get(CustomerInterfaceFactory::class); From fd574359b393dbe7b279f37ef514dde227407aad Mon Sep 17 00:00:00 2001 From: Maksym Novik Date: Fri, 13 Jul 2018 14:34:22 +0300 Subject: [PATCH 03/10] [Backport] MAGETWO-91411: Delete action in grid could be sent multiple times. Reformated file. --- .../Magento/Customer/_files/five_repository_customers.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php index 97143262cd161..cd855d1cdc5ee 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php +++ b/dev/tests/integration/testsuite/Magento/Customer/_files/five_repository_customers.php @@ -2,7 +2,8 @@ /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. -*/ + */ + use Magento\Customer\Api\CustomerRepositoryInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Customer\Api\Data\CustomerInterfaceFactory; @@ -19,14 +20,14 @@ /** @var CustomerInterfaceFactory $customerFactory */ $customerFactory = $objectManager->get(CustomerInterfaceFactory::class); -for ($i=1; $i<=5; $i++) { +for ($i = 1; $i <= 5; $i++) { /** @var CustomerInterface $customer */ $customer = $customerFactory->create(); $customer->setFirstname('John') ->setGroupId(1) ->setLastname('Smith') ->setWebsiteId(1) - ->setEmail('customer'.$i.'@example.com'); + ->setEmail('customer' . $i . '@example.com'); try { $customerRepository->save($customer, 'password'); } catch (\Exception $e) { From 39933f76d98350969b6e0c7e812ca5e21ede0127 Mon Sep 17 00:00:00 2001 From: mageprince <7pprince@gmail.com> Date: Tue, 17 Jul 2018 14:22:43 +0530 Subject: [PATCH 04/10] Update Tax.php --- app/code/Magento/Tax/Block/Sales/Order/Tax.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/code/Magento/Tax/Block/Sales/Order/Tax.php b/app/code/Magento/Tax/Block/Sales/Order/Tax.php index 086451eed085b..fe66de0d254e6 100644 --- a/app/code/Magento/Tax/Block/Sales/Order/Tax.php +++ b/app/code/Magento/Tax/Block/Sales/Order/Tax.php @@ -256,16 +256,11 @@ protected function _initShipping() } /** - * @return void + * @return null */ protected function _initDiscount() { - // $store = $this->getStore(); - // $parent = $this->getParentBlock(); - // if ($this->_config->displaySales) { - // - // } elseif ($this->_config->displaySales) { - // } + return null; } /** From ff88ba97f182abfba499d5148a80960e40995b1b Mon Sep 17 00:00:00 2001 From: mageprince <7pprince@gmail.com> Date: Tue, 17 Jul 2018 15:12:18 +0530 Subject: [PATCH 05/10] Update Tax.php --- app/code/Magento/Tax/Block/Sales/Order/Tax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Tax/Block/Sales/Order/Tax.php b/app/code/Magento/Tax/Block/Sales/Order/Tax.php index fe66de0d254e6..63046ef3d5bce 100644 --- a/app/code/Magento/Tax/Block/Sales/Order/Tax.php +++ b/app/code/Magento/Tax/Block/Sales/Order/Tax.php @@ -256,11 +256,11 @@ protected function _initShipping() } /** - * @return null + * @return void */ protected function _initDiscount() { - return null; + return; } /** From a40f06b492a6044768ef78dce6c20af39eb7b829 Mon Sep 17 00:00:00 2001 From: Vlad Veselov Date: Tue, 17 Jul 2018 23:16:20 +0300 Subject: [PATCH 06/10] Update Tax.php --- app/code/Magento/Tax/Block/Sales/Order/Tax.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/code/Magento/Tax/Block/Sales/Order/Tax.php b/app/code/Magento/Tax/Block/Sales/Order/Tax.php index 63046ef3d5bce..dcbaeda1f4be7 100644 --- a/app/code/Magento/Tax/Block/Sales/Order/Tax.php +++ b/app/code/Magento/Tax/Block/Sales/Order/Tax.php @@ -260,7 +260,6 @@ protected function _initShipping() */ protected function _initDiscount() { - return; } /** From 190e6e3105f89983edd81a570a256d3825d61ec6 Mon Sep 17 00:00:00 2001 From: Ronak Patel <11473750+ronak2ram@users.noreply.github.com> Date: Mon, 23 Jul 2018 16:15:36 +0530 Subject: [PATCH 07/10] Wrong namespace defined in compare.phtml --- .../view/frontend/templates/product/view/addto/compare.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/frontend/templates/product/view/addto/compare.phtml b/app/code/Magento/Catalog/view/frontend/templates/product/view/addto/compare.phtml index 9b8245419045d..d7941c187d149 100644 --- a/app/code/Magento/Catalog/view/frontend/templates/product/view/addto/compare.phtml +++ b/app/code/Magento/Catalog/view/frontend/templates/product/view/addto/compare.phtml @@ -6,7 +6,7 @@ // @codingStandardsIgnoreFile -/** @var $block \Magento\Catalog\Block\Catalog\Product\View\Addto\Compare */ +/** @var $block \Magento\Catalog\Block\Product\View\Addto\Compare */ ?> Date: Sun, 7 Jan 2018 10:47:14 +0530 Subject: [PATCH 08/10] =?UTF-8?q?Newsletter=20Label=20is=20broking=20on=20?= =?UTF-8?q?chinese=20Language=20like=20=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Magento/luma/Magento_Newsletter/web/css/source/_module.less | 1 + 1 file changed, 1 insertion(+) diff --git a/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less index 94d7c7e4e5bff..9ccd6c190ec0e 100644 --- a/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less +++ b/app/design/frontend/Magento/luma/Magento_Newsletter/web/css/source/_module.less @@ -67,6 +67,7 @@ border-bottom-left-radius: 0; border-top-left-radius: 0; margin-left: -1px; + white-space: nowrap; } } } From 7b17bb15b5a9296429c4ece92e382f420c898ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karla=20Saarem=C3=A4e?= Date: Mon, 23 Jul 2018 23:08:24 +0300 Subject: [PATCH 09/10] removed _responsive.less import --- lib/web/mage/gallery/gallery.less | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/web/mage/gallery/gallery.less b/lib/web/mage/gallery/gallery.less index 24a5a2b4033d3..a45e34b6ba626 100644 --- a/lib/web/mage/gallery/gallery.less +++ b/lib/web/mage/gallery/gallery.less @@ -7,7 +7,6 @@ @import '../../css/source/lib/_lib.less'; // Global lib @import '../../css/source/_theme.less'; // Theme overrides @import '../../css/source/_variables.less'; // Local theme variables -@import '../../css/source/lib/_responsive.less'; @import 'module/_mixins.less'; //Mixins in gallery @import 'module/_extends.less'; @import 'module/_focus.less'; From df5234b5179c3f92fdbc4ce7a944d5a9e1978ec0 Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Thu, 19 Jul 2018 14:26:03 +0300 Subject: [PATCH 10/10] Revert changing file permissions in https://github.com/magento/magento2/pull/15144