eventManagerMock = $this->getMockBuilder(\Magento\Framework\Event\ManagerInterface::class) ->disableOriginalConstructor() ->getMock(); parent::setUp(); } /** * @return array */ public function executeDataProvider() { return [ 'implicit all' => [ [], ['A', 'B', 'C'], $this->getExpectedExecutionOutput(['A', 'B', 'C']), ], 'specified types' => [ ['types' => ['A', 'B']], ['A', 'B'], $this->getExpectedExecutionOutput(['A', 'B']), ], ]; } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage The following requested cache types are not supported: */ public function testExecuteInvalidCacheType() { $this->cacheManagerMock->expects($this->once())->method('getAvailableTypes')->willReturn(['A', 'B', 'C']); $param = ['types' => ['A', 'D']]; $commandTester = new CommandTester($this->command); $commandTester->execute($param); } }