Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InfoLanguageListCommandTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Symfony\Component\Console\Tester\CommandTester;
11 
12 class InfoLanguageListCommandTest extends \PHPUnit\Framework\TestCase
13 {
14  public function testExecute()
15  {
16  $languages = [
17  'LNG' => 'Language description'
18  ];
19 
20  $table = $this->createMock(\Symfony\Component\Console\Helper\Table::class);
21  $table->expects($this->once())->method('setHeaders')->with(['Language', 'Code']);
22  $table->expects($this->once())->method('addRow')->with(['Language description', 'LNG']);
23 
25  $tableFactoryMock = $this->createMock(\Symfony\Component\Console\Helper\TableFactory::class);
26  $tableFactoryMock->expects($this->once())->method('create')->will($this->returnValue($table));
27 
29  $list = $this->createMock(\Magento\Framework\Setup\Lists::class);
30  $list->expects($this->once())->method('getLocaleList')->will($this->returnValue($languages));
31  $command = new InfoLanguageListCommand($list, $tableFactoryMock);
32  $commandTester = new CommandTester($command);
33  $commandTester->execute([]);
34  }
35 }
$table
Definition: trigger.php:14