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

iShouldGetFalseWhenAskingTheNodeAuthorizationServiceIfCreatingAChildNodeOfTypeIsGranted() public method

public iShouldGetFalseWhenAskingTheNodeAuthorizationServiceIfCreatingAChildNodeOfTypeIsGranted ( string $expectedResult, string $nodeName, string $nodeTypeName )
$expectedResult string
$nodeName string
$nodeTypeName string
    public function iShouldGetFalseWhenAskingTheNodeAuthorizationServiceIfCreatingAChildNodeOfTypeIsGranted($expectedResult, $nodeName, $nodeTypeName)
    {
        if ($this->isolated === true) {
            $this->callStepInSubProcess(__METHOD__, sprintf(' %s %s %s %s %s %s', 'string', escapeshellarg(trim($expectedResult)), 'string', escapeshellarg($nodeName), 'string', escapeshellarg($nodeTypeName)));
        } else {
            /** @var NodeTypeManager $nodeTypeManager */
            $nodeTypeManager = $this->getObjectManager()->get(\Neos\ContentRepository\Domain\Service\NodeTypeManager::class);
            $nodeType = $nodeTypeManager->getNodeType($nodeTypeName);
            if ($expectedResult === 'TRUE') {
                if ($this->nodeAuthorizationService->isGrantedToCreateNode($this->currentNodes[0], $nodeType) !== true) {
                    Assert::fail('The node authorization service did not return TRUE!');
                }
            } else {
                if ($this->nodeAuthorizationService->isGrantedToCreateNode($this->currentNodes[0], $nodeType) !== false) {
                    Assert::fail('The node authorization service did not return FALSE!');
                }
            }
        }
    }