public function iShouldNotBeGrantedToCreateANewChildNodeOfType($not, $nodeName, $nodeType)
{
if ($this->isolated === true) {
$this->callStepInSubProcess(__METHOD__, sprintf(' %s %s %s %s %s %s', 'string', escapeshellarg(trim($not)), 'string', escapeshellarg($nodeName), 'string', escapeshellarg($nodeType)));
} else {
/** @var NodeTypeManager $nodeTypeManager */
$nodeTypeManager = $this->getObjectManager()->get(\Neos\ContentRepository\Domain\Service\NodeTypeManager::class);
try {
$this->currentNodes[0]->createNode($nodeName, $nodeTypeManager->getNodeType($nodeType));
if ($not === 'not') {
Assert::fail('Should not be able to create a child node of type "' . $nodeType . '"!');
}
} catch (AccessDeniedException $exception) {
if ($not !== 'not') {
throw $exception;
}
}
}
}