Drupal 8  8.0.2
AccessManagerTest Class Reference
Inheritance diagram for AccessManagerTest:

Public Member Functions

 testSetChecks ()
 
 testSetChecksWithDynamicAccessChecker ()
 
 testCheck ()
 
 testCheckWithNullAccount ()
 
 providerTestCheckConjunctions ()
 
 testCheckConjunctions ($name, $condition_one, $condition_two, $expected_access)
 
 testCheckNamedRoute ()
 
 testCheckNamedRouteWithUpcastedValues ()
 
 testCheckNamedRouteWithDefaultValue ()
 
 testCheckNamedRouteWithNonExistingRoute ()
 
 testCheckException ($return_value)
 
 providerCheckException ()
 
- Public Member Functions inherited from UnitTestCase
 randomMachineName ($length=8)
 
 getConfigFactoryStub (array $configs=array())
 
 getConfigStorageStub (array $configs)
 
 getStringTranslationStub ()
 

Protected Member Functions

 setUp ()
 
 setupAccessChecker ()
 
 setupAccessArgumentsResolverFactory ($constraint=NULL)
 
- Protected Member Functions inherited from UnitTestCase
 setUp ()
 
 getRandomGenerator ()
 
 assertArrayEquals (array $expected, array $actual, $message=NULL)
 
 getBlockMockWithMachineName ($machine_name)
 
 getContainerWithCacheTagsInvalidator (CacheTagsInvalidatorInterface $cache_tags_validator)
 
 getClassResolverStub ()
 

Protected Attributes

 $container
 
 $routeCollection
 
 $accessManager
 
 $routeProvider
 
 $paramConverter
 
 $account
 
 $argumentsResolverFactory
 
 $currentUser
 
 $checkProvider
 
- Protected Attributes inherited from UnitTestCase
 $randomGenerator
 
 $root
 

Detailed Description

Access

Member Function Documentation

providerCheckException ( )

Data provider for testCheckException.

Returns
array
providerTestCheckConjunctions ( )

Provides data for the conjunction test.

Returns
array An array of data for check conjunctions.
See Also
::testCheckConjunctions()

References AccessResult\allowed(), AccessResult\forbidden(), and AccessResult\neutral().

Here is the call graph for this function:

setUp ( )
protected

{}

References Drupal\accessManager(), Drupal\currentUser(), and Drupal\setContainer().

Here is the call graph for this function:

setupAccessArgumentsResolverFactory (   $constraint = NULL)
protected

Add default expectations to the access arguments resolver factory.

Referenced by AccessManagerTest\testCheck(), AccessManagerTest\testCheckConjunctions(), AccessManagerTest\testCheckException(), AccessManagerTest\testCheckNamedRoute(), AccessManagerTest\testCheckNamedRouteWithDefaultValue(), AccessManagerTest\testCheckNamedRouteWithUpcastedValues(), and AccessManagerTest\testCheckWithNullAccount().

Here is the caller graph for this function:

setupAccessChecker ( )
protected

Adds a default access check service to the container and the access manager.

Referenced by AccessManagerTest\testCheck(), AccessManagerTest\testCheckConjunctions(), AccessManagerTest\testCheckNamedRoute(), AccessManagerTest\testCheckNamedRouteWithNonExistingRoute(), AccessManagerTest\testCheckWithNullAccount(), and AccessManagerTest\testSetChecks().

Here is the caller graph for this function:

testCheck ( )

Tests ::check().

References Drupal\accessManager(), AccessResult\allowed(), AccessResult\forbidden(), AccessResult\neutral(), AccessManagerTest\setupAccessArgumentsResolverFactory(), and AccessManagerTest\setupAccessChecker().

Here is the call graph for this function:

testCheckConjunctions (   $name,
  $condition_one,
  $condition_two,
  $expected_access 
)

Test ::check() with conjunctions.

providerTestCheckConjunctions

References Drupal\accessManager(), AccessManagerTest\setupAccessArgumentsResolverFactory(), and AccessManagerTest\setupAccessChecker().

Here is the call graph for this function:

testCheckException (   $return_value)

Tests that an access checker throws an exception for not allowed values.

providerCheckException

References Drupal\currentUser(), and AccessManagerTest\setupAccessArgumentsResolverFactory().

Here is the call graph for this function:

testCheckNamedRoute ( )

Tests the checkNamedRoute method.

See Also
::checkNamedRoute()

References Drupal\accessManager(), AccessResult\allowed(), AccessManagerTest\setupAccessArgumentsResolverFactory(), and AccessManagerTest\setupAccessChecker().

Here is the call graph for this function:

testCheckNamedRouteWithDefaultValue ( )

Tests the checkNamedRoute with default values.

::checkNamedRoute

References Drupal\accessManager(), Drupal\currentUser(), AccessResult\forbidden(), and AccessManagerTest\setupAccessArgumentsResolverFactory().

Here is the call graph for this function:

testCheckNamedRouteWithNonExistingRoute ( )

Tests checkNamedRoute given an invalid/non existing route name.

References Drupal\accessManager(), AccessResult\forbidden(), and AccessManagerTest\setupAccessChecker().

Here is the call graph for this function:

testCheckNamedRouteWithUpcastedValues ( )

Tests the checkNamedRoute with upcasted values.

See Also
::checkNamedRoute()

References Drupal\accessManager(), Drupal\currentUser(), AccessResult\forbidden(), and AccessManagerTest\setupAccessArgumentsResolverFactory().

Here is the call graph for this function:

testCheckWithNullAccount ( )

Tests ::check() with no account specified.

::check

References Drupal\accessManager(), Drupal\currentUser(), AccessManagerTest\setupAccessArgumentsResolverFactory(), and AccessManagerTest\setupAccessChecker().

Here is the call graph for this function:

testSetChecks ( )

Tests ::setChecks().

References AccessManagerTest\setupAccessChecker().

Here is the call graph for this function:

testSetChecksWithDynamicAccessChecker ( )

Tests setChecks with a dynamic access checker.

References Drupal\accessManager(), and Drupal\currentUser().

Here is the call graph for this function:


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