Skip to content

Commit 10df2ce

Browse files
committed
Replace getListSize with getList
This is not so performant, but as discussed in github it'll do for now.
1 parent ca50c9d commit 10df2ce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/code/Magento/Indexer/Console/Command/IndexerStatusCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private function getPendingCount(Mview\ViewInterface $view)
103103

104104
$state = $view->getState();
105105

106-
$pendingCount = $changelog->getListSize($state->getVersionId(), $currentVersionId);
106+
$pendingCount = count($changelog->getList($state->getVersionId(), $currentVersionId));
107107

108108
$pendingString = "<error>$pendingCount</error>";
109109
if ($pendingCount <= 0) {

app/code/Magento/Indexer/Test/Unit/Console/Command/IndexerStatusCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ class IndexerStatusCommandTest extends AbstractIndexerCommandCommonSetup
2727
*/
2828
private function attachViewToIndexerMock($indexerMock, array $data)
2929
{
30-
/** @var \Magento\Framework\Mview\View\Changelog|\PHPUnit_Framework_MockObject_MockObject $stub */
30+
/** @var \Magento\Framework\Mview\View\Changelog|\PHPUnit_Framework_MockObject_MockObject $changelog */
3131
$changelog = $this->getMockBuilder(\Magento\Framework\Mview\View\Changelog::class)
3232
->disableOriginalConstructor()
3333
->getMock();
3434

3535
$changelog->expects($this->any())
36-
->method('getListSize')
37-
->willReturn($data['view']['changelog']['list_size']);
36+
->method('getList')
37+
->willReturn(range(0, $data['view']['changelog']['list_size']-1));
3838

3939
/** @var \Magento\Indexer\Model\Mview\View\State|\PHPUnit_Framework_MockObject_MockObject $stateMock */
4040
$stateMock = $this->getMockBuilder(\Magento\Indexer\Model\Mview\View\State::class)

0 commit comments

Comments
 (0)