register() публичный Метод

public register ( AbstractIndex $index ) : AbstractIndex
$index ElasticSearcher\Abstracts\AbstractIndex
Результат ElasticSearcher\Abstracts\AbstractIndex
 public function testWithPrefixedIndex()
 {
     $booksIndex = new BooksIndex();
     $this->indicesManager->register($booksIndex);
     if ($this->indicesManager->exists('books')) {
         $this->indicesManager->delete('books');
     }
     $this->indicesManager->create('books');
     $this->assertTrue($this->indicesManager->exists('books'));
     $expectedIndex = ['prefix_books' => ['mappings' => $booksIndex->getTypes()]];
     $this->assertEquals($expectedIndex, $this->indicesManager->get('books'));
     $this->indicesManager->delete('books');
     $this->assertFalse($this->indicesManager->exists('books'));
 }
 public function testRegister()
 {
     // New instance so we have an empty register.
     $indicesManager = new IndicesManager($this->getElasticSearcher());
     $moviesIndex = new MoviesIndex();
     // Single registration.
     $indicesManager->register($moviesIndex);
     $this->assertEquals(true, $indicesManager->isRegistered('movies'));
     $this->assertArrayHasKey('movies', $indicesManager->registeredIndices());
     $this->assertInstanceOf(MoviesIndex::class, $indicesManager->getRegistered('movies'));
     // Removing from register.
     $indicesManager->unregister('movies');
     $this->assertEquals(false, $indicesManager->isRegistered('movies'));
     $this->assertArrayNotHasKey('movies', $indicesManager->registeredIndices());
     // Bulk registering.
     $indicesManager->registerIndices([$moviesIndex]);
     $this->assertEquals(true, $indicesManager->isRegistered('movies'));
 }