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