protected function initializeIndex()
 {
     if (self::$indexInitialized === false) {
         // we need to make sure that the index will be prefixed with an unique name. so we add a sleep as it is not
         // possible right now to set the index name
         sleep(2);
         $this->nodeIndexCommandController->buildCommand();
         self::$indexInitialized = true;
     }
 }
 /**
  * Creates some sample nodes to run tests against
  */
 protected function createNodesForNodeSearchTest()
 {
     $rootNode = $this->context->getRootNode();
     $newNode1 = $rootNode->createNode('test-node-1', $this->nodeTypeManager->getNodeType('TYPO3.Neos.NodeTypes:Page'));
     $newNode1->setProperty('title', 'chicken');
     $newNode2 = $rootNode->createNode('test-node-2', $this->nodeTypeManager->getNodeType('TYPO3.Neos.NodeTypes:Page'));
     $newNode2->setProperty('title', 'chicken');
     $newNode2 = $rootNode->createNode('test-node-3', $this->nodeTypeManager->getNodeType('TYPO3.Neos.NodeTypes:Page'));
     $newNode2->setProperty('title', 'egg');
     $this->persistenceManager->persistAll();
     $this->nodeIndexCommandController->buildCommand();
 }
 /**
  * Creates some sample nodes to run tests against
  */
 protected function createNodesForNodeSearchTest()
 {
     $newNode1 = $this->siteNode->createNode('test-node-1', $this->nodeTypeManager->getNodeType('TYPO3.Neos.NodeTypes:Page'));
     $newNode1->setProperty('title', 'chicken');
     $newNode2 = $this->siteNode->createNode('test-node-2', $this->nodeTypeManager->getNodeType('TYPO3.Neos.NodeTypes:Page'));
     $newNode2->setProperty('title', 'chicken');
     $newNode3 = $this->siteNode->createNode('test-node-3', $this->nodeTypeManager->getNodeType('TYPO3.Neos.NodeTypes:Page'));
     $newNode3->setProperty('title', 'egg');
     $dimensionContext = $this->contextFactory->create(['workspaceName' => 'live', 'dimensions' => ['language' => ['de']]]);
     $translatedNode3 = $dimensionContext->adoptNode($newNode3, true);
     $translatedNode3->setProperty('title', 'De');
     $this->persistenceManager->persistAll();
     sleep(2);
     if (self::$indexInitialized === true) {
         return;
     }
     $this->nodeIndexCommandController->buildCommand(null, false, null, 'functionaltest');
     self::$indexInitialized = true;
 }