Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
IndexerInfoCommandTest.php
Go to the documentation of this file.
1 <?php
7 
10 use Symfony\Component\Console\Tester\CommandTester;
11 
13 {
19  private $command;
20 
21  protected function setUp()
22  {
23  parent::setUp();
24  $this->stateMock->expects($this->once())->method('setAreaCode')->with(FrontNameResolver::AREA_CODE);
25  }
26 
27  public function testExecute()
28  {
29  $this->configureAdminArea();
30  $indexerOne = $this->getIndexerMock(
31  [],
32  ['indexer_id' => 'id_indexerOne', 'title' => 'Title_indexerOne']
33  );
34  $this->initIndexerCollectionByItems([$indexerOne]);
35  $this->command = new IndexerInfoCommand($this->objectManagerFactory);
36  $commandTester = new CommandTester($this->command);
37  $commandTester->execute([]);
38  $actualValue = $commandTester->getDisplay();
39  $this->assertSame(sprintf('%-40s %s', 'id_indexerOne', 'Title_indexerOne') . PHP_EOL, $actualValue);
40  }
41 }