PHP 클래스 Neos\Flow\Tests\Unit\Security\ContextTest

상속: extends Neos\Flow\Tests\UnitTestCase
파일 보기 프로젝트 열기: neos/flow-development-collection

보호된 프로퍼티들

프로퍼티 타입 설명
$mockActionRequest Neos\Flow\Mvc\ActionRequest
$mockAuthenticationManager Neos\Flow\Security\Authentication\AuthenticationManagerInterface
$securityContext Neos\Flow\Security\Context

공개 메소드들

메소드 설명
authenticationStrategies ( ) : array Data provider for authentication strategy settings
authenticationStrategyIsSetCorrectlyFromConfiguration ( $settings, $expectedAuthenticationStrategy )
authorizationChecksAreEnabledByDefault ( )
csrfProtectionStrategies ( ) : array Data provider for CSRF protection strategy settings
csrfProtectionStrategyIsSetCorrectlyFromConfiguration ( $settings, $expectedCsrfProtectionStrategy )
currentRequestIsSetInTheSecurityContext ( )
getAccountByAuthenticationProviderNameReturnsNullIfNoAccountFound ( )
getAccountByAuthenticationProviderNameReturnsTheAuthenticatedAccountWithGivenProviderName ( )
getAccountReturnsTheAccountAttachedToTheFirstAuthenticatedToken ( )
getContextHashInitializesSecurityContext ( )
getContextHashReturnsAHashOverAllAuthenticatedRoles ( )
getContextHashReturnsStaticStringIfAuthorizationChecksAreDisabled ( )
getContextHashReturnsStaticStringIfSecurityContextCantBeInitialized ( )
getCsrfProtectionTokenReturnsANewTokenIfNoneIsPresentInTheContext ( )
getCsrfProtectionTokenReturnsANewTokenIfTheCsrfStrategyIsOnePerUri ( )
getRolesReturnsTheAnonymousRoleIfNoTokenIsAuthenticated ( )
getRolesReturnsTheAuthenticatedUserRoleIfATokenIsAuthenticated ( )
getRolesReturnsTheCorrectRoles ( )
getRolesReturnsTheEverybodyRoleEvenIfNoTokenIsAuthenticated ( )
getRolesTakesInheritanceOfRolesIntoAccount ( )
hasRoleReturnsFalseForAnonymousRoleIfAuthenticated ( )
hasRoleReturnsTrueForAnonymousRoleIfNotAuthenticated ( )
hasRoleReturnsTrueForEverybodyRole ( )
hasRoleWorks ( )
hasRoleWorksWithRecursiveRoles ( )
initializeCallsUpdateCredentialsOnAllActiveTokens ( )
initializeSeparatesActiveAndInactiveTokens ( )
initializeUpdatesAndSeparatesActiveAndInactiveTokensCorrectly ( )
injectAuthenticationManagerSetsAReferenceToTheSecurityContextInTheAuthenticationManager ( )
invalidAuthenticationStrategyFromConfigurationThrowsException ( )
invalidCsrfProtectionStrategyFromConfigurationThrowsException ( )
isCsrfProtectionTokenValidChecksIfTheGivenTokenIsExistingInTheContext ( )
isCsrfProtectionTokenValidChecksIfTheGivenTokenIsExistingInTheContextAndUnsetsItIfTheCsrfStrategyIsOnePerUri ( )
securityContextCallsTheAuthenticationManagerToSetItsTokens ( )
securityContextIsNotInitializedAgainIfItHasBeenInitializedAlready ( ) initialize() might be called multiple times during one request. This might override roles and other data acquired from tokens / accounts, which have been initialized in a previous initialize() call. Therefore - and in order to save some processor cycles - initialization should only by executed once for a Context instance.
securityContextIsSetToInitialized ( )
separateActiveAndInactiveTokensDataProvider ( ) : array
separateActiveAndInactiveTokensTests ( array $patterns, boolean $expectedActive )
setUp ( ) Sets up this test case
tokenFromAnAuthenticationManagerIsReplacedIfThereIsOneOfTheSameTypeInTheSession ( )
withoutAuthorizationChecksDisabledAuthorizationChecks ( )
withoutAuthorizationChecksReactivatesAuthorizationCheckCorrectlyWhenCalledNested ( )
withoutAuthorizationChecksReactivatesAuthorizationChecksAfterClosureInvocation ( )
withoutAuthorizationChecksReactivatesAuthorizationChecksAfterClosureInvocationIfClosureThrowsException ( )

메소드 상세

authenticationStrategies() 공개 메소드

Data provider for authentication strategy settings
public authenticationStrategies ( ) : array
리턴 array

authenticationStrategyIsSetCorrectlyFromConfiguration() 공개 메소드

public authenticationStrategyIsSetCorrectlyFromConfiguration ( $settings, $expectedAuthenticationStrategy )

authorizationChecksAreEnabledByDefault() 공개 메소드

csrfProtectionStrategies() 공개 메소드

Data provider for CSRF protection strategy settings
public csrfProtectionStrategies ( ) : array
리턴 array

csrfProtectionStrategyIsSetCorrectlyFromConfiguration() 공개 메소드

public csrfProtectionStrategyIsSetCorrectlyFromConfiguration ( $settings, $expectedCsrfProtectionStrategy )

currentRequestIsSetInTheSecurityContext() 공개 메소드

getAccountByAuthenticationProviderNameReturnsNullIfNoAccountFound() 공개 메소드

getAccountByAuthenticationProviderNameReturnsTheAuthenticatedAccountWithGivenProviderName() 공개 메소드

getAccountReturnsTheAccountAttachedToTheFirstAuthenticatedToken() 공개 메소드

getContextHashInitializesSecurityContext() 공개 메소드

getContextHashReturnsAHashOverAllAuthenticatedRoles() 공개 메소드

getContextHashReturnsStaticStringIfAuthorizationChecksAreDisabled() 공개 메소드

getContextHashReturnsStaticStringIfSecurityContextCantBeInitialized() 공개 메소드

getCsrfProtectionTokenReturnsANewTokenIfNoneIsPresentInTheContext() 공개 메소드

getCsrfProtectionTokenReturnsANewTokenIfTheCsrfStrategyIsOnePerUri() 공개 메소드

getRolesReturnsTheAnonymousRoleIfNoTokenIsAuthenticated() 공개 메소드

getRolesReturnsTheAuthenticatedUserRoleIfATokenIsAuthenticated() 공개 메소드

getRolesReturnsTheCorrectRoles() 공개 메소드

getRolesReturnsTheEverybodyRoleEvenIfNoTokenIsAuthenticated() 공개 메소드

getRolesTakesInheritanceOfRolesIntoAccount() 공개 메소드

hasRoleReturnsFalseForAnonymousRoleIfAuthenticated() 공개 메소드

hasRoleReturnsTrueForAnonymousRoleIfNotAuthenticated() 공개 메소드

hasRoleReturnsTrueForEverybodyRole() 공개 메소드

hasRoleWorks() 공개 메소드

public hasRoleWorks ( )

hasRoleWorksWithRecursiveRoles() 공개 메소드

initializeCallsUpdateCredentialsOnAllActiveTokens() 공개 메소드

initializeSeparatesActiveAndInactiveTokens() 공개 메소드

initializeUpdatesAndSeparatesActiveAndInactiveTokensCorrectly() 공개 메소드

injectAuthenticationManagerSetsAReferenceToTheSecurityContextInTheAuthenticationManager() 공개 메소드

invalidAuthenticationStrategyFromConfigurationThrowsException() 공개 메소드

invalidCsrfProtectionStrategyFromConfigurationThrowsException() 공개 메소드

isCsrfProtectionTokenValidChecksIfTheGivenTokenIsExistingInTheContext() 공개 메소드

isCsrfProtectionTokenValidChecksIfTheGivenTokenIsExistingInTheContextAndUnsetsItIfTheCsrfStrategyIsOnePerUri() 공개 메소드

securityContextCallsTheAuthenticationManagerToSetItsTokens() 공개 메소드

securityContextIsNotInitializedAgainIfItHasBeenInitializedAlready() 공개 메소드

initialize() might be called multiple times during one request. This might override roles and other data acquired from tokens / accounts, which have been initialized in a previous initialize() call. Therefore - and in order to save some processor cycles - initialization should only by executed once for a Context instance.

securityContextIsSetToInitialized() 공개 메소드

separateActiveAndInactiveTokensDataProvider() 공개 메소드

separateActiveAndInactiveTokensTests() 공개 메소드

public separateActiveAndInactiveTokensTests ( array $patterns, boolean $expectedActive )
$patterns array
$expectedActive boolean

setUp() 공개 메소드

Sets up this test case
public setUp ( )

tokenFromAnAuthenticationManagerIsReplacedIfThereIsOneOfTheSameTypeInTheSession() 공개 메소드

withoutAuthorizationChecksDisabledAuthorizationChecks() 공개 메소드

withoutAuthorizationChecksReactivatesAuthorizationCheckCorrectlyWhenCalledNested() 공개 메소드

withoutAuthorizationChecksReactivatesAuthorizationChecksAfterClosureInvocation() 공개 메소드

withoutAuthorizationChecksReactivatesAuthorizationChecksAfterClosureInvocationIfClosureThrowsException() 공개 메소드

프로퍼티 상세

$mockActionRequest 보호되어 있는 프로퍼티

protected ActionRequest,Neos\Flow\Mvc $mockActionRequest
리턴 Neos\Flow\Mvc\ActionRequest

$mockAuthenticationManager 보호되어 있는 프로퍼티

protected AuthenticationManagerInterface,Neos\Flow\Security\Authentication $mockAuthenticationManager
리턴 Neos\Flow\Security\Authentication\AuthenticationManagerInterface

$securityContext 보호되어 있는 프로퍼티

protected Context,Neos\Flow\Security $securityContext
리턴 Neos\Flow\Security\Context