Skip to content

Commit

Permalink
Replace getListSize with getList
Browse files Browse the repository at this point in the history
This is not so performant, but as discussed in github it'll do for now.
  • Loading branch information
convenient committed Dec 4, 2017
1 parent ca50c9d commit 10df2ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private function getPendingCount(Mview\ViewInterface $view)

$state = $view->getState();

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

$pendingString = "<error>$pendingCount</error>";
if ($pendingCount <= 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class IndexerStatusCommandTest extends AbstractIndexerCommandCommonSetup
*/
private function attachViewToIndexerMock($indexerMock, array $data)
{
/** @var \Magento\Framework\Mview\View\Changelog|\PHPUnit_Framework_MockObject_MockObject $stub */
/** @var \Magento\Framework\Mview\View\Changelog|\PHPUnit_Framework_MockObject_MockObject $changelog */
$changelog = $this->getMockBuilder(\Magento\Framework\Mview\View\Changelog::class)
->disableOriginalConstructor()
->getMock();

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

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

0 comments on commit 10df2ce

Please sign in to comment.