You are here

class SearchApiSolrExtractionTest in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/SearchApiSolrExtractionTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrExtractionTest
  2. 8.2 tests/src/Kernel/SearchApiSolrExtractionTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrExtractionTest

Test tika extension based PDF extraction.

@group search_api_solr

Hierarchy

Expanded class hierarchy of SearchApiSolrExtractionTest

1 file declares its use of SearchApiSolrExtractionTest
SolrLegacyExtractionTest.php in modules/search_api_solr_legacy/tests/src/Kernel/SolrLegacyExtractionTest.php

File

tests/src/Kernel/SearchApiSolrExtractionTest.php, line 12

Namespace

Drupal\Tests\search_api_solr\Kernel
View source
class SearchApiSolrExtractionTest extends SolrBackendTestBase {

  /**
   * Test tika extension based PDF extraction.
   */
  public function testBackend() {
    $filepath = drupal_get_path('module', 'search_api_solr_test') . '/assets/test_extraction.pdf';

    /** @var \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend $backend */
    $backend = Server::load($this->serverId)
      ->getBackend();
    $content = $backend
      ->extractContentFromFile($filepath);
    $this
      ->assertStringContainsString('The extraction seems working!', $content);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SearchApiSolrExtractionTest::testBackend public function Test tika extension based PDF extraction.
SolrBackendTestBase::$indexId protected property A Search API index ID. 1
SolrBackendTestBase::$logger protected property The in-memory logger.
SolrBackendTestBase::$modules public static property Modules to enable for this test. 3
SolrBackendTestBase::$serverId protected property A Search API server ID. 1
SolrBackendTestBase::assertLogMessage protected function Tests the last logged level and message.
SolrBackendTestBase::checkIndexWithoutFields protected function
SolrBackendTestBase::checkModuleUninstall protected function 1
SolrBackendTestBase::checkSecondServer protected function
SolrBackendTestBase::checkServerBackend protected function
SolrBackendTestBase::clearIndex protected function
SolrBackendTestBase::commonSolrBackendSetUp protected function Required parts of the setUp() function that are the same for all backends. 2
SolrBackendTestBase::executeQueryWithoutPostProcessing protected function Executes a query and skips search_api post processing of results.
SolrBackendTestBase::getSolrVersion protected function Gets the Solr version.
SolrBackendTestBase::indexItems protected function
SolrBackendTestBase::installConfigs protected function Called by setUp() to install required configs. 2
SolrBackendTestBase::setUp public function
SolrBackendTestBase::tearDown public function Clear the index after every test.
SolrBackendTestBase::updateIndex protected function
SolrCommitTrait::ensureCommit protected function Explicitly sends a commit command to a Solr server.