= Examples = This is being shown in case you have the Administrator role (aka role) defined in the current package according to the controllerContext This is being shown in case you have the Acme.MyPackage:Administrator role (aka role). This is being shown in case you have the Acme.MyPackage:Administrator role (aka role). Everything inside the tag is being displayed if you have the given role. This is being shown in case you have the role. This is being displayed in case you do not have the role. Everything inside the "then" tag is displayed if you have the role. Otherwise, everything inside the "else"-tag is displayed. This is being shown in case you have the specified role This is being shown in case "otherAccount" has the Acme.MyPackage:Administrator role (aka role).
Наследование: extends Neos\FluidAdaptor\Core\ViewHelper\AbstractConditionViewHelper
 /**
  * @test
  */
 public function viewHelperUsesSpecifiedAccountForCheck()
 {
     $mockAccount = $this->createMock(\Neos\Flow\Security\Account::class);
     $mockAccount->expects($this->any())->method('hasRole')->will($this->returnCallback(function (Role $role) {
         switch ($role->getIdentifier()) {
             case 'Neos.FluidAdaptor:Administrator':
                 return true;
         }
     }));
     $this->mockViewHelper->expects($this->any())->method('renderThenChild')->will($this->returnValue('true'));
     $this->mockViewHelper->expects($this->any())->method('renderElseChild')->will($this->returnValue('false'));
     $arguments = ['role' => new Role('Neos.FluidAdaptor:Administrator'), 'packageKey' => null, 'account' => $mockAccount];
     $this->mockViewHelper->setArguments($arguments);
     $actualResult = $this->mockViewHelper->render();
     $this->assertEquals('true', $actualResult, 'Full role identifier in role argument is accepted');
 }