public function testGetting() { $this->indicesManager->create('authors'); $authorsIndex = new AuthorsIndex(); $this->assertArrayHasKey('authors', $this->indicesManager->indices()); $expectedIndex = ['authors' => ['mappings' => $authorsIndex->getTypes()]]; $this->assertEquals($expectedIndex, $this->indicesManager->get('authors')); $expectedIndex = ['authors' => ['mappings' => array_only($authorsIndex->getTypes(), 'producers')]]; $this->assertEquals($expectedIndex, $this->indicesManager->getType('authors', 'producers')); }
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')); }