Drupal 8  8.0.2
EntityUrlTest Class Reference
Inheritance diagram for EntityUrlTest:

Public Member Functions

 providerTestToUrl ()
 
 providerTestToUrlForInvalidLinkTemplate ()
 
 testToUrlForNewEntity ()
 
 testUrl ()
 
 testLinkTemplates ($override_templates, $expected)
 
 providerTestLinkTemplates ()
 
- Public Member Functions inherited from UnitTestCase
 randomMachineName ($length=8)
 
 getConfigFactoryStub (array $configs=array())
 
 getConfigStorageStub (array $configs)
 
 getStringTranslationStub ()
 

Protected Member Functions

 setUp ()
 
 getTestUrlInfo (EntityInterface $entity, $link_template, array $options=[], $langcode=NULL)
 
 getTestToUrl (EntityInterface $entity, $link_template, array $options=[], $langcode=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

 $entityManager
 
 $urlGenerator
 
- Protected Attributes inherited from UnitTestCase
 $randomGenerator
 
 $root
 

Detailed Description

Entity

Member Function Documentation

getTestToUrl ( EntityInterface  $entity,
  $link_template,
array  $options = [],
  $langcode = NULL 
)
protected

Creates a object based on the entity and link template.

Parameters
\Drupal\Core\Entity\EntityInterface$entityThe test entity.
string$link_templateThe link template.
string$langcodeThe langcode.
Returns
The URL for this entity's link template.

References Drupal\entityManager(), and EntityInterface\toUrl().

Here is the call graph for this function:

getTestUrlInfo ( EntityInterface  $entity,
  $link_template,
array  $options = [],
  $langcode = NULL 
)
protected

Creates a object based on the entity and link template.

Method urlInfo() is deprecated and replaced with toUrl(). See also getTestToUrl().

Parameters
\Drupal\Core\Entity\EntityInterface$entityThe test entity.
string$link_templateThe link template.
string$langcodeThe langcode.
Returns
The URL for this entity's link template.

References Drupal\entityManager(), and EntityInterface\urlInfo().

Here is the call graph for this function:

providerTestLinkTemplates ( )

Provides test data for testLinkTemplates().

providerTestToUrl ( )

Provides test data for testUrlInfo().

providerTestToUrlForInvalidLinkTemplate ( )

Provides test data for testUrlInfoForInvalidLinkTemplate().

setUp ( )
protected

{}

References Drupal\entityManager(), Drupal\setContainer(), and Drupal\urlGenerator().

Here is the call graph for this function:

testLinkTemplates (   $override_templates,
  $expected 
)

Tests the retrieval of link templates.

::hasLinkTemplate ::linkTemplates

providerTestLinkTemplates

References Drupal\entityManager().

Here is the call graph for this function:

testToUrlForNewEntity ( )

Tests the toUrl() method when an entity is still "new".

See Also
::isNew()

::toUrl

testUrl ( )

Tests the url() method.

::url

References Drupal\entityManager(), LanguageInterface\LANGCODE_NOT_SPECIFIED, and Drupal\urlGenerator().

Here is the call graph for this function:


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