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');
}