-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1374 from magento-troll/TrollTeam_PR
MAGETWO-70683 New registered customer not showed in admin customer grid MAGETWO-70869 Console errors after turning on CSS merging/minification
- Loading branch information
Showing
7 changed files
with
174 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
dev/tests/integration/testsuite/Magento/Customer/Model/ResourceModel/Grid/CollectionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Customer\Model\ResourceModel\Grid; | ||
|
||
use Magento\Customer\Api\CustomerRepositoryInterface; | ||
use Magento\Customer\Api\Data\CustomerInterface; | ||
use Magento\Framework\Indexer\IndexerRegistry; | ||
use Magento\TestFramework\Helper\Bootstrap; | ||
|
||
/** | ||
* Customer grid collection tests. | ||
*/ | ||
class CollectionTest extends \Magento\TestFramework\Indexer\TestCase | ||
{ | ||
/** @var \Magento\Framework\ObjectManagerInterface */ | ||
private $objectManager; | ||
|
||
/** @var IndexerRegistry */ | ||
private $indexerRegistry; | ||
|
||
/** @var \Magento\Customer\Model\ResourceModel\Grid\Collection */ | ||
private $targetObject; | ||
|
||
/** @var CustomerRepositoryInterface */ | ||
private $customerRepository; | ||
|
||
protected function setUp() | ||
{ | ||
$this->objectManager = Bootstrap::getObjectManager(); | ||
$this->indexerRegistry = $this->objectManager->create(IndexerRegistry::class); | ||
$this->targetObject = $this->objectManager | ||
->create(\Magento\Customer\Model\ResourceModel\Grid\Collection::class); | ||
$this->customerRepository = $this->objectManager->create(CustomerRepositoryInterface::class); | ||
} | ||
|
||
/** | ||
* Test updated data for customer grid indexer during save/update customer data(including address data) | ||
* in 'Update on Schedule' mode. | ||
* | ||
* Customer Grid Indexer can't work in 'Update on Schedule' mode. All data for indexer must be updated in realtime | ||
* during save/update customer data(including address data). | ||
* | ||
* @magentoDataFixture Magento/Customer/_files/customer_grid_indexer_enabled_update_on_schedule.php | ||
* @magentoDataFixture Magento/Customer/_files/customer_sample.php | ||
*/ | ||
public function testGetItemByIdForUpdateOnSchedule() | ||
{ | ||
/** Verify after first save */ | ||
/** @var CustomerInterface $newCustomer */ | ||
$newCustomer = $this->customerRepository->get('customer@example.com'); | ||
/** @var CustomerInterface $item */ | ||
$item = $this->targetObject->getItemById($newCustomer->getId()); | ||
$this->assertNotEmpty($item); | ||
$this->assertSame($newCustomer->getEmail(), $item->getEmail()); | ||
$this->assertSame('test street test city Armed Forces Middle East 01001', $item->getBillingFull()); | ||
|
||
/** Verify after update */ | ||
$newCustomer->setEmail('customer_updated@example.com'); | ||
$this->customerRepository->save($newCustomer); | ||
$this->targetObject->clear(); | ||
$item = $this->targetObject->getItemById($newCustomer->getId()); | ||
$this->assertSame($newCustomer->getEmail(), $item->getEmail()); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...on/testsuite/Magento/Customer/_files/customer_grid_indexer_enabled_update_on_schedule.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); | ||
/** @var Magento\Framework\Indexer\IndexerRegistry $indexerRegistry */ | ||
$indexerRegistry = $objectManager->create(\Magento\Framework\Indexer\IndexerRegistry::class); | ||
$indexer = $indexerRegistry->get(\Magento\Customer\Model\Customer::CUSTOMER_GRID_INDEXER_ID); | ||
$indexer->setScheduled(true); |
11 changes: 11 additions & 0 deletions
11
...ite/Magento/Customer/_files/customer_grid_indexer_enabled_update_on_schedule_rollback.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); | ||
/** @var Magento\Framework\Indexer\IndexerRegistry $indexerRegistry */ | ||
$indexerRegistry = $objectManager->create(\Magento\Framework\Indexer\IndexerRegistry::class); | ||
$indexer = $indexerRegistry->get(\Magento\Customer\Model\Customer::CUSTOMER_GRID_INDEXER_ID); | ||
$indexer->setScheduled(false); |