/**
  * Returns a new AlgoliaManager.
  *
  * @return AlgoliaManager
  */
 protected function createManager()
 {
     $config = $this->generateConfig();
     $client = $this->algoliaFactory->make($config);
     $algoliaManager = new AlgoliaManager($client, $this->activeRecordFactory, $this->activeQueryChunker);
     $algoliaManager->setEnv($this->env);
     return $algoliaManager;
 }
 /**
  * @test
  * @expectedException \InvalidArgumentException
  * @expectedExceptionMessage Cannot initiate a class (leinonen\Yii2Algolia\AlgoliaFactory) which doesn't implement leinonen\Yii2Algolia\SearchableInterface
  */
 public function it_should_throw_an_exception_if_not_a_searchable_class_is_given()
 {
     $factory = new AlgoliaFactory();
     $factory->makeSearchableObject(AlgoliaFactory::class);
 }