コード例 #1
0
ファイル: ServerServiceTest.php プロジェクト: visol/ext-tika
 /**
  * @test
  */
 public function getServerPidFallsBackToProcess()
 {
     $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(1000);
     GeneralUtility::addInstance('ApacheSolrForTypo3\\Tika\\Process', $processMock->reveal());
     $service = new ServerService($this->getConfiguration());
     $pid = $service->getServerPid();
     $this->assertEquals(1000, $pid);
 }
コード例 #2
0
 /**
  * Returns the pid if the Tika server has been started through the backend
  * module.
  *
  * @return integer|null Tika Server pid or null if not found
  */
 protected function getTikaServerPid()
 {
     return $this->tikaService->getServerPid();
 }