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

Class: UtilitiesTest

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

Class UtilitiesTest

Class Overview

Test utilities functionality.

Located in /modules/core/test/phpunit/UtilitiesTest.class [line 33]

TestCase
   |
   --GalleryTestCase
      |
      --UtilitiesTest

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
UtilitiesTest   UtilitiesTest()  
void   setUp()  
void   tearDown()  
void   testArrayInput()  
void   testCastToFloat()  
void   testConvertPathToUrl()  
void   testCreateAlbumTree()  
void   testEntitySubstr()  
void   testFixCookieVars()  
void   testGetAllRequestVariables()  
void   testGetCookieVar()  
void   testGetFile()  
void   testGetFileBase()  
void   testGetFileExtension()  
void   testGetFileNameComponents()  
void   testGetFileNameComponents2()  
void   testGetFileNameComponents3()  
void   testGetFormVariables()  
void   testGetFormVariables2()  
void   testGetFormVariables3()   Test the error condition where we have a value in _POST and we put the same value back via
void   testGetFormVariables4()  
void   testGetFormVariablesNoPrefix()  
void   testGetFormVariablesNoPrefix2()  
void   testGetHttpDate()  
void   testGetPhpIniBool()  
void   testGetPseudoFileName()  
void   testGetRemoteHostAddress1()  
void   testGetRemoteHostAddress2()  
void   testGetRemoteHostAddress3()  
void   testGetRemoteHostAddress4()  
void   testGetRemoteHostAddress5()  
void   testGetRequestVariables()  
void   testGetServerVar()  
void   testGuaranteeDirExists()  
void   testGuaranteeDirExistsLoop()  
void   testGuaranteeDirExistsLoop2()  
void   testGuaranteeDirExistsLoop3()  
void   testHasRequestVariable()  
void   testHasRequestVariable2()  
void   testHtmlSafe()  
void   testHtmlSafeUtf7()  
void   testHtmlSafeWithDecode()  
void   testIdentifySearchEngineCrawlerFromRequest()  
void   testIsA()  
void   testIsCompatibleWithApi()  
void   testIsEmbedded()  
void   testIsExactlyA()  
void   testIsPathInList()  
void   testIsSafeHttpHeader()  
void   testIsTrustedProxy()  
void   testIsValidEmailString()   The readManifest() code doesn't use GalleryPlatform and is hard to test. So this test is
void   testMakeMarkers()  
void   testMalformedRemoteHostAddress()  
void   testMalformedRemoteHostAddress2()  
void   testMaliciousBrowserInput1()  
void   testMaliciousRemoteHostAddress()  
void   testProcessingPaths()  
void   testRegisterCookieAttr()  
void   testRemoveFormVariables()  
void   testRemoveRequestVariable()  
void   testRemoveRequestVariable2()  
void   testRoundToString()  
void   testSanitizeInputValue1()  
void   testSanitizeInputValue2()  
void   testSanitizeRoundTrip()  
void   testScaleDimensionsToFit()  
void   testSetLocationResponseHeader()  
void   testSetLocationResponseHeaderNoReplace()  
void   testSetLocationResponseHeaderNoReplace3xx()  
void   testSetLocationResponseHeaderWithReplace()  
void   testSetResponseHeader()  
void   testSetResponseHeaderNoReplace()  
void   testSetResponseHeaderWithReplace()  
void   testShrinkDimensionsToFit()  
void   testStrToLower()  
void   testStrToUpper()  
void   testUnicodeEntitiesToUtf8()  
void   testUnicodeValueToUtf8Value()  
void   testUnsanitizeInputValues()  
void   testUtf8Substring()  
void   testUtf8ToUnicodeEntities()  

[ Top ]
Methods
Constructor UtilitiesTest  [line 35]

  UtilitiesTest UtilitiesTest( $methodName  )

Parameters:
   $methodName: 


[ Top ]
setUp  [line 39]

  void setUp( )



Redefinition of:
GalleryTestCase::setUp()

[ Top ]
tearDown  [line 63]

  void tearDown( )



Redefinition of:
GalleryTestCase::tearDown()

[ Top ]
testArrayInput  [line 108]

  void testArrayInput( )



[ Top ]
testCastToFloat  [line 1444]

  void testCastToFloat( )



[ Top ]
testConvertPathToUrl  [line 419]

  void testConvertPathToUrl( )



[ Top ]
testCreateAlbumTree  [line 764]

  void testCreateAlbumTree( )



[ Top ]
testEntitySubstr  [line 721]

  void testEntitySubstr( )



[ Top ]
testFixCookieVars  [line 1107]

  void testFixCookieVars( )



[ Top ]
testGetAllRequestVariables  [line 207]

  void testGetAllRequestVariables( )



[ Top ]
testGetCookieVar  [line 1067]

  void testGetCookieVar( )



[ Top ]
testGetFile  [line 800]

  void testGetFile( )



[ Top ]
testGetFileBase  [line 96]

  void testGetFileBase( )



[ Top ]
testGetFileExtension  [line 92]

  void testGetFileExtension( )



[ Top ]
testGetFileNameComponents  [line 73]

  void testGetFileNameComponents( )



[ Top ]
testGetFileNameComponents2  [line 79]

  void testGetFileNameComponents2( )



[ Top ]
testGetFileNameComponents3  [line 86]

  void testGetFileNameComponents3( )



[ Top ]
testGetFormVariables  [line 116]

  void testGetFormVariables( )



[ Top ]
testGetFormVariables2  [line 133]

  void testGetFormVariables2( )



[ Top ]
testGetFormVariables3  [line 157]

  void testGetFormVariables3( )

Test the error condition where we have a value in _POST and we put the same value back via

putRequestVariable -- make sure that the new value overwrites the old



[ Top ]
testGetFormVariables4  [line 165]

  void testGetFormVariables4( )



[ Top ]
testGetFormVariablesNoPrefix  [line 174]

  void testGetFormVariablesNoPrefix( )



[ Top ]
testGetFormVariablesNoPrefix2  [line 191]

  void testGetFormVariablesNoPrefix2( )



[ Top ]
testGetHttpDate  [line 835]

  void testGetHttpDate( )



[ Top ]
testGetPhpIniBool  [line 872]

  void testGetPhpIniBool( )



[ Top ]
testGetPseudoFileName  [line 1464]

  void testGetPseudoFileName( )



[ Top ]
testGetRemoteHostAddress1  [line 581]

  void testGetRemoteHostAddress1( )



[ Top ]
testGetRemoteHostAddress2  [line 588]

  void testGetRemoteHostAddress2( )



[ Top ]
testGetRemoteHostAddress3  [line 596]

  void testGetRemoteHostAddress3( )



[ Top ]
testGetRemoteHostAddress4  [line 604]

  void testGetRemoteHostAddress4( )



[ Top ]
testGetRemoteHostAddress5  [line 611]

  void testGetRemoteHostAddress5( )



[ Top ]
testGetRequestVariables  [line 199]

  void testGetRequestVariables( )



[ Top ]
testGetServerVar  [line 1052]

  void testGetServerVar( )



[ Top ]
testGuaranteeDirExists  [line 1357]

  void testGuaranteeDirExists( )



[ Top ]
testGuaranteeDirExistsLoop  [line 1363]

  void testGuaranteeDirExistsLoop( )



[ Top ]
testGuaranteeDirExistsLoop2  [line 1385]

  void testGuaranteeDirExistsLoop2( )



[ Top ]
testGuaranteeDirExistsLoop3  [line 1414]

  void testGuaranteeDirExistsLoop3( )



[ Top ]
testHasRequestVariable  [line 519]

  void testHasRequestVariable( )



[ Top ]
testHasRequestVariable2  [line 529]

  void testHasRequestVariable2( )



[ Top ]
testHtmlSafe  [line 1558]

  void testHtmlSafe( )



[ Top ]
testHtmlSafeUtf7  [line 1607]

  void testHtmlSafeUtf7( )



[ Top ]
testHtmlSafeWithDecode  [line 1597]

  void testHtmlSafeWithDecode( )



[ Top ]
testIdentifySearchEngineCrawlerFromRequest  [line 906]

  void testIdentifySearchEngineCrawlerFromRequest( )



[ Top ]
testIsA  [line 496]

  void testIsA( )



[ Top ]
testIsCompatibleWithApi  [line 850]

  void testIsCompatibleWithApi( )



[ Top ]
testIsEmbedded  [line 1030]

  void testIsEmbedded( )



[ Top ]
testIsExactlyA  [line 502]

  void testIsExactlyA( )



[ Top ]
testIsPathInList  [line 689]

  void testIsPathInList( )



[ Top ]
testIsSafeHttpHeader  [line 1629]

  void testIsSafeHttpHeader( )



[ Top ]
testIsTrustedProxy  [line 644]

  void testIsTrustedProxy( )



[ Top ]
testIsValidEmailString  [line 1672]

  void testIsValidEmailString( )

The readManifest() code doesn't use GalleryPlatform and is hard to test. So this test is

useful for when we're refactoring this code. Delete /tmp/manifest.txt and run the test once and it'll capture the current manifest. Subsequent runs will compare it against that golden version, so you can refactor the manifest code till you're happy. But don't leave this test uncommented as otherwise it will break on the next manifest update.



[ Top ]
testMakeMarkers  [line 400]

  void testMakeMarkers( )



[ Top ]
testMalformedRemoteHostAddress  [line 618]

  void testMalformedRemoteHostAddress( )



[ Top ]
testMalformedRemoteHostAddress2  [line 625]

  void testMalformedRemoteHostAddress2( )



[ Top ]
testMaliciousBrowserInput1  [line 100]

  void testMaliciousBrowserInput1( )



[ Top ]
testMaliciousRemoteHostAddress  [line 632]

  void testMaliciousRemoteHostAddress( )



[ Top ]
testProcessingPaths  [line 716]

  void testProcessingPaths( )



[ Top ]
testRegisterCookieAttr  [line 1250]

  void testRegisterCookieAttr( )



[ Top ]
testRemoveFormVariables  [line 559]

  void testRemoveFormVariables( )



[ Top ]
testRemoveRequestVariable  [line 539]

  void testRemoveRequestVariable( )



[ Top ]
testRemoveRequestVariable2  [line 551]

  void testRemoveRequestVariable2( )



[ Top ]
testRoundToString  [line 1424]

  void testRoundToString( )



[ Top ]
testSanitizeInputValue1  [line 361]

  void testSanitizeInputValue1( )



[ Top ]
testSanitizeInputValue2  [line 369]

  void testSanitizeInputValue2( )



[ Top ]
testSanitizeRoundTrip  [line 376]

  void testSanitizeRoundTrip( )



[ Top ]
testScaleDimensionsToFit  [line 488]

  void testScaleDimensionsToFit( )



[ Top ]
testSetLocationResponseHeader  [line 281]

  void testSetLocationResponseHeader( )



[ Top ]
testSetLocationResponseHeaderNoReplace  [line 321]

  void testSetLocationResponseHeaderNoReplace( )



[ Top ]
testSetLocationResponseHeaderNoReplace3xx  [line 340]

  void testSetLocationResponseHeaderNoReplace3xx( )



[ Top ]
testSetLocationResponseHeaderWithReplace  [line 300]

  void testSetLocationResponseHeaderWithReplace( )



[ Top ]
testSetResponseHeader  [line 224]

  void testSetResponseHeader( )



[ Top ]
testSetResponseHeaderNoReplace  [line 262]

  void testSetResponseHeaderNoReplace( )



[ Top ]
testSetResponseHeaderWithReplace  [line 242]

  void testSetResponseHeaderWithReplace( )



[ Top ]
testShrinkDimensionsToFit  [line 472]

  void testShrinkDimensionsToFit( )



[ Top ]
testStrToLower  [line 1615]

  void testStrToLower( )



[ Top ]
testStrToUpper  [line 1622]

  void testStrToUpper( )



[ Top ]
testUnicodeEntitiesToUtf8  [line 1001]

  void testUnicodeEntitiesToUtf8( )



[ Top ]
testUnicodeValueToUtf8Value  [line 977]

  void testUnicodeValueToUtf8Value( )



[ Top ]
testUnsanitizeInputValues  [line 394]

  void testUnsanitizeInputValues( )



[ Top ]
testUtf8Substring  [line 1020]

  void testUtf8Substring( )


Information Tags:
Todo:  Remove this test on next core API bump

[ Top ]
testUtf8ToUnicodeEntities  [line 1009]

  void testUtf8ToUnicodeEntities( )



[ Top ]

Documentation generated on Fri, 08 Oct 2010 06:06:47 -0700 by phpDocumentor 1.3.0RC6