/** @test */
 public function it_can_reindex_the_given_active_record_class()
 {
     $activeRecord1 = new DummyActiveRecordModel();
     $activeRecord1->test = 'test';
     $activeRecord1->save();
     $activeRecord2 = new DummyActiveRecordModel();
     $activeRecord2->test = 'test';
     $activeRecord2->save();
     $indexName = $activeRecord1->getIndices()[0];
     $index = $this->algoliaManager->initIndex($indexName);
     // Add dummy object to the index so it exists for the reindex operation.
     $response = $index->addObject(['dummy' => 'dummy'], 'dummy');
     $index->waitTask($response['taskID']);
     $response = $this->algoliaManager->reindex(DummyActiveRecordModel::class);
     $index->waitTask($response[$index->indexName]['taskID']);
     $searchResult = $index->search('test');
     $this->deleteIndex($index);
     $this->assertCount(2, $searchResult['hits']);
 }