Skip to content

Commit 2498417

Browse files
arnie1947nikshostko
authored andcommitted
MAGETWO-67745: The "Catalog Search indexer process unknown error" appears after reindex
- Internal code review fixes.
1 parent 76de251 commit 2498417

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,13 @@ public function testGetByIdWhenCacheReduced()
488488
$expectedResult = [];
489489
$productsCount = $this->cacheLimit * 2;
490490

491-
$productMocks = $this->getProductMocksForReducedCache();
491+
$productMocks = $this->getProductMocksForReducedCache($productsCount);
492492
$productFactoryInvMock = $this->productFactoryMock->expects($this->exactly($productsCount))
493493
->method('create');
494494
call_user_func_array([$productFactoryInvMock, 'willReturnOnConsecutiveCalls'], $productMocks);
495495
$this->serializerMock->expects($this->atLeastOnce())->method('serialize');
496496

497-
for ($i = 1; $i <= $productsCount; $i ++) {
497+
for ($i = 1; $i <= $productsCount; $i++) {
498498
$product = $this->model->getById($i, false, 0);
499499
$result[] = $product->getId();
500500
$expectedResult[] = $i;
@@ -506,13 +506,14 @@ public function testGetByIdWhenCacheReduced()
506506
/**
507507
* Get product mocks for testGetByIdWhenCacheReduced() method.
508508
*
509+
* @param int $productsCount
509510
* @return array
510511
*/
511-
private function getProductMocksForReducedCache()
512+
private function getProductMocksForReducedCache($productsCount)
512513
{
513514
$productMocks = [];
514515

515-
for ($i = 1; $i <= $this->cacheLimit * 2; $i ++) {
516+
for ($i = 1; $i <= $productsCount; $i++) {
516517
$productMock = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
517518
->disableOriginalConstructor()
518519
->setMethods([

0 commit comments

Comments
 (0)