CacheDisableCommandTest.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Backend\Test\Unit\Console\Command;
  7. use Magento\Backend\Console\Command\CacheDisableCommand;
  8. use Symfony\Component\Console\Tester\CommandTester;
  9. class CacheDisableCommandTest extends AbstractCacheSetCommandTest
  10. {
  11. protected function setUp()
  12. {
  13. parent::setUp();
  14. $this->command = new CacheDisableCommand($this->cacheManagerMock);
  15. }
  16. /**
  17. * @param array $param
  18. * @param array $enable
  19. * @param array $result
  20. * @param string $output
  21. * @dataProvider executeDataProvider
  22. */
  23. public function testExecute($param, $enable, $result, $output)
  24. {
  25. $this->cacheManagerMock->expects($this->once())
  26. ->method('getAvailableTypes')
  27. ->willReturn(['A', 'B', 'C']);
  28. $this->cacheManagerMock->expects($this->once())
  29. ->method('setEnabled')
  30. ->with($enable, false)
  31. ->willReturn($result);
  32. $commandTester = new CommandTester($this->command);
  33. $commandTester->execute($param);
  34. $this->assertEquals($output, $commandTester->getDisplay());
  35. }
  36. /**
  37. * {@inheritdoc}
  38. */
  39. public function getExpectedExecutionOutput(array $changes)
  40. {
  41. return $this->getExpectedChangeOutput($changes, false);
  42. }
  43. }