SearchApiSolrExtractionTest.php in Search API Solr 8.2
File
tests/src/Kernel/SearchApiSolrExtractionTest.php
View source
<?php
namespace Drupal\Tests\search_api_solr\Kernel;
use Drupal\search_api\Entity\Server;
class SearchApiSolrExtractionTest extends SolrBackendTestBase {
public static $modules = [
'search_api_solr_test',
];
protected function installConfigs() {
parent::installConfigs();
$this
->installConfig([
'search_api_solr_test',
]);
}
public function testBackend() {
$filepath = drupal_get_path('module', 'search_api_solr_test') . '/assets/test_extraction.pdf';
$backend = Server::load($this->serverId)
->getBackend();
$content = $backend
->extractContentFromFile($filepath);
$this
->assertContains('The extraction seems working!', $content);
}
}