SearchApiSolrTechproductsTest.php in Search API Solr 8.2
File
tests/src/Kernel/SearchApiSolrTechproductsTest.php
View source
<?php
namespace Drupal\Tests\search_api_solr\Kernel;
class SearchApiSolrTechproductsTest extends SolrBackendTestBase {
public static $modules = [
'search_api_solr_techproducts_test',
];
protected $serverId = 'techproducts';
protected $indexId = 'techproducts';
protected function installConfigs() {
parent::installConfigs();
$this
->installConfig([
'search_api_solr_techproducts_test',
]);
}
protected function getItemIds(array $result_ids) {
return $result_ids;
}
public function testBackend() {
$query = $this
->buildSearch(NULL, [], NULL, FALSE)
->sort('search_api_id');
$result = $query
->execute();
$this
->assertEquals([
"0579B002",
"100-435805",
"3007WFP",
"6H500F0",
"9885A004",
"EN7800GTX/2DHTV/256M",
"EUR",
"F8V7067-APL-KIT",
"GB18030TEST",
"GBP",
], array_keys($result
->getResultItems()), 'Search for all tech products');
}
}