コード例 #1
0
ファイル: ServerServiceTest.php プロジェクト: visol/ext-tika
 /**
  * @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());
 }
コード例 #2
0
 /**
  * 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();
 }