Drupal 8  8.0.2
DefaultMenuLinkTreeManipulatorsTest Class Reference
Inheritance diagram for DefaultMenuLinkTreeManipulatorsTest:

Public Member Functions

 testGenerateIndexAndSort ()
 
 testCheckAccess ()
 
 testCheckAccessWithLinkToAnyPagePermission ()
 
 testFlatten ()
 
 testCheckNodeAccess ()
 
- Public Member Functions inherited from UnitTestCase
 randomMachineName ($length=8)
 
 getConfigFactoryStub (array $configs=array())
 
 getConfigStorageStub (array $configs)
 
 getStringTranslationStub ()
 

Protected Member Functions

 setUp ()
 
 mockTree ()
 
- 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

 $accessManager
 
 $currentUser
 
 $queryFactory
 
 $defaultMenuTreeManipulators
 
 $originalTree = array()
 
 $links = array()
 
- Protected Attributes inherited from UnitTestCase
 $randomGenerator
 
 $root
 

Detailed Description

Tests the default menu link tree manipulators.

Menu

Member Function Documentation

mockTree ( )
protected

Creates a mock tree.

This mocks a tree with the following structure:

  • 1
  • 2
    • 3
      • 4
  • 5
    • 7
  • 6
  • 8
  • 9

With link 6 being the only external link.

References MenuLinkMock\create(), and Drupal\currentUser().

Referenced by DefaultMenuLinkTreeManipulatorsTest\testCheckAccess(), DefaultMenuLinkTreeManipulatorsTest\testCheckAccessWithLinkToAnyPagePermission(), DefaultMenuLinkTreeManipulatorsTest\testFlatten(), and DefaultMenuLinkTreeManipulatorsTest\testGenerateIndexAndSort().

Here is the call graph for this function:

Here is the caller graph for this function:

setUp ( )
protected

{}

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

Here is the call graph for this function:

testCheckAccess ( )

Tests the checkAccess() tree manipulator.

::checkAccess ::menuLinkCheckAccess

References Drupal\accessManager(), AccessResult\allowed(), Drupal\currentUser(), AccessResult\forbidden(), DefaultMenuLinkTreeManipulatorsTest\mockTree(), and AccessResult\neutral().

Here is the call graph for this function:

testCheckAccessWithLinkToAnyPagePermission ( )

Tests checkAccess() tree manipulator with 'link to any page' permission.

::checkAccess ::menuLinkCheckAccess

References AccessResult\allowed(), Drupal\currentUser(), and DefaultMenuLinkTreeManipulatorsTest\mockTree().

Here is the call graph for this function:

testCheckNodeAccess ( )

Tests the optimized node access checking.

::checkNodeAccess ::collectNodeLinks ::checkAccess

References Drupal\accessManager(), AccessResult\allowed(), MenuLinkMock\create(), Drupal\currentUser(), and AccessResult\neutral().

Here is the call graph for this function:

testFlatten ( )

Tests the flatten() tree manipulator.

::flatten

References DefaultMenuLinkTreeManipulatorsTest\mockTree().

Here is the call graph for this function:

testGenerateIndexAndSort ( )

Tests the generateIndexAndSort() tree manipulator.

::generateIndexAndSort

References DefaultMenuLinkTreeManipulatorsTest\mockTree().

Here is the call graph for this function:


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