PHP Class Neos\Flow\Tests\Unit\Session\SessionTest

Inheritance: extends Neos\Flow\Tests\UnitTestCase
Afficher le fichier Open project: neos/flow-development-collection

Protected Properties

Свойство Type Description
$httpRequest Neos\Flow\Http\Request
$httpResponse Neos\Flow\Http\Response
$mockBootstrap Neos\Flow\Core\Bootstrap
$mockObjectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$mockSecurityContext Neos\Flow\Security\Context | PHPUnit_Framework_MockObject_MockObject
$settings array

Méthodes publiques

Méthode Description
aSessionCanBeTaggedAndBeRetrievedAgainByTheseTags ( )
addTagThrowsExceptionIfCalledOnNonStartedSession ( )
addTagThrowsExceptionIfTagIsNotValid ( )
autoExpireRemovesAllSessionDataOfTheExpiredSession ( )
autoExpireTriggersGarbageCollectionForExpiredSessions ( )
canBeResumedReturnsFalseIfNoSessionCookieExists ( )
canBeResumedReturnsFalseIfSessionIsExpiredAndExpiresASessionIfLastActivityIsOverTheLimit ( )
canBeResumedReturnsFalseIfTheSessionHasAlreadyBeenStarted ( )
closeAndShutdownObjectDoNotCloseARemoteSession ( )
closeFlagsTheSessionAsClosed ( )
constructCreatesARemoteSessionIfSessionIfIdentifierIsSpecified ( )
constructRequiresAStorageIdentifierIfASessionIdentifierWasGiven ( )
destroyRemovesAllSessionDataFromARemoteSession ( )
destroyRemovesAllSessionDataFromTheCurrentSessionButNotFromOtherSessions ( )
destroyThrowsExceptionIfSessionIsNotStarted ( )
garbageCollectionIsOmittedIfAnotherProcessIsAlreadyRunning ( )
garbageCollectionIsOmittedIfInactivityTimeoutIsSetToZero ( )
garbageCollectionOnlyRemovesTheDefinedMaximumNumberOfSessions ( )
getActiveSessionsReturnsAllActiveSessions ( )
getDataReturnsDataPreviouslySetWithPutData ( )
getDataThrowsExceptionIfSessionIsNotStarted ( )
getIdReturnsTheCurrentSessionIdentifier ( )
getLastActivityTimestampThrowsExceptionIfCalledOnNonStartedSession ( )
getTagsOnAResumedSessionReturnsTheTagsSetWithAddTag ( )
getTagsThrowsExceptionIfCalledOnNonStartedSession ( )
hasKeyThrowsExceptionIfCalledOnNonStartedSession ( )
isStartedReturnsFalseByDefault ( )
isStartedReturnsTrueAfterSessionHasBeenStarted ( )
lastActivityTimestampOfNewSessionIsSetAndStoredCorrectlyAndCanBeRetrieved ( )
putDataThrowsExceptionIfSessionIsNotStarted ( )
putDataThrowsExceptionIfTryingToPersistAResource ( )
remoteSessionUsesStorageIdentifierPassedToConstructor ( )
removeTagRemovesAPreviouslySetTag ( )
removeTagThrowsExceptionIfCalledOnNonStartedSession ( )
renewIdSetsANewSessionIdentifier ( )
renewIdThrowsExceptionIfCalledOnNonStartedSession ( )
renewIdThrowsExceptionIfCalledOnRemoteSession ( )
resumeOnAStartedSessionDoesNotDoAnyHarm ( ) Assures that no exception is thrown if a session is resumed.
resumeSetsSessionCookieInTheResponse ( )
sessionDataCanBeRetrievedEvenAfterSessionIdHasBeenRenewed ( )
sessionOnlyReusesTheSessionIdFromIncomingCookies ( ) This test asserts that the session cookie sent in the response doesn't just copy the data from the received session cookie (that is, domain, httponly etc) but creates a fresh Cookie object using the parameters derived from the settings.
setUp ( ) : void
shutdownChecksIfSessionStillExistsInStorageCacheBeforeWritingData ( )
shutdownCreatesSpecialDataEntryForSessionWithAuthenticatedAccounts ( )
startPutsACookieIntoTheHttpResponse ( )
startThrowsAnExceptionIfIncompatibleRequestHandlerIsUsed ( )
touchThrowsExceptionIfCalledOnNonStartedSession ( )
touchUpdatesLastActivityTimestampOfRemoteSession ( )
twoSessionsDontConflictIfUsingSameEntryIdentifiers ( )

Méthodes protégées

Méthode Description
createCache ( string $name ) : Neos\Cache\Frontend\VariableFrontend Creates a cache for testing

Method Details

aSessionCanBeTaggedAndBeRetrievedAgainByTheseTags() public méthode

addTagThrowsExceptionIfCalledOnNonStartedSession() public méthode

addTagThrowsExceptionIfTagIsNotValid() public méthode

autoExpireRemovesAllSessionDataOfTheExpiredSession() public méthode

autoExpireTriggersGarbageCollectionForExpiredSessions() public méthode

canBeResumedReturnsFalseIfNoSessionCookieExists() public méthode

canBeResumedReturnsFalseIfSessionIsExpiredAndExpiresASessionIfLastActivityIsOverTheLimit() public méthode

canBeResumedReturnsFalseIfTheSessionHasAlreadyBeenStarted() public méthode

closeAndShutdownObjectDoNotCloseARemoteSession() public méthode

closeFlagsTheSessionAsClosed() public méthode

constructCreatesARemoteSessionIfSessionIfIdentifierIsSpecified() public méthode

constructRequiresAStorageIdentifierIfASessionIdentifierWasGiven() public méthode

createCache() protected méthode

Creates a cache for testing
protected createCache ( string $name ) : Neos\Cache\Frontend\VariableFrontend
$name string
Résultat Neos\Cache\Frontend\VariableFrontend

destroyRemovesAllSessionDataFromARemoteSession() public méthode

destroyRemovesAllSessionDataFromTheCurrentSessionButNotFromOtherSessions() public méthode

destroyThrowsExceptionIfSessionIsNotStarted() public méthode

garbageCollectionIsOmittedIfAnotherProcessIsAlreadyRunning() public méthode

garbageCollectionIsOmittedIfInactivityTimeoutIsSetToZero() public méthode

garbageCollectionOnlyRemovesTheDefinedMaximumNumberOfSessions() public méthode

getActiveSessionsReturnsAllActiveSessions() public méthode

getDataReturnsDataPreviouslySetWithPutData() public méthode

getDataThrowsExceptionIfSessionIsNotStarted() public méthode

getIdReturnsTheCurrentSessionIdentifier() public méthode

getLastActivityTimestampThrowsExceptionIfCalledOnNonStartedSession() public méthode

getTagsOnAResumedSessionReturnsTheTagsSetWithAddTag() public méthode

getTagsThrowsExceptionIfCalledOnNonStartedSession() public méthode

hasKeyThrowsExceptionIfCalledOnNonStartedSession() public méthode

isStartedReturnsFalseByDefault() public méthode

isStartedReturnsTrueAfterSessionHasBeenStarted() public méthode

lastActivityTimestampOfNewSessionIsSetAndStoredCorrectlyAndCanBeRetrieved() public méthode

putDataThrowsExceptionIfSessionIsNotStarted() public méthode

putDataThrowsExceptionIfTryingToPersistAResource() public méthode

remoteSessionUsesStorageIdentifierPassedToConstructor() public méthode

removeTagRemovesAPreviouslySetTag() public méthode

removeTagThrowsExceptionIfCalledOnNonStartedSession() public méthode

renewIdSetsANewSessionIdentifier() public méthode

renewIdThrowsExceptionIfCalledOnNonStartedSession() public méthode

renewIdThrowsExceptionIfCalledOnRemoteSession() public méthode

resumeOnAStartedSessionDoesNotDoAnyHarm() public méthode

Assures that no exception is thrown if a session is resumed.

resumeSetsSessionCookieInTheResponse() public méthode

sessionDataCanBeRetrievedEvenAfterSessionIdHasBeenRenewed() public méthode

sessionOnlyReusesTheSessionIdFromIncomingCookies() public méthode

This test asserts that the session cookie sent in the response doesn't just copy the data from the received session cookie (that is, domain, httponly etc) but creates a fresh Cookie object using the parameters derived from the settings.

setUp() public méthode

public setUp ( ) : void
Résultat void

shutdownChecksIfSessionStillExistsInStorageCacheBeforeWritingData() public méthode

shutdownCreatesSpecialDataEntryForSessionWithAuthenticatedAccounts() public méthode

startPutsACookieIntoTheHttpResponse() public méthode

startThrowsAnExceptionIfIncompatibleRequestHandlerIsUsed() public méthode

touchThrowsExceptionIfCalledOnNonStartedSession() public méthode

touchUpdatesLastActivityTimestampOfRemoteSession() public méthode

twoSessionsDontConflictIfUsingSameEntryIdentifiers() public méthode

Property Details

$httpRequest protected_oe property

protected Request,Neos\Flow\Http $httpRequest
Résultat Neos\Flow\Http\Request

$httpResponse protected_oe property

protected Response,Neos\Flow\Http $httpResponse
Résultat Neos\Flow\Http\Response

$mockBootstrap protected_oe property

protected Bootstrap,Neos\Flow\Core $mockBootstrap
Résultat Neos\Flow\Core\Bootstrap

$mockObjectManager protected_oe property

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $mockObjectManager
Résultat Neos\Flow\ObjectManagement\ObjectManagerInterface

$mockSecurityContext protected_oe property

protected Context,Neos\Flow\Security|PHPUnit_Framework_MockObject_MockObject $mockSecurityContext
Résultat Neos\Flow\Security\Context | PHPUnit_Framework_MockObject_MockObject

$settings protected_oe property

protected array $settings
Résultat array