Skip to content

Commit 70c3f9f

Browse files
committed
Fix unit test
1 parent f0fd3f8 commit 70c3f9f

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

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

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,17 @@ class IndexerResetStateCommandTest extends AbstractIndexerCommandCommonSetup
2222
*/
2323
private $command;
2424

25-
protected function setUp(): void
26-
{
27-
parent::setUp();
28-
$this->stateMock->expects($this->once())->method('setAreaCode')->with(FrontNameResolver::AREA_CODE);
29-
}
30-
31-
public function testExecute()
25+
public function testExecuter()
3226
{
3327
$this->configureAdminArea();
3428
$indexerOne = $this->getIndexerMock(
35-
['getState'],
29+
['invalidate'],
3630
['indexer_id' => 'indexer_1', 'title' => 'Title_indexerOne']
3731
);
3832
$this->initIndexerCollectionByItems([$indexerOne]);
3933

40-
$stateMock = $this->createMock(State::class);
41-
$stateMock->expects($this->exactly(1))
42-
->method('setStatus')
43-
->with(StateInterface::STATUS_INVALID)->willReturnSelf();
44-
45-
$stateMock->expects($this->exactly(1))
46-
->method('save');
47-
4834
$indexerOne->expects($this->once())
49-
->method('getState')
50-
->willReturn($stateMock);
35+
->method('invalidate');
5136

5237
$this->command = new IndexerResetStateCommand($this->objectManagerFactory);
5338
$commandTester = new CommandTester($this->command);

0 commit comments

Comments
 (0)