config = $this->getMockBuilder(IConfig::class)->getMock(); $this->timeFactory = $this->getMockBuilder(ITimeFactory::class)->getMock(); $this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock(); $this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock(); /** @var \OCP\IConfig $config */ $this->command = new DataFingerprint($this->config, $this->timeFactory); } public function testSetFingerPrint() { $this->timeFactory->expects($this->once()) ->method('getTime') ->willReturn(42); $this->config->expects($this->once()) ->method('setSystemValue') ->with('data-fingerprint', md5(42)); self::invokePrivate($this->command, 'execute', [$this->consoleInput, $this->consoleOutput]); } }