Neos\ContentRepository\Tests\Behavior\Features\Bootstrap\NodeAuthorizationTrait::iShouldNotBeGrantedToCreateANewChildNodeOfType PHP Method

iShouldNotBeGrantedToCreateANewChildNodeOfType() public method

public iShouldNotBeGrantedToCreateANewChildNodeOfType ( string $not, string $nodeName, string $nodeType )
$not string
$nodeName string
$nodeType string
    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;
                }
            }
        }
    }