Skip to content

Commit

Permalink
MAGETWO-67745: The "Catalog Search indexer process unknown error" app…
Browse files Browse the repository at this point in the history
…ears after reindex

- Internal code review fixes.
  • Loading branch information
arnie1947 authored and nikshostko committed May 18, 2017
1 parent 76de251 commit 2498417
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,13 @@ public function testGetByIdWhenCacheReduced()
$expectedResult = [];
$productsCount = $this->cacheLimit * 2;

$productMocks = $this->getProductMocksForReducedCache();
$productMocks = $this->getProductMocksForReducedCache($productsCount);
$productFactoryInvMock = $this->productFactoryMock->expects($this->exactly($productsCount))
->method('create');
call_user_func_array([$productFactoryInvMock, 'willReturnOnConsecutiveCalls'], $productMocks);
$this->serializerMock->expects($this->atLeastOnce())->method('serialize');

for ($i = 1; $i <= $productsCount; $i ++) {
for ($i = 1; $i <= $productsCount; $i++) {
$product = $this->model->getById($i, false, 0);
$result[] = $product->getId();
$expectedResult[] = $i;
Expand All @@ -506,13 +506,14 @@ public function testGetByIdWhenCacheReduced()
/**
* Get product mocks for testGetByIdWhenCacheReduced() method.
*
* @param int $productsCount
* @return array
*/
private function getProductMocksForReducedCache()
private function getProductMocksForReducedCache($productsCount)
{
$productMocks = [];

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

0 comments on commit 2498417

Please sign in to comment.