Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
QueryLogDisableCommandTest.php
Go to the documentation of this file.
1 <?php
8 
13 use Symfony\Component\Console\Tester\CommandTester;
14 
21 class QueryLogDisableCommandTest extends \PHPUnit\Framework\TestCase
22 {
26  private $configWriter;
27 
31  private $command;
32 
36  public function setUp()
37  {
38  $this->configWriter = $this->getMockBuilder(Writer::class)
39  ->disableOriginalConstructor()
40  ->getMock();
41  $this->command = new QueryLogDisableCommand($this->configWriter);
42  }
43 
47  public function testExecute()
48  {
50 
51  $this->configWriter
52  ->expects($this->once())
53  ->method('saveConfig')
55 
56  $commandTester = new CommandTester($this->command);
57  $commandTester->execute([]);
58  $this->assertSame(
60  $commandTester->getDisplay()
61  );
62  }
63 }