<commit_before><?php

class IndicesManagerTest extends ElasticSearcherTestCase
{
	public function testRegister()
	{
		$indicesManager = $this->getElasticSearcher()->indicesManager();

		$moviesIndex = new MoviesIndex();
		$indicesManager->register($moviesIndex);

		$this->assertEquals(true, $indicesManager->isRegistered('movies'));
	}
}<commit_msg>Tests: test indicesmanager register.<commit_after><?php

class IndicesManagerTest extends ElasticSearcherTestCase
{
	/**
	 * @var IndicesManager
	 */
	private $indicesManager;

	public function setUp()
	{
		parent::setUp();
		$this->indicesManager = $this->getElasticSearcher()->indicesManager();
	}

	public function testRegister()
	{
		$moviesIndex = new MoviesIndex();

		// Single registration.
		$this->indicesManager->register($moviesIndex);
		$this->assertEquals(true, $this->indicesManager->isRegistered('movies'));
		$this->assertArrayHasKey('movies', $this->indicesManager->registeredIndices());
		$this->assertInstanceOf(MoviesIndex::class, $this->indicesManager->getRegistered('movies'));

		// Removing from register.
		$this->indicesManager->unregister('movies');
		$this->assertEquals(false, $this->indicesManager->isRegistered('movies'));
		$this->assertArrayNotHasKey('movies', $this->indicesManager->registeredIndices());

		// Bulk registering.
		$this->indicesManager->registerIndices([$moviesIndex]);
		$this->assertEquals(true, $this->indicesManager->isRegistered('movies'));
	}
}
{'fraction_non_alphanumeric': 0.162534435261708, 'fraction_numerical': 0.0, 'mean_word_length': 6.770053475935829, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1771482', 'n_tokens_mistral': 452, 'n_tokens_neox': 428, 'n_words': 62}