/** * @test */ public function getConfigurationReturnsNullIfTheSpecifiedPathDoesNotExist() { $nodeType = new NodeType('TYPO3.TYPO3CR:Base', array(), array()); $this->assertNull($nodeType->getConfiguration('some.nonExisting.path')); }
/** * @param NodeType $nodetype * @return boolean */ private function isNodeTypeInAllowedSite(NodeType $nodetype) { // dont restrict abstract nodes if ($nodetype->isAbstract()) { return true; } $deniedWilcard = false; $allowedSites = $nodetype->getConfiguration('allowedSites'); if ($allowedSites) { $currentDomain = $this->domainRepository->findOneByActiveRequest(); if ($currentDomain !== null) { $currentSite = $currentDomain->getSite(); } else { $currentSite = $this->siteRepository->findFirstOnline(); } if (!$currentSite) { return true; } foreach ($allowedSites as $siteName => $allowed) { if ($allowed == TRUE && $siteName == '*' | $currentSite->getSiteResourcesPackageKey() == $siteName) { return true; } if ($allowed == FALSE && $currentSite->getSiteResourcesPackageKey() == $siteName) { return false; } if ($allowed == TRUE && $siteName == '*') { $deniedWilcard = false; } if ($allowed == FALSE && $siteName == '*') { $deniedWilcard = true; } } if ($deniedWilcard == true) { return false; } } return true; }