10 use Symfony\Component\Console\Tester\CommandTester;
16 $this->cacheEventName =
'adminhtml_cache_flush_all';
18 $this->command =
new CacheFlushCommand($this->cacheManagerMock, $this->eventManagerMock);
29 $this->cacheManagerMock->expects($this->once())->method(
'getAvailableTypes')->willReturn([
'A',
'B',
'C']);
30 $this->cacheManagerMock->expects($this->once())->method(
'flush')->with($types);
31 $this->eventManagerMock->expects($this->once())->method(
'dispatch')->with($this->cacheEventName);
33 $commandTester =
new CommandTester($this->command);
34 $commandTester->execute($param);
36 $this->assertEquals(
$output, $commandTester->getDisplay());
44 return 'Flushed cache types:' . PHP_EOL . implode(PHP_EOL, $types) . PHP_EOL;
testExecute($param, $types, $output)
getExpectedExecutionOutput(array $types)