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

Class: GalleryTestCase

Source Location: /lib/tools/phpunit/GalleryTestCase.class

Class GalleryTestCase

Direct descendents
Child Class Description
GalleryPendingUserTest Test PendingUser functionality
RegisterModuleTest Test Register module functionality
FlashVideoRendererTest Test FlashVideoRenderer functionality
NetPbmToolkitTest Test NetPbmToolkit functionality
MembersTest Test Members List/Profile functionality
HiddenEventHandlerTest HiddenEventHandlerTest - Tests the event handlers.
ImageBlockDisabledTest ImageBlockOption tests
ImageBlockHandlerTest Test Image Block functionality
ImageBlockHelperTest Test Image Block helper
ImageBlockTest Test Image Block functionality
ImageFrameTest Test ImageFrameInterface functionality
ImageMagickToolkitTest Test ImageMagickToolkit functionality
UserAlbumTest Test UserAlbum functionality
PicLensHelperTest PicLensHelper tests
SlideshowHelperTest SlideshowHelper tests
SitemapViewTest Test Sitemap output
SearchUtilitiesTest Test SearchUtilities functionality
PermalinksTest Test Permalinks functionality
ImageUploadHelperTest ImageUploadHelper tests
EventHandlerTest SizeLimitOption tests
SizeLimitHelperTest SizeLimitHelper tests. Test the areas that are not covered by AddPhotoOption
RewriteUrlGeneratorTest Generic rewrite URL generator tests.
RewriteApiTest Test RewriteApi functionality
RewriteHelperTest Rewrite helper tests.
ModRewriteHelperTest
RewriteModuleTest Test RewriteUrlGenerator functionality
RewriteParserTestCase Global URL rewrite parser tests.
RewriteSimpleHelperTest
RewriteUrlGeneratorTestCase Global rewrite URL generator tests.
IsapiRewriteHelperTest
PathInfoHelperTest
GdToolkitTest Test GdToolkit functionality
NewItemsTest NewItems tests
ExifToolkitTest Test ExifToolkit functionality
ExifHelperTest Test Exif Helper functionality
ExifExtractorTest Test ExifExtractor functionality
MultiLangSearchTest Test MultiLangSearch functionality
WatermarkTest Test WatermarkHelper functionality
FfmpegToolkitTest Test FfmpegToolkit functionality
RssMapTest Test Rss functionality
RssTest Test Rss functionality
PhotoAccessCartPluginTest Test PhotoAccess cart functionality
ZipCartDownloadTest Test ZipCart Download functionality
ZipCartPluginTest Test ZipCart functionality
ThumbnailToolkitTest ThumbnailToolkit tests
ThumbnailImageTest Test ThumbnailImage functionality
RatingAlbumTest Test RatingAlbum view
RatingCallbackViewTest Test RatingCallback functionality
RatingCallbacksTest Rating callback tests
RatingHelperTest RatingHelper tests
EmbedTest Test Embed functionality
EntityTest Test Entity functionality
CoreSearchTest Test CoreSearch functionality
RepositoryTest Test repository functionality
ChildTest Test Child functionality
ControllerTest Test GalleryController functionality
SessionAuthPluginTest Session authentication tests
FastDownloadTest Test our fast download code.
PermissionSetTest Test PermissionSet functionality
ToolkitTest Test Toolkit functionality
CharsetTest Test character set helper
MarkupTest Test Markup functionality
TranslatorTest Test Translator functionality.
ShowItemTest Test ShowItem view
PluginParameterTest Test plugin parameters
StorageTest Test some Storage functionality
ItemAttributesTest Test ItemAttribute functionality.
SimpleCallbackTest Test SimpleCallback functionality
MailHelperTest Test mail functionality
EventTest Test Event functionality
TemplateAdapterTest Test Gallery Template Adapter functionality
UserAndGroupTest Test User and Group functionality
TruncateTest Test Truncate functionality
ModuleTest Test Module functionality
MimeTest Test Mime type functionality
PermissionTest Test Permission functionality
PhotoTest Test Photo functionality
ItemTest Test Item functionality
AlbumTest Test Album functionality
StatusTest Test Status functionality
TemplateTest Test Template functionality
UtilitiesTest Test utilities functionality.
FlushDatabaseCacheTaskTest Test the FlushDatabaseCache maintenance task functionality
CallbacksTest Test module callbacks
MaintenanceHelperTest Tests for data about maintenance tasks
FlushTemplatesTaskTest Test the FlushTemplates maintenance task functionality
FileSystemTest Test FileSystem functionality
PlatformTest Test platform functionality.
IndexDotPhpTest Test index.php functionality
LockTest Lock tests.
PhpVmTest Test the GalleryPhpVm. These are passthrough functions so all we do is perform a smoke test to make sure that the basic arguments are getting passed through correctly.
DataCacheTest Test DataCache functionality
UrlGeneratorTest URL generator tests.
CoreModuleTest Test CoreModule functionality
PluginTest Test Plugin functionality
FactoryTest Test Factory functionality
ViewTest Test GalleryView functionality
OptimizeDatabaseTaskTest Test the OptimizeDatabase maintenance task functionality
RepositoryIndexTest Test repository index functionality
DatabaseStorageTest Test Item functionality
PluginCallbackTest PluginCallback tests
MapTest Test Map functionality
RepositoryUtilitiesTest Test repository utilities functionality
WebTest Test Web functionality
SessionTest Test session functionality.
MainTest Test main.php
DataItemTest Test DataItem functionality
ItemOrderTest Test ItemOrder functionality
DerivativeTest Test Derivative functionality
ThemeTest Test GalleryTheme functionality
RepositoryCallbackTest RepositoryCallback tests
UserHelperTest UserHelper tests
MovieTest Test Movie functionality
DownloadItemTest Test DownloadItem functionality
CoreApiTest Gallery core API tests.
BuildDerivativesTaskTest Test the BuildDerivatives maintenance task functionality
AdminEventLogViewerCallbackTest Test AdminEventLogViewerCallback
EventLogHelperTest Test the GalleryEventLogHelper code
DatabaseExportTest Test Database Export functionality
DatabaseImportTest Test Database Import functionality
SiteAdminTest Tests for SiteAdmin view
DeleteSessionsTaskTest Test the DeleteSessions maintenance task functionality
RepositoryDownloadPackagesTest Test repository utilities functionality
CartHelperTest Test Cart functionality
DcrawToolkitHelperTest AdminDcraw controller tests
DcrawToolkitTest Dcraw toolkit tests
ShutterflyCartPluginTest Test Shutterfly cart plugin
ShutterflyPrintPhotosViewTest Test ShutterflyPrintPhotos immediate view
LinkItemTest Additional LinkItem tests
FotokastenCartPluginTest Test Fotokasten cart plugin
ColorPackTest Test ColorPackInterface functionality
DownloadRegistryFileTest PublishXp DownloadRegistryFile tests
Getid3HelperTest Test Getid3 Helper functionality
Getid3ToolkitTest Test Getid3Toolkit functionality
MP3AudioRendererTest Test MP3AudioRenderer functionality
ArchiveExtractToolkitTest Test ArchiveExtractToolkit functionality
MimeHelperTest MimeHelperTest tests.
PanoramaHelperTest PanoramaHelper tests
SquareThumbToolkitTest Test SquareThumbToolkit functionality
AlbumSelectTest Test AlbumSelect functionality
CommentTest Test Comment functionality
CommentSearchTest Test CommentSearch functionality
CommentCallbackViewTest Test CommentCallback functionality
AkismetApiTest Test AkismetApi functionality
CaptchaHelperTest Test Captcha Helper
CaptchaValidationPluginTest Test Captcha validation plugin
KeywordAlbumTest Test KeywordAlbum view and module
KeywordAlbumCallbacksTest Keyword Album callback tests
DigibugCartPluginTest Test Digibug cart plugin
DigibugPrintPhotosViewTest Test DigibugPrintPhotos immediate view
QuotasHelperTest Test Quotas functionality
QuotasListenerTest Test Quotas Listener functionality
CustomFieldInterfaceTest Test CustomFieldInterface functionality
CustomFieldHelperTest CustomFieldHelperTest tests.
CustomFieldSearchTest Test CustomFieldSearch functionality
DynamicAlbumTest Test DynamicAlbum views
ServerAuthPluginTest Server auth tests.
HttpAuthPluginTest HTTP auth tests.
HttpAuthHelperTest HTTP auth helper tests.
HttpAuthModuleTest HTTP auth module tests.
WebDavTest WebDAV tests.
WebDavRewriteHelperTest WebDAV rewrite helper tests.
WebDavModuleTest WebDAV module tests.
WebDavHelperTest WebDAV helper tests.
JpegtranToolkitTest Test JpegtranToolkit functionality
SnapGalaxyCartPluginTest Test SnapGalaxy cart functionality
NotificationEventHandlingTest NotificationHelper tests
NotificationHelperTest NotificationHelper tests
ItemAddOptionTestCase An ItemAddPlugin specific version of GalleryTestCase
ItemEditPluginTestCase An ItemEditPlugin specific version of GalleryTestCase
CodeAuditTestCase A framework for scanning all of our source files for specific patterns. Subclasses must override the checkFile() method to implement their own checks.
GalleryControllerTestCase A controller specific version of GalleryTestCase
ItemAddPluginTestCase An ItemAddPlugin specific version of GalleryTestCase
ItemEditOptionTestCase An ItemEditOption specific version of GalleryTestCase
GalleryImmediateViewTestCase Gallery specific version of PHPUnit's TestCase class for immediate GalleryViews.
GalleryViewTestCase A view specific version of GalleryTestCase

[ Top ]
Property Summary
mixed   $_cleanup  

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

[ Top ]
Properties
mixed   $_cleanup [line 35]

[ Top ]
Methods
static method DeepCompare  [line 865]

  static void DeepCompare( $obj1, $obj2, [ $context = null]  )

Parameters:
   $obj1: 
   $obj2: 
   $context: 


[ Top ]
static method getEntityCounter  [line 53]

  static EntityCounterEventListener &getEntityCounter( )

Get the entity counter listener which contains the types and number of elements deleted.

Usage: $counter =& GalleryTestCase::getEntityCounter();



[ Top ]
Constructor GalleryTestCase  [line 37]

  GalleryTestCase GalleryTestCase( $methodName  )

Parameters:
   $methodName: 


[ Top ]
assert  [line 398]

  void assert( $boolean, [ $message = null]  )

Parameters:
   $boolean: 
   $message: 


[ Top ]
assertEquals  [line 404]

  void assertEquals( $expected, $actual, [ $message = null]  )

Parameters:
   $expected: 
   $actual: 
   $message: 


[ Top ]
assertErrorEquals  [line 1128]

  void assertErrorEquals( int $errorCode, GalleryStatus $ret, [bool $exactMatch = false], [string $message = null]  )

Fail if the provided GalleryStatus object does not contain the given error code.

Parameters:
int   $errorCode:  The expected error code
GalleryStatus   $ret:  The status object to check against
bool   $exactMatch:  (optional) Whether the actual error can be a superset or must match the expected error code exactly. Default false.
string   $message:  (optional) Message to be shown on failure


[ Top ]
assertEventFired  [line 1154]

  void assertEventFired( string $eventName, [GalleryEntity $eventEntity = null], [array $eventData = null]  )

Fail if the provided event name was not fired.

Parameters:
string   $eventName: 
GalleryEntity   $eventEntity:  (optional) default is null
array   $eventData:  (optional) default is null. should match the expected event data


[ Top ]
assertEventNotFired  [line 1177]

  void assertEventNotFired( string $eventName  )

Fail if the provided event name was fired

Parameters:
string   $eventName: 


[ Top ]
failWithStatus  [line 102]

  void failWithStatus( $ret  )

This is deprecated in Gallery 2.3 -- now tests should just return $ret and let the framework generate the right failure message.

Parameters:
   $ret: 

API Tags:
Deprecated:  


[ Top ]
setUp  [line 110]

  void setUp( )



Redefined in descendants as:

[ Top ]
tearDown  [line 196]

  void tearDown( )



Redefined in descendants as:

[ Top ]
_array_unshift_key_value  [line 1059]

  void _array_unshift_key_value( &$array, $key, $value  )

Utility method to array_unshift a single key => value pair.

Parameters:
   &$array: 
   $key: 
   $value: 

API Tags:
Access:  private


[ Top ]
_becomeGuestUser  [line 843]

  void _becomeGuestUser( )



[ Top ]
_createDerivative  [line 693]

  void _createDerivative( &$parent, $sourceId, $type, [ $operations = 'test-operation|100'], [ $mimeType = 'test/file'], [ $fields = array()]  )

Parameters:
   &$parent: 
   $sourceId: 
   $type: 
   $operations: 
   $mimeType: 
   $fields: 


[ Top ]
_createLinkedItem  [line 567]

  array _createLinkedItem( int $parentId, GalleryItem $targetItem  )

Create a random link item

Parameters:
int   $parentId:  the id of the parent album
GalleryItem   $targetItem:  target item

API Tags:
Return:  GalleryStatus a status code GalleryDataItem
Access:  protected


[ Top ]
_createRandomAlbum  [line 423]

  array _createRandomAlbum( int $parentId, [array $fields = array()]  )

Create a random album

Parameters:
int   $parentId:  the id of the parent album
array   $fields:  (optional) fields to set in the new instance (field => value, ..)

API Tags:
Return:  GalleryStatus a status code GalleryAlbumItem
Access:  protected


[ Top ]
_createRandomDataItem  [line 490]

  array _createRandomDataItem( int $parentId, [string $mimeType = 'application/unknown'], [array $fields = array()], [string $inputFile = __FILE__], [string $itemClass = null]  )

Create a random data item

Parameters:
int   $parentId:  the id of the parent album
string   $mimeType:  (optional) mime type (default application/unknown)
array   $fields:  (optional) fields to set in the new instance (field => value, ..)
string   $inputFile:  (optional) data file (default __FILE__)
string   $itemClass:  (optional) class to instantiate (default from factory)

API Tags:
Return:  GalleryStatus a status code GalleryDataItem
Access:  protected


[ Top ]
_createRandomGroup  [line 659]

  array _createRandomGroup( [string $groupTag = null]  )

Create a random group

Parameters:
string   $groupTag:  (optional) suffix to add on group name

API Tags:
Return:  GalleryStatus a status code GalleryGroup
Access:  protected


[ Top ]
_createRandomUser  [line 613]

  array _createRandomUser( [string $userTag = null], [string $password = 'password']  )

Create a random user

Parameters:
string   $userTag:  (optional) suffix to add on username
string   $password:  (optional)

API Tags:
Return:  GalleryStatus a status code GalleryUser
Access:  protected


[ Top ]
_createUser  [line 784]

  void _createUser( [ $fields = array()]  )

Parameters:
   $fields: 


Redefined in descendants as:

[ Top ]
_deleteAndVerifyEntity  [line 733]

  void _deleteAndVerifyEntity( $id  )

Parameters:
   $id: 


[ Top ]
_disableUserName  [line 965]

  GalleryStatus _disableUserName( string $userName  )

Convenience method to mark a username as disabled.

Parameters:
string   $userName:  the username

API Tags:
Return:  a status code


[ Top ]
_getRootId  [line 341]

  int _getRootId( )


API Tags:
Return:  id


[ Top ]
_getUnusedId  [line 829]

  void _getUnusedId( )

Get an id that is not used for anything.



[ Top ]
_initEventListenersForTest  [line 1011]

  void _initEventListenersForTest( )

Disable all but some core event listeners by default.



[ Top ]
_markEventListenersForCleanup  [line 987]

  void _markEventListenersForCleanup( )

Create a backup of the registered event listeners which will be restored in tearDown.



[ Top ]
_markFactoryForCleanup  [line 976]

  void _markFactoryForCleanup( )

Create a backup of the factory data which will be restored in tearDown.



[ Top ]
_markFactoryModuleForCleanup  [line 351]

  void _markFactoryModuleForCleanup( string $moduleId  )

Parameters:
string   $moduleId:  to unregister from factory in tearDown


[ Top ]
_markForCleanup  [line 346]

  void _markForCleanup( GalleryEntity $entity  )

Parameters:
GalleryEntity   $entity:  to delete in tearDown


[ Top ]
_markPluginParametersForCleanup  [line 367]

  GalleryStatus _markPluginParametersForCleanup( string $pluginType, string $pluginId  )

Store plugin parameters to be restored in tearDown

Parameters:
string   $pluginType: 
string   $pluginId: 


[ Top ]
_markToolkitForCleanup  [line 356]

  void _markToolkitForCleanup( string $toolkitId  )

Parameters:
string   $toolkitId:  to unregister in tearDown


[ Top ]
_registerEventListener  [line 84]

  GalleryStatus _registerEventListener( mixed $events, [ $className = 'NullEventListener'], string $classname  )

Register a The NullEventListener for a test

Parameters:
mixed   $events:  a single event name or an array of event names to be be registered
string   $classname:  (optional) event handler class name. Default is NullEventListener.
   $className: 

API Tags:
Return:  object


[ Top ]
_registerFactoryImplementationForTest  [line 1046]

  void _registerFactoryImplementationForTest( $classType, $className, $implId, $implPath, $implModuleId, [ $hints = array()]  )

Register a factory implementation temporarily for this test.

You need to call _markFactoryForCleanup() before changing the factory during a test. Will register the new implementation always with top priority.

Parameters:
   $classType: 
   $className: 
   $implId: 
   $implPath: 
   $implModuleId: 
   $hints: 

API Tags:
See:  GalleryCoreApi::registerFactoryImplementation


[ Top ]
_registerTestEventListener  [line 69]

  void _registerTestEventListener( string $eventName, &$listener, GalleryEventListener $listener  )

Register and event name and associated listener (deprecated).

Parameters:
string   $eventName: 
GalleryEventListener   $listener: 
   &$listener: 

API Tags:
Deprecated:  Use _registerEventLister.


[ Top ]
_setMarkupType  [line 384]

  GalleryStatus _setMarkupType( string $markup, [bool $saveParams = false]  )

Set core parameter for markup type.

Parameters:
string   $markup:  markup type
bool   $saveParams:  (optional) true to first mark core parameters for cleanup


[ Top ]
_signUrl  [line 946]

  string _signUrl( string $url, [bool $htmlEntities = true]  )

Adds an authToken to the given URL

Parameters:
string   $url: 
bool   $htmlEntities:  whether to use HTML entities or not, defaults to true

API Tags:
Return:  URL with authToken


[ Top ]
_unregisterFactoryImplementationForTest  [line 1074]

  void _unregisterFactoryImplementationForTest( string $classType, [string $implId = null], [string $className = null]  )

Unregister a specific factory implementation or all implementations of a spefific type temporarily for this test.

You need to call _markFactoryForCleanup() before changing the factory during a test. To unregister all implementations of a specific type, leave implId and className empty.

Parameters:
string   $classType: 
string   $implId:  (optional)
string   $className:  (optional)

API Tags:
Access:  private


[ Top ]
_verifyEntity  [line 767]

  void _verifyEntity( $entity  )

Parameters:
   $entity: 


[ Top ]
_verifyFields  [line 929]

  void _verifyFields( $entity, $fields  )

Parameters:
   $entity: 
   $fields: 


[ Top ]
_verifyMissing  [line 749]

  void _verifyMissing( $id  )

Parameters:
   $id: 


[ Top ]

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