protected function BackendTestBase::checkDefaultIndex in Search API 8
Tests the index that was installed through default configuration files.
1 call to BackendTestBase::checkDefaultIndex()
- BackendTestBase::testBackend in tests/
src/ Kernel/ BackendTestBase.php - Tests various indexing scenarios for the search backend.
File
- tests/
src/ Kernel/ BackendTestBase.php, line 157
Class
- BackendTestBase
- Provides a base class for backend tests.
Namespace
Drupal\Tests\search_api\KernelCode
protected function checkDefaultIndex() {
$index = $this
->getIndex();
$this
->assertInstanceOf(Index::class, $index, 'The index was successfully created.');
$this
->assertEquals([
"entity:entity_test_mulrev_changed",
], $index
->getDatasourceIds(), 'Datasources are set correctly.');
$this
->assertEquals('default', $index
->getTrackerId(), 'Tracker is set correctly.');
$this
->assertEquals(5, $index
->getTrackerInstance()
->getTotalItemsCount(), 'Correct item count.');
$this
->assertEquals(0, $index
->getTrackerInstance()
->getIndexedItemsCount(), 'All items still need to be indexed.');
}