Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CacheDisableCommandTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Symfony\Component\Console\Tester\CommandTester;
11 
13 {
14  protected function setUp()
15  {
16  parent::setUp();
17  $this->command = new CacheDisableCommand($this->cacheManagerMock);
18  }
19 
27  public function testExecute($param, $enable, $result, $output)
28  {
29  $this->cacheManagerMock->expects($this->once())
30  ->method('getAvailableTypes')
31  ->willReturn(['A', 'B', 'C']);
32  $this->cacheManagerMock->expects($this->once())
33  ->method('setEnabled')
34  ->with($enable, false)
35  ->willReturn($result);
36 
37  $commandTester = new CommandTester($this->command);
38  $commandTester->execute($param);
39 
40  $this->assertEquals($output, $commandTester->getDisplay());
41  }
42 
46  public function getExpectedExecutionOutput(array $changes)
47  {
48  return $this->getExpectedChangeOutput($changes, false);
49  }
50 }