/** * @test */ public function isServerRunningReturnsFalseForStoppedServer() { $registryMock = $this->prophet->prophesize('TYPO3\\CMS\\Core\\Registry'); $registryMock->get('tx_tika', 'server.pid')->willReturn(''); GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Registry', $registryMock->reveal()); $processMock = $this->prophet->prophesize('ApacheSolrForTypo3\\Tika\\Process'); $processMock->findPid()->willReturn(''); GeneralUtility::addInstance('ApacheSolrForTypo3\\Tika\\Process', $processMock->reveal()); $service = new ServerService($this->getConfiguration()); $this->assertFalse($service->isServerRunning()); }
/** * Tries to connect to Tika server * * @return bool TRUE if the Tika server responds, FALSE otherwise. * @throws \Exception */ protected function isTikaServerRunning() { return $this->tikaService->isServerRunning(); }