phpDocumentor GalleryCore
PHPUnit
[ class tree: GalleryCore ] [ index: GalleryCore ] [ all elements ]

Class: SessionTest

Source Location: /modules/core/test/phpunit/SessionTest.class

Class SessionTest

Class Overview

Test session functionality.

Located in /modules/core/test/phpunit/SessionTest.class [line 39]

TestCase
   |
   --GalleryTestCase
      |
      --SessionTest
Author(s):
Information Tags:
Todo:  Convert this to using UnitTestStorage

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From GalleryTestCase

GalleryTestCase::$_cleanup

Inherited From GalleryTestCase

GalleryTestCase::GalleryTestCase()
GalleryTestCase::assert()
GalleryTestCase::assertEquals()
GalleryTestCase::assertErrorEquals()
Fail if the provided GalleryStatus object does not contain the given error code.
GalleryTestCase::assertEventFired()
Fail if the provided event name was not fired.
GalleryTestCase::assertEventNotFired()
Fail if the provided event name was fired
GalleryTestCase::DeepCompare()
GalleryTestCase::failWithStatus()
This is deprecated in Gallery 2.3 -- now tests should just return $ret and let the framework generate the right failure message.
GalleryTestCase::getEntityCounter()
Get the entity counter listener which contains the types and number of elements deleted.
GalleryTestCase::setUp()
GalleryTestCase::tearDown()
GalleryTestCase::_array_unshift_key_value()
Utility method to array_unshift a single key => value pair.
GalleryTestCase::_becomeGuestUser()
GalleryTestCase::_createDerivative()
GalleryTestCase::_createLinkedItem()
Create a random link item
GalleryTestCase::_createRandomAlbum()
Create a random album
GalleryTestCase::_createRandomDataItem()
Create a random data item
GalleryTestCase::_createRandomGroup()
Create a random group
GalleryTestCase::_createRandomUser()
Create a random user
GalleryTestCase::_createUser()
GalleryTestCase::_deleteAndVerifyEntity()
GalleryTestCase::_disableUserName()
Convenience method to mark a username as disabled.
GalleryTestCase::_getRootId()
GalleryTestCase::_getUnusedId()
Get an id that is not used for anything.
GalleryTestCase::_initEventListenersForTest()
Disable all but some core event listeners by default.
GalleryTestCase::_markEventListenersForCleanup()
Create a backup of the registered event listeners which will be restored in tearDown.
GalleryTestCase::_markFactoryForCleanup()
Create a backup of the factory data which will be restored in tearDown.
GalleryTestCase::_markFactoryModuleForCleanup()
GalleryTestCase::_markForCleanup()
GalleryTestCase::_markPluginParametersForCleanup()
Store plugin parameters to be restored in tearDown
GalleryTestCase::_markToolkitForCleanup()
GalleryTestCase::_registerEventListener()
Register a The NullEventListener for a test
GalleryTestCase::_registerFactoryImplementationForTest()
Register a factory implementation temporarily for this test.
GalleryTestCase::_registerTestEventListener()
Register and event name and associated listener (deprecated).
GalleryTestCase::_setMarkupType()
Set core parameter for markup type.
GalleryTestCase::_signUrl()
Adds an authToken to the given URL
GalleryTestCase::_unregisterFactoryImplementationForTest()
Unregister a specific factory implementation or all implementations of a spefific type temporarily for this test.
GalleryTestCase::_verifyEntity()
GalleryTestCase::_verifyFields()
GalleryTestCase::_verifyMissing()

[ Top ]
Method Summary
SessionTest   SessionTest()  
void   setUp()  
void   tearDown()  
void   testAcquireNewPersistentSession()  
void   testAcquireNewPersistentSessionRetryOnCollision()  
void   testAcquireNewPersistentSessionWithGivenSessionId()  
void   testAuthTokenRoundtrip()  
void   testCompareIdentifiers()  
void   testEmptySessionData()  
void   testExpireSessions()  
void   testGetAndPut()  
void   testGetAuthToken()  
void   testGetCreationAndModificationDate()  
void   testGetId()  
void   testGetSerializedSession()  
void   testHasSiteAdminSessionExpired()  
void   testInit()  
void   testInitAndStartDoNotGenerateAuthToken()  
void   testInitEmpty()  
void   testInitEmptyEmptyRemoteId()  
void   testInitEmptySecure()  
void   testInitEmptyVerifyNoCookieIsSet()  
void   testInitEmptyWithUserId()  
void   testInitForExistingSession()  
void   testInitInvalidSessionId()  
void   testInitRemoteIdentifier()   Normally we initialize remoteIdentifer when a session is created and check it on each request for session hijack protection. However, in some cases (create new session for print services to access) we initialize with empty remoteIdentifier. In this case the first init() call should allow access and set the remoteIdentifier based on this request.
void   testInitSwitchToSecure()  
void   testInitSwitchToUnsecure()  
void   testInitWithFixCookieVars()  
void   testIsCorrectAuthToken()  
void   testIsCorrectAuthTokenCanHandleNull()  
void   testIsCorrectAuthTokenForForgedAuthToken()  
void   testIsCorrectAuthTokenForSessionWithoutAuthToken()  
void   testIsHttps()  
void   testIsPersistent()  
void   testIsPersistentSessionAllowedForRequest()   Check that we don't save sessions for core.DownloadItem, migrate.Redirect and CSS requests.
void   testIsPersistentSessionAllowedForRequestCachesResult()  
void   testIsPersistentSessionRequired()  
void   testIsUsingCookies()  
void   testLoadedSessionData()  
void   testLoadSessionData()  
void   testLoadSessionDataExpiredSession()   User agents should not send back expired cookies (RFC 2965), but what if they do? Thus Gallery should not blindly load the session data for a given sessionId, but first check if the session already expired.
void   testLoadSessionDataLoadMiss()  
void   testMisidentifiedSearchEngineSessionBecomesRegisteredUser()  
void   testNewSessionCollision()  
void   testRegenerateFromGuestToGuest()  
void   testRegenerateFromGuestToLoggedIn()  
void   testRegenerateSessionId()  
void   testRemove()  
void   testReplaceSessionIdInDataDoReplaceSessionIdIfNecessaryOnNestedObject()  
void   testReplaceSessionIdInDataDoStringReplaceOnNestedArray()  
void   testReplaceTempSessionIdIfNecessaryDoNothing()  
void   testReplaceTempSessionIdIfNecessaryRemove()  
void   testReplaceTempSessionIdIfNecessaryRemovesTrailingQueryStringSeparator()  
void   testReplaceTempSessionIdIfNecessaryReplace()  
void   testReset()  
void   testResumeMisidentifiedSearchEngineSessionAsRegisteredUser()  
void   testSameSessionDifferentRemoteIdentifier()  
void   testSaveCallsExpireSessions()  
void   testSaveDoNotSaveIfSessionIdEmpty()  
void   testSaveNewSession()  
void   testSaveResaveExistingSessionDataChanged()  
void   testSaveResaveExistingSessionNoDataChangedDoNotTouch()  
void   testSaveResaveExistingSessionNoDataChangedTouch()  
void   testSaveReturnsErrorOnMissingUserId()  
void   testSaveSessionShouldNotSave()   Test if save() actually doesn't save if the current request is in the exclude list.
void   testSearchEngineCrawlerSessions()  
void   testSearchEngineCrawlerSessionsAsExplicitGuestUser()  
void   testSessionCookieDomain()  
void   testSessionCookieHeaderAndPersistence()  
void   testSessionIdInUrlOverridesCookie()  
void   testSessionInitializesIsUsingCookies()  
void   testSessionKeyAndTempSessionHaveNoSpecialCharacters()   Our replaceTempSessionIdIfNecessary() code and the page caching assume that the session key and the temp session string have no characters that change when HTML or URL encoded.
void   testSessionSaveLoad()  
void   testSetCookie()  
void   testSetCookieDeleteCookie()  
void   testSetCookieNoExpirationDate()  
void   testSetCookieSecure()  
void   testStart()  
void   testStatus()  
void   _markSessionForCleanup()  

[ Top ]
Methods
Constructor SessionTest  [line 41]

  SessionTest SessionTest( $methodName  )

Parameters:
   $methodName: 


[ Top ]
setUp  [line 45]

  void setUp( )



Redefinition of:
GalleryTestCase::setUp()

[ Top ]
tearDown  [line 100]

  void tearDown( )



Redefinition of:
GalleryTestCase::tearDown()

[ Top ]
testAcquireNewPersistentSession  [line 1383]

  void testAcquireNewPersistentSession( )



[ Top ]
testAcquireNewPersistentSessionRetryOnCollision  [line 1442]

  void testAcquireNewPersistentSessionRetryOnCollision( )



[ Top ]
testAcquireNewPersistentSessionWithGivenSessionId  [line 1494]

  void testAcquireNewPersistentSessionWithGivenSessionId( )



[ Top ]
testAuthTokenRoundtrip  [line 3162]

  void testAuthTokenRoundtrip( )



[ Top ]
testCompareIdentifiers  [line 2595]

  void testCompareIdentifiers( )



[ Top ]
testEmptySessionData  [line 2429]

  void testEmptySessionData( )



[ Top ]
testExpireSessions  [line 1514]

  void testExpireSessions( )



[ Top ]
testGetAndPut  [line 129]

  void testGetAndPut( )



[ Top ]
testGetAuthToken  [line 3097]

  void testGetAuthToken( )



[ Top ]
testGetCreationAndModificationDate  [line 2994]

  void testGetCreationAndModificationDate( )



[ Top ]
testGetId  [line 796]

  void testGetId( )



[ Top ]
testGetSerializedSession  [line 3046]

  void testGetSerializedSession( )



[ Top ]
testHasSiteAdminSessionExpired  [line 3274]

  void testHasSiteAdminSessionExpired( )



[ Top ]
testInit  [line 550]

  void testInit( )



[ Top ]
testInitAndStartDoNotGenerateAuthToken  [line 3082]

  void testInitAndStartDoNotGenerateAuthToken( )



[ Top ]
testInitEmpty  [line 2853]

  void testInitEmpty( )



[ Top ]
testInitEmptyEmptyRemoteId  [line 2894]

  void testInitEmptyEmptyRemoteId( )



[ Top ]
testInitEmptySecure  [line 569]

  void testInitEmptySecure( )



[ Top ]
testInitEmptyVerifyNoCookieIsSet  [line 2925]

  void testInitEmptyVerifyNoCookieIsSet( )



[ Top ]
testInitEmptyWithUserId  [line 2912]

  void testInitEmptyWithUserId( )



[ Top ]
testInitForExistingSession  [line 693]

  void testInitForExistingSession( )



[ Top ]
testInitInvalidSessionId  [line 656]

  void testInitInvalidSessionId( )



[ Top ]
testInitRemoteIdentifier  [line 2953]

  void testInitRemoteIdentifier( )

Normally we initialize remoteIdentifer when a session is created and check it on each request for session hijack protection. However, in some cases (create new session for print services to access) we initialize with empty remoteIdentifier. In this case the first init() call should allow access and set the remoteIdentifier based on this request.



[ Top ]
testInitSwitchToSecure  [line 587]

  void testInitSwitchToSecure( )



[ Top ]
testInitSwitchToUnsecure  [line 622]

  void testInitSwitchToUnsecure( )



[ Top ]
testInitWithFixCookieVars  [line 239]

  void testInitWithFixCookieVars( )



[ Top ]
testIsCorrectAuthToken  [line 3130]

  void testIsCorrectAuthToken( )



[ Top ]
testIsCorrectAuthTokenCanHandleNull  [line 3225]

  void testIsCorrectAuthTokenCanHandleNull( )



[ Top ]
testIsCorrectAuthTokenForForgedAuthToken  [line 3143]

  void testIsCorrectAuthTokenForForgedAuthToken( )



[ Top ]
testIsCorrectAuthTokenForSessionWithoutAuthToken  [line 3119]

  void testIsCorrectAuthTokenForSessionWithoutAuthToken( )



[ Top ]
testIsHttps  [line 3026]

  void testIsHttps( )



[ Top ]
testIsPersistent  [line 3010]

  void testIsPersistent( )



[ Top ]
testIsPersistentSessionAllowedForRequest  [line 2806]

  void testIsPersistentSessionAllowedForRequest( )

Check that we don't save sessions for core.DownloadItem, migrate.Redirect and CSS requests.



[ Top ]
testIsPersistentSessionAllowedForRequestCachesResult  [line 2842]

  void testIsPersistentSessionAllowedForRequestCachesResult( )



[ Top ]
testIsPersistentSessionRequired  [line 1844]

  void testIsPersistentSessionRequired( )



[ Top ]
testIsUsingCookies  [line 206]

  void testIsUsingCookies( )



[ Top ]
testLoadedSessionData  [line 3066]

  void testLoadedSessionData( )



[ Top ]
testLoadSessionData  [line 2197]

  void testLoadSessionData( )



[ Top ]
testLoadSessionDataExpiredSession  [line 2274]

  void testLoadSessionDataExpiredSession( )

User agents should not send back expired cookies (RFC 2965), but what if they do? Thus Gallery should not blindly load the session data for a given sessionId, but first check if the session already expired.



[ Top ]
testLoadSessionDataLoadMiss  [line 2384]

  void testLoadSessionDataLoadMiss( )



[ Top ]
testMisidentifiedSearchEngineSessionBecomesRegisteredUser  [line 2512]

  void testMisidentifiedSearchEngineSessionBecomesRegisteredUser( )



[ Top ]
testNewSessionCollision  [line 291]

  void testNewSessionCollision( )



[ Top ]
testRegenerateFromGuestToGuest  [line 1296]

  void testRegenerateFromGuestToGuest( )



[ Top ]
testRegenerateFromGuestToLoggedIn  [line 1338]

  void testRegenerateFromGuestToLoggedIn( )



[ Top ]
testRegenerateSessionId  [line 1239]

  void testRegenerateSessionId( )



[ Top ]
testRemove  [line 148]

  void testRemove( )



[ Top ]
testReplaceSessionIdInDataDoReplaceSessionIdIfNecessaryOnNestedObject  [line 1760]

  void testReplaceSessionIdInDataDoReplaceSessionIdIfNecessaryOnNestedObject( )



[ Top ]
testReplaceSessionIdInDataDoStringReplaceOnNestedArray  [line 1722]

  void testReplaceSessionIdInDataDoStringReplaceOnNestedArray( )



[ Top ]
testReplaceTempSessionIdIfNecessaryDoNothing  [line 1698]

  void testReplaceTempSessionIdIfNecessaryDoNothing( )



[ Top ]
testReplaceTempSessionIdIfNecessaryRemove  [line 1706]

  void testReplaceTempSessionIdIfNecessaryRemove( )



[ Top ]
testReplaceTempSessionIdIfNecessaryRemovesTrailingQueryStringSeparator  [line 1826]

  void testReplaceTempSessionIdIfNecessaryRemovesTrailingQueryStringSeparator( )



[ Top ]
testReplaceTempSessionIdIfNecessaryReplace  [line 1809]

  void testReplaceTempSessionIdIfNecessaryReplace( )



[ Top ]
testReset  [line 811]

  void testReset( )



[ Top ]
testResumeMisidentifiedSearchEngineSessionAsRegisteredUser  [line 2548]

  void testResumeMisidentifiedSearchEngineSessionAsRegisteredUser( )



[ Top ]
testSameSessionDifferentRemoteIdentifier  [line 402]

  void testSameSessionDifferentRemoteIdentifier( )



[ Top ]
testSaveCallsExpireSessions  [line 1133]

  void testSaveCallsExpireSessions( )



[ Top ]
testSaveDoNotSaveIfSessionIdEmpty  [line 1022]

  void testSaveDoNotSaveIfSessionIdEmpty( )



[ Top ]
testSaveNewSession  [line 870]

  void testSaveNewSession( )



[ Top ]
testSaveResaveExistingSessionDataChanged  [line 909]

  void testSaveResaveExistingSessionDataChanged( )



[ Top ]
testSaveResaveExistingSessionNoDataChangedDoNotTouch  [line 950]

  void testSaveResaveExistingSessionNoDataChangedDoNotTouch( )



[ Top ]
testSaveResaveExistingSessionNoDataChangedTouch  [line 982]

  void testSaveResaveExistingSessionNoDataChangedTouch( )



[ Top ]
testSaveReturnsErrorOnMissingUserId  [line 1056]

  void testSaveReturnsErrorOnMissingUserId( )



[ Top ]
testSaveSessionShouldNotSave  [line 1079]

  void testSaveSessionShouldNotSave( )

Test if save() actually doesn't save if the current request is in the exclude list.



[ Top ]
testSearchEngineCrawlerSessions  [line 2460]

  void testSearchEngineCrawlerSessions( )



[ Top ]
testSearchEngineCrawlerSessionsAsExplicitGuestUser  [line 2484]

  void testSearchEngineCrawlerSessionsAsExplicitGuestUser( )



[ Top ]
testSessionCookieDomain  [line 2737]

  void testSessionCookieDomain( )



[ Top ]
testSessionCookieHeaderAndPersistence  [line 2609]

  void testSessionCookieHeaderAndPersistence( )



[ Top ]
testSessionIdInUrlOverridesCookie  [line 3236]

  void testSessionIdInUrlOverridesCookie( )



[ Top ]
testSessionInitializesIsUsingCookies  [line 2724]

  void testSessionInitializesIsUsingCookies( )



[ Top ]
testSessionKeyAndTempSessionHaveNoSpecialCharacters  [line 1796]

  void testSessionKeyAndTempSessionHaveNoSpecialCharacters( )

Our replaceTempSessionIdIfNecessary() code and the page caching assume that the session key and the temp session string have no characters that change when HTML or URL encoded.



[ Top ]
testSessionSaveLoad  [line 327]

  void testSessionSaveLoad( )



[ Top ]
testSetCookie  [line 1945]

  void testSetCookie( )



[ Top ]
testSetCookieDeleteCookie  [line 2129]

  void testSetCookieDeleteCookie( )



[ Top ]
testSetCookieNoExpirationDate  [line 2075]

  void testSetCookieNoExpirationDate( )



[ Top ]
testSetCookieSecure  [line 2014]

  void testSetCookieSecure( )



[ Top ]
testStart  [line 737]

  void testStart( )



[ Top ]
testStatus  [line 184]

  void testStatus( )



[ Top ]
_markSessionForCleanup  [line 123]

  void _markSessionForCleanup( $session  )

Parameters:
   $session: 


[ Top ]

Documentation generated on Fri, 08 Oct 2010 05:53:39 -0700 by phpDocumentor 1.3.0RC6