public function SearchApiSolrExtractionTest::testBackend in Search API Solr 8.3
Same name and namespace in other branches
- 8.2 tests/src/Kernel/SearchApiSolrExtractionTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrExtractionTest::testBackend()
- 4.x tests/src/Kernel/SearchApiSolrExtractionTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrExtractionTest::testBackend()
Test tika extension based PDF extraction.
Overrides BackendTestBase::testBackend
File
- tests/
src/ Kernel/ SearchApiSolrExtractionTest.php, line 17
Class
- SearchApiSolrExtractionTest
- Test tika extension based PDF extraction.
Namespace
Drupal\Tests\search_api_solr\KernelCode
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);
}