/** * Detects and retrieves the NodeType of the given $nodeXml * * @param \SimpleXMLElement $nodeXml * @return NodeType * @throws \TYPO3\Neos\Domain\Exception */ protected function parseNodeType(\SimpleXMLElement $nodeXml) { $nodeTypeName = (string) $nodeXml['type']; if ($this->nodeTypeManager->hasNodeType($nodeTypeName)) { $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName); if ($nodeType->isAbstract()) { throw new DomainException(sprintf('The node type "%s" is marked as abstract and cannot be assigned to nodes.', $nodeTypeName), 1386590052); } return $nodeType; } return $this->nodeTypeManager->createNodeType($nodeTypeName); }
/** * @test * @expectedException \TYPO3\TYPO3CR\Exception */ public function createNodeTypeAlwaysThrowsAnException() { $this->nodeTypeManager->createNodeType('TYPO3.TYPO3CR.Testing:ContentObject'); }