protected function getIndexingConfigurationSelector() { $selectorMarkup = 'Please select a site first.'; $this->getPageRenderer()->addCssFile('../typo3conf/ext/solr/Resources/Css/Backend/indexingconfigurationselectorfield.css'); if (is_null($this->site)) { return $selectorMarkup; } $selectorField = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\Backend\\IndexingConfigurationSelectorField', $this->site); $selectorField->setFormElementName('tx_scheduler[indexingConfigurations]'); $selectorField->setSelectedValues($this->task->getIndexingConfigurationsToReIndex()); $selectorMarkup = $selectorField->render(); return $selectorMarkup; }
/** * @test */ public function solrIsEmptyAfterCleanup() { $this->importDataSetFromFixture('can_reindex_task_fill_queue.xml'); // fill the solr $site = Site::getFirstAvailableSite(); $this->indexQueue->updateItem('pages', 1); $items = $this->indexQueue->getItems('pages', 1); /** @var $indexer \ApacheSolrForTypo3\Solr\IndexQueue\Indexer */ $indexer = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\IndexQueue\\Indexer'); $indexer->index($items[0]); sleep(2); $this->assertSolrContainsDocumentCount(1); $this->task->setSite($site); $this->task->setIndexingConfigurationsToReIndex(array('pages')); $this->task->execute(); sleep(2); // after the task was running the solr server should be empty $this->assertSolrIsEmpty(); // if not we cleanup now $this->cleanUpSolrServerAndAssertEmpty(); }