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

iShouldNotBeGrantedToSetThePropertyTo() public method

public iShouldNotBeGrantedToSetThePropertyTo ( $not, $propertyName, $value )
    public function iShouldNotBeGrantedToSetThePropertyTo($not, $propertyName, $value)
    {
        if ($this->isolated === true) {
            $this->callStepInSubProcess(__METHOD__, sprintf(' %s %s %s %s %s %s', 'string', escapeshellarg(trim($not)), 'string', escapeshellarg($propertyName), 'string', escapeshellarg($value)));
        } else {
            /** @var NodeInterface $currentNode */
            $currentNode = $this->currentNodes[0];
            try {
                switch ($propertyName) {
                    case 'name':
                        $currentNode->setName($value);
                        break;
                    case 'hidden':
                        $currentNode->setHidden($value);
                        break;
                    case 'hiddenBeforeDateTime':
                        $currentNode->setHiddenBeforeDateTime(new \DateTime($value));
                        break;
                    case 'hiddenAfterDateTime':
                        $currentNode->setHiddenAfterDateTime(new \DateTime($value));
                        break;
                    case 'hiddenInIndex':
                        $currentNode->setHiddenInIndex($value);
                        break;
                    case 'accessRoles':
                        $currentNode->setAccessRoles(array($value));
                        break;
                    default:
                        $currentNode->setProperty($propertyName, $value);
                        break;
                }
                if ($not === 'not') {
                    Assert::fail('Property should not be settable on the current node! But we could set the value of "' . $propertyName . '" to "' . $value . '"');
                }
            } catch (\Neos\Flow\Security\Exception\AccessDeniedException $exception) {
                if ($not !== 'not') {
                    throw $exception;
                }
            }
        }
    }