/**
  * Set up node structure
  */
 public function setUp()
 {
     parent::setUp();
     $site = new Site('example');
     $site->setSiteResourcesPackageKey('TYPO3.TYPO3');
     $context = new ContentContext('live');
     $context->setCurrentSite($site);
     $nodeRepository = $this->objectManager->get('TYPO3\\TYPO3CR\\Domain\\Repository\\NodeRepository');
     ObjectAccess::setProperty($nodeRepository, 'context', $context, TRUE);
     $siteImportService = $this->objectManager->get('TYPO3\\TYPO3\\Domain\\Service\\SiteImportService');
     $siteImportService->importSitesFromFile(__DIR__ . '/Fixtures/NodeStructure.xml');
     $this->persistenceManager->persistAll();
     $propertyMapper = $this->objectManager->get('TYPO3\\FLOW3\\Property\\PropertyMapper');
     $this->homeNode = $propertyMapper->convert('/sites/example/home', 'TYPO3\\TYPO3CR\\Domain\\Model\\Node');
     $this->assertFalse($propertyMapper->getMessages()->hasErrors());
 }
 /**
  * Returns the node of the current site.
  *
  * @return \TYPO3\TYPO3CR\Domain\Model\NodeInterface
  */
 public function getCurrentSiteNode()
 {
     return $this->currentSite === NULL ? NULL : $this->getNode('/sites/' . $this->currentSite->getNodeName());
 }