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

Class: PermissionTest

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

Class PermissionTest

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 ]
Property Summary
array   $_albums   Our internal albums

[ Top ]
Method Summary
PermissionTest   PermissionTest()  
void   setUp()   Create nested albums that only have core.canChangePermissions that we can use for testing.
void   tearDown()  
void   testAddAndRemoveUserAndGroupPermission()   Add and remove some user and group permissions and test retrieving them.
void   testAddPermissionToEntityWithoutPermissions()  
void   testAddPermissionToSession()  
void   testCompactAccessLists()  
void   testCopyPermissions()   Test copying permissions from one item to another This covers:
void   testFetchAccessListIds()  
void   testFetchAccessListIdsForArrayMiss()  
void   testFetchAccessListIdsForArrayWithFourPermissions()  
void   testFetchAccessListIdsForArrayWithSinglePermission()  
void   testFetchAccessListIdsForArrayWithTwoPermissions()  
void   testFetchPermissionsForItems()   Test getting permissions for a non activeUser This covers:
void   testFetchPermissionsForItemsCache()  
void   testFetchPermissionsForItemsForOtherUserId()  
void   testGetPermissions()  
void   testHasItemPermission()  
void   testHasItemPermissionChecksPermissionCache()  
void   testHasPermission()   Test copying permissions from one item to another This covers:
void   testRecursiveAdd()  
void   testRecursiveRemove()  
void   testRemoveItemPermissions()  
void   _prepareForFetchAccessListIds()  
void   _sortPermissions()   Sort permissions by group, user then permission name

[ Top ]
Properties
array   $_albums [line 39]

Our internal albums

API Tags:
Access:  private


[ Top ]
Methods
Constructor PermissionTest  [line 41]

  PermissionTest PermissionTest( $methodName  )

Parameters:
   $methodName: 


[ Top ]
setUp  [line 48]

  void setUp( )

Create nested albums that only have core.canChangePermissions that we can use for testing.



Redefinition of:
GalleryTestCase::setUp()

[ Top ]
tearDown  [line 94]

  void tearDown( )



Redefinition of:
GalleryTestCase::tearDown()

[ Top ]
testAddAndRemoveUserAndGroupPermission  [line 120]

  void testAddAndRemoveUserAndGroupPermission( )

Add and remove some user and group permissions and test retrieving them.

This covers: GalleryCoreApi::addUserPermission GalleryCoreApi::addGroupPermission GalleryCoreApi::addEntityPermission GalleryCoreApi::removeUserPermission GalleryCoreApi::removeGroupPermission GalleryCoreApi::removeEntityPermission GalleryCoreApi::fetchAllPermissionsForItem And that the correct events are posted (ViewableTreeChange, RemovePermission)



[ Top ]
testAddPermissionToEntityWithoutPermissions  [line 1418]

  void testAddPermissionToEntityWithoutPermissions( )



[ Top ]
testAddPermissionToSession  [line 1472]

  void testAddPermissionToSession( )



[ Top ]
testCompactAccessLists  [line 1140]

  void testCompactAccessLists( )



[ Top ]
testCopyPermissions  [line 602]

  void testCopyPermissions( )

Test copying permissions from one item to another This covers:

GalleryCoreApi::addUserPermission GalleryCoreApi::fetchPermissionsForItems



[ Top ]
testFetchAccessListIds  [line 770]

  void testFetchAccessListIds( )



[ Top ]
testFetchAccessListIdsForArrayMiss  [line 904]

  void testFetchAccessListIdsForArrayMiss( )



[ Top ]
testFetchAccessListIdsForArrayWithFourPermissions  [line 923]

  void testFetchAccessListIdsForArrayWithFourPermissions( )



[ Top ]
testFetchAccessListIdsForArrayWithSinglePermission  [line 866]

  void testFetchAccessListIdsForArrayWithSinglePermission( )



[ Top ]
testFetchAccessListIdsForArrayWithTwoPermissions  [line 885]

  void testFetchAccessListIdsForArrayWithTwoPermissions( )



[ Top ]
testFetchPermissionsForItems  [line 634]

  void testFetchPermissionsForItems( )

Test getting permissions for a non activeUser This covers:

GalleryCoreApi::addUserPermission GalleryCoreApi::fetchPermissionsForItems



[ Top ]
testFetchPermissionsForItemsCache  [line 1080]

  void testFetchPermissionsForItemsCache( )



[ Top ]
testFetchPermissionsForItemsForOtherUserId  [line 1047]

  void testFetchPermissionsForItemsForOtherUserId( )



[ Top ]
testGetPermissions  [line 1284]

  void testGetPermissions( )



[ Top ]
testHasItemPermission  [line 1231]

  void testHasItemPermission( )



[ Top ]
testHasItemPermissionChecksPermissionCache  [line 1247]

  void testHasItemPermissionChecksPermissionCache( )



[ Top ]
testHasPermission  [line 699]

  void testHasPermission( )

Test copying permissions from one item to another This covers:

GalleryCoreApi::addUserPermission GalleryCoreApi::addGroupPermission GalleryCoreApi::hasPermission



[ Top ]
testRecursiveAdd  [line 1300]

  void testRecursiveAdd( )



[ Top ]
testRecursiveRemove  [line 1352]

  void testRecursiveRemove( )



[ Top ]
testRemoveItemPermissions  [line 522]

  void testRemoveItemPermissions( )



[ Top ]
_prepareForFetchAccessListIds  [line 943]

  void _prepareForFetchAccessListIds( )



[ Top ]
_sortPermissions  [line 586]

  void _sortPermissions( $a, $b  )

Sort permissions by group, user then permission name

Parameters:
   $a: 
   $b: 

API Tags:
Access:  private


[ Top ]

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