Skip to content

Commit 4ecb6a5

Browse files
committed
Merge remote-tracking branch 'jackalopes/MAGETWO-71415' into pr-aug29
2 parents 4d9d6b0 + 48da96d commit 4ecb6a5

File tree

3 files changed

+456
-1
lines changed

3 files changed

+456
-1
lines changed

app/code/Magento/Ui/Component/MassAction/Filter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ private function getFilterIds()
223223
// Use collection's getAllIds for optimization purposes.
224224
$idsArray = $this->getDataProvider()->getAllIds();
225225
} else {
226-
$searchResult = $this->getDataProvider()->getSearchResult();
226+
$dataProvider = $this->getDataProvider();
227+
$dataProvider->setLimit(0, false);
228+
$searchResult = $dataProvider->getSearchResult();
227229
// Use compatible search api getItems when searchResult is not a collection.
228230
foreach ($searchResult->getItems() as $item) {
229231
/** @var $item \Magento\Framework\Api\Search\DocumentInterface */

dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/Index/MassAssignGroupTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,33 @@ public function testMassAssignGroupAction()
6969
$this->assertEquals(0, $customer->getGroupId());
7070
}
7171

72+
/**
73+
* @magentoDataFixture Magento/Customer/_files/twenty_one_customers.php
74+
*/
75+
public function testLargeGroupMassAssignGroupAction()
76+
{
77+
78+
for ($i = 1; $i < 22; $i++) {
79+
$customer = $this->customerRepository->getById($i);
80+
$this->assertEquals(1, $customer->getGroupId());
81+
}
82+
83+
$this->getRequest()
84+
->setParam('group', 0)
85+
->setPostValue('namespace', 'customer_listing')
86+
->setPostValue('selected', [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]);
87+
$this->dispatch('backend/customer/index/massAssignGroup');
88+
$this->assertSessionMessages(
89+
$this->equalTo(['A total of 21 record(s) were updated.']),
90+
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
91+
);
92+
$this->assertRedirect($this->stringStartsWith($this->baseControllerUrl));
93+
for ($i = 1; $i < 22; $i++) {
94+
$customer = $this->customerRepository->getById($i);
95+
$this->assertEquals(0, $customer->getGroupId());
96+
}
97+
}
98+
7299
/**
73100
* Valid group Id but no customer Ids specified
74101
* @magentoDbIsolation enabled

0 commit comments

Comments
 (0)