detector = $this->createMock(Detection::class); $this->cacheFactory = $this->createMock(ICacheFactory::class); $this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock(); $this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock(); $this->command = new UpdateTheme($this->detector, $this->cacheFactory); } public function testThemeUpdate(): void { $this->consoleInput->method('getOption') ->with('maintenance:theme:update') ->willReturn(true); $this->detector->expects($this->once()) ->method('getAllAliases') ->willReturn([]); $cache = $this->createMock(ICache::class); $cache->expects($this->once()) ->method('clear') ->with(''); $this->cacheFactory->expects($this->once()) ->method('createDistributed') ->with('imagePath') ->willReturn($cache); self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]); } }