Skip to content

Commit 2f92a1d

Browse files
committed
add test coverage
1 parent 04c04d4 commit 2f92a1d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

app/code/Magento/Catalog/Model/Indexer/Category/Product/TableMaintainer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ private function getConnection()
7878
}
7979

8080
/**
81-
* Expose connection so callers can use the same adapter instance
82-
* that created temporary tables.
81+
* Expose connection so callers can use the same adapter instance that created temporary tables.
8382
*
8483
* @return AdapterInterface
8584
*/

app/code/Magento/Indexer/Test/Unit/Model/IndexerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public function testReindexAll()
245245
->method('load')->with($indexId, 'indexer_id')->willReturnSelf();
246246
$stateMock->expects($this->never())->method('setIndexerId');
247247
$stateMock->expects($this->once())->method('getId')->willReturn(1);
248-
$stateMock->expects($this->exactly(2))->method('setStatus')->willReturnSelf();
248+
$stateMock->expects($this->exactly(3))->method('setStatus')->willReturnSelf();
249249
$stateMock->expects($this->any())->method('getStatus')->willReturn('idle');
250250
$stateMock->expects($this->exactly(2))->method('save')->willReturnSelf();
251251
$this->stateFactoryMock->expects($this->once())->method('create')->willReturn($stateMock);
@@ -286,7 +286,7 @@ public function testReindexAllWithException()
286286
->method('load')->with($indexId, 'indexer_id')->willReturnSelf();
287287
$stateMock->expects($this->never())->method('setIndexerId');
288288
$stateMock->expects($this->once())->method('getId')->willReturn(1);
289-
$stateMock->expects($this->exactly(2))->method('setStatus')->willReturnSelf();
289+
$stateMock->expects($this->exactly(3))->method('setStatus')->willReturnSelf();
290290
$stateMock->expects($this->any())->method('getStatus')->willReturn('idle');
291291
$stateMock->expects($this->exactly(2))->method('save')->willReturnSelf();
292292
$this->stateFactoryMock->expects($this->once())->method('create')->willReturn($stateMock);
@@ -332,7 +332,7 @@ public function testReindexAllWithError()
332332
->method('load')->with($indexId, 'indexer_id')->willReturnSelf();
333333
$stateMock->expects($this->never())->method('setIndexerId');
334334
$stateMock->expects($this->once())->method('getId')->willReturn(1);
335-
$stateMock->expects($this->exactly(2))->method('setStatus')->willReturnSelf();
335+
$stateMock->expects($this->exactly(3))->method('setStatus')->willReturnSelf();
336336
$stateMock->expects($this->any())->method('getStatus')->willReturn('idle');
337337
$stateMock->expects($this->exactly(2))->method('save')->willReturnSelf();
338338
$this->stateFactoryMock->expects($this->once())->method('create')->willReturn($stateMock);
@@ -418,7 +418,7 @@ function () use (&$indexers) {
418418
->method('load')->with($indexId, 'indexer_id')->willReturnSelf();
419419
$stateMock->expects($this->never())->method('setIndexerId');
420420
$stateMock->expects($this->once())->method('getId')->willReturn(1);
421-
$stateMock->expects($this->exactly(2))->method('setStatus')->willReturnSelf();
421+
$stateMock->expects($this->exactly(3))->method('setStatus')->willReturnSelf();
422422
$stateMock->expects($this->any())->method('getStatus')->willReturn('idle');
423423
$stateMock->expects($this->exactly(2))->method('save')->willReturnSelf();
424424
$this->stateFactoryMock->expects($this->once())->method('create')->willReturn($stateMock);

0 commit comments

Comments
 (0)