outputMock = $this->createMock(IOutput::class); $this->cacheFactory = $this->createMock(ICacheFactory::class); $this->jsCombiner = $this->createMock(JSCombiner::class); $this->repair = new \OC\Repair\ClearFrontendCaches($this->cacheFactory, $this->jsCombiner); } public function testRun() { $imagePathCache = $this->createMock(ICache::class); $imagePathCache->expects($this->once()) ->method('clear') ->with(''); $this->jsCombiner->expects($this->once()) ->method('resetCache'); $this->cacheFactory->expects($this->once()) ->method('createDistributed') ->with('imagePath') ->willReturn($imagePathCache); $this->repair->run($this->outputMock); $this->assertTrue(true); } }