Drupal 8  8.0.2
EntityAccessControlHandlerTest Class Reference
Inheritance diagram for EntityAccessControlHandlerTest:

Public Member Functions

 assertEntityAccess ($ops, AccessibleInterface $object, AccountInterface $account=NULL)
 
 testEntityAccess ()
 
 testDefaultEntityAccess ()
 
 testEntityAccessDefaultController ()
 
 testEntityTranslationAccess ()
 
 testHooks ()
 

Protected Member Functions

 setUp ()
 
- Protected Member Functions inherited from EntityLanguageTestBase
 setUp ()
 
 toggleFieldTranslatability ($entity_type, $bundle)
 
- Protected Member Functions inherited from EntityUnitTestBase
 setUp ()
 
 createUser ($values=array(), $permissions=array())
 
 reloadEntity (EntityInterface $entity)
 
 getHooksInfo ()
 
 installModule ($module)
 
 uninstallModule ($module)
 
 refreshServices ()
 
 generateRandomEntityId ($string=FALSE)
 

Additional Inherited Members

- Static Public Attributes inherited from EntityLanguageTestBase
static $modules = array('language', 'entity_test')
 
- Static Public Attributes inherited from EntityUnitTestBase
static $modules = ['user', 'system', 'field', 'text', 'filter', 'entity_test']
 
- Protected Attributes inherited from EntityLanguageTestBase
 $languageManager
 
 $langcodes
 
 $fieldName
 
 $untranslatableFieldName
 
- Protected Attributes inherited from EntityUnitTestBase
 $entityManager
 
 $generatedIds = array()
 
 $state
 

Detailed Description

Tests the entity access control handler.

Entity

Member Function Documentation

assertEntityAccess (   $ops,
AccessibleInterface  $object,
AccountInterface  $account = NULL 
)

Asserts entity access correctly grants or denies access.

References format_string().

Referenced by EntityAccessControlHandlerTest\testDefaultEntityAccess(), EntityAccessControlHandlerTest\testEntityAccess(), EntityAccessControlHandlerTest\testEntityAccessDefaultController(), and EntityAccessControlHandlerTest\testEntityTranslationAccess().

Here is the call graph for this function:

Here is the caller graph for this function:

testDefaultEntityAccess ( )

Ensures default entity access is checked when necessary.

This ensures that the default checkAccess() implementation of the entity access control handler is considered if hook_entity_access() has not explicitly forbidden access. Therefore the default checkAccess() implementation can forbid access, even after access was already explicitly allowed by hook_entity_access().

See Also
::checkAccess()
entity_test_entity_access()

References EntityAccessControlHandlerTest\assertEntityAccess(), EntityUnitTestBase\createUser(), and Drupal\currentUser().

Here is the call graph for this function:

testEntityAccess ( )

Ensures entity access is properly working.

References EntityAccessControlHandlerTest\assertEntityAccess(), EntityUnitTestBase\createUser(), and Drupal\currentUser().

Here is the call graph for this function:

testEntityAccessDefaultController ( )

Ensures that the default handler is used as a fallback.

References EntityAccessControlHandlerTest\assertEntityAccess(), EntityUnitTestBase\createUser(), and Drupal\currentUser().

Here is the call graph for this function:

testEntityTranslationAccess ( )

Ensures entity access for entity translations is properly working.

References EntityAccessControlHandlerTest\assertEntityAccess(), Entity\create(), EntityUnitTestBase\createUser(), and Drupal\currentUser().

Here is the call graph for this function:

testHooks ( )

Tests hook invocations.

References LanguageInterface\LANGCODE_DEFAULT.


The documentation for this class was generated from the following file: