Drupal 8  8.0.2
UrlTest Class Reference
Inheritance diagram for UrlTest:

Public Member Functions

 testUrlFromRequest ()
 
 testFromRouteFront ()
 
 testFromUserInput ($path)
 
 testFromInvalidUserInput ($path)
 
 testFromRoutedPathWithInvalidRoute ()
 
 testFromRoutedPathWithValidRoute ()
 
 testCreateFromRequest ()
 
 testUrlFromRequestInvalid ()
 
 testIsExternal ($urls)
 
 testGetUriForInternalUrl ($urls)
 
 testGetUriForExternalUrl ()
 
 testGetInternalPath ($urls)
 
 testToString ($urls)
 
 testGetRouteName ($urls)
 
 testGetRouteNameWithExternalUrl ()
 
 testGetRouteParameters ($urls)
 
 testGetRouteParametersWithExternalUrl ()
 
 testGetOptions ($urls)
 
 testAccessRouted ($access)
 
 testAccessUnrouted ()
 
 testRenderAccess ($access)
 
 testFromRouteMatch ()
 
 providerTestEntityUris ()
 
 testEntityUris ($uri, $options, $route_name, $route_parameters, $query, $fragment)
 
 testInvalidEntityUriParameter ()
 
 testToUriStringForEntity ($uri, $options, $uri_string)
 
 providerTestToUriStringForEntity ()
 
 testToUriStringForInternal ($uri, $options, $uri_string)
 
 providerTestToUriStringForInternal ()
 
 testFromValidInternalUri ($path)
 
 providerFromValidInternalUri ()
 
 testFromInvalidInternalUri ($path)
 
 providerFromInvalidInternalUri ()
 
 testToUriStringForRoute ($uri, $options, $uri_string)
 
 providerTestToUriStringForRoute ()
 
 testFromRouteUriWithMissingRouteName ()
 
 accessProvider ()
 
- Public Member Functions inherited from UnitTestCase
 randomMachineName ($length=8)
 
 getConfigFactoryStub (array $configs=array())
 
 getConfigStorageStub (array $configs)
 
 getStringTranslationStub ()
 

Protected Member Functions

 setUp ()
 
 getRequestConstraint ($path)
 
 getMockAccessManager ($access, $account=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
 
 $urlGenerator
 
 $pathAliasManager
 
 $router
 
 $map
 
 $pathValidator
 
- Protected Attributes inherited from UnitTestCase
 $randomGenerator
 
 $root
 

Detailed Description

Member Function Documentation

accessProvider ( )

Data provider for the access test methods.

getMockAccessManager (   $access,
  $account = NULL 
)
protected

Creates a mock access manager for the access tests.

Parameters
bool$access
\Drupal\Core\Session\AccountInterface | NULL$account
Returns
|

Referenced by UrlTest\testAccessRouted(), and UrlTest\testRenderAccess().

Here is the caller graph for this function:

getRequestConstraint (   $path)
protected

This constraint checks whether a Request object has the right path.

Parameters
string$pathThe path.
Returns
The constraint checks whether a Request object has the right path.

Referenced by UrlTest\testUrlFromRequest().

Here is the caller graph for this function:

providerFromInvalidInternalUri ( )

Data provider for testFromInvalidInternalUri().

providerFromValidInternalUri ( )

Data provider for testFromValidInternalUri().

providerTestEntityUris ( )

Data provider for testing entity URIs

providerTestToUriStringForEntity ( )

Data provider for testing string entity URIs

providerTestToUriStringForInternal ( )

Data provider for testing internal URIs.

providerTestToUriStringForRoute ( )

Data provider for testing route: URIs.

setUp ( )
protected

{}

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

Here is the call graph for this function:

testAccessRouted (   $access)

Tests the access() method for routed URLs.

Parameters
bool$access::access ::accessManager accessProvider

References UrlTest\getMockAccessManager().

Here is the call graph for this function:

testAccessUnrouted ( )

Tests the access() method for unrouted URLs (they always have access).

::access

References Url\fromUri().

Here is the call graph for this function:

testCreateFromRequest ( )

Tests the createFromRequest method.

::createFromRequest

References Url\createFromRequest().

Here is the call graph for this function:

testEntityUris (   $uri,
  $options,
  $route_name,
  $route_parameters,
  $query,
  $fragment 
)

Tests the fromUri() method with an entity: URI.

::fromUri

providerTestEntityUris

References Url\fromUri().

Here is the call graph for this function:

testFromInvalidInternalUri (   $path)

Tests the fromUri() method with an invalid internal: URI.

::fromUri providerFromInvalidInternalUri

References Url\fromUri().

Here is the call graph for this function:

testFromInvalidUserInput (   $path)

Tests the fromUserInput method with invalid paths.

::fromUserInput providerFromInvalidInternalUri

References Url\fromUserInput().

Here is the call graph for this function:

testFromRoutedPathWithInvalidRoute ( )

Tests fromUri() method with a user-entered path not matching any route.

::fromUri

References Url\fromUri(), and Drupal\pathValidator().

Here is the call graph for this function:

testFromRoutedPathWithValidRoute ( )

Tests fromUri() method with user-entered path matching a valid route.

::fromUri

References Url\fromRoute(), Url\fromUri(), and Drupal\pathValidator().

Here is the call graph for this function:

testFromRouteFront ( )

Tests the fromRoute() method with the special <front> path.

::fromRoute

References Url\fromRoute().

Here is the call graph for this function:

testFromRouteMatch ( )

Tests the fromRouteMatch() method.

References Url\fromRouteMatch().

Here is the call graph for this function:

testFromRouteUriWithMissingRouteName ( )

The route URI 'route:' is invalid.

References Url\fromUri().

Here is the call graph for this function:

testFromUserInput (   $path)

Tests the fromUserInput method with valid paths.

::fromUserInput providerFromValidInternalUri

References Url\fromUserInput(), and UrlHelper\parse().

Here is the call graph for this function:

testFromValidInternalUri (   $path)

Tests the fromUri() method with a valid internal: URI.

::fromUri providerFromValidInternalUri

References Url\fromUri().

Here is the call graph for this function:

testGetInternalPath (   $urls)

Tests the getInternalPath method().

Parameters
\Drupal\Core\Url[]$urls Array of URL objects.

::getInternalPath

testUrlFromRequest

testGetOptions (   $urls)

Tests the getOptions() method.

Parameters
\Drupal\Core\Url[]$urls An array of Url objects.

testUrlFromRequest

::getOptions

testGetRouteName (   $urls)

Tests the getRouteName() method.

Parameters
\Drupal\Core\Url[]$urls An array of Url objects.

testUrlFromRequest

::getRouteName

testGetRouteNameWithExternalUrl ( )

Tests the getRouteName() with an external URL.

::getRouteName

References Url\fromUri().

Here is the call graph for this function:

testGetRouteParameters (   $urls)

Tests the getRouteParameters() method.

Parameters
\Drupal\Core\Url[]$urls An array of Url objects.

testUrlFromRequest

::getRouteParameters

testGetRouteParametersWithExternalUrl ( )

Tests the getRouteParameters() with an external URL.

::getRouteParameters

References Url\fromUri().

Here is the call graph for this function:

testGetUriForExternalUrl ( )

Tests the getUri() method for external URLs.

::getUri

References Url\fromUri().

Here is the call graph for this function:

testGetUriForInternalUrl (   $urls)

Tests the getUri() method for internal URLs.

Parameters
\Drupal\Core\Url[]$urls Array of URL objects.

testUrlFromRequest

::getUri

testInvalidEntityUriParameter ( )

Tests the fromUri() method with an invalid entity: URI.

::fromUri

References Url\fromUri(), and Drupal\urlGenerator().

Here is the call graph for this function:

testIsExternal (   $urls)

Tests the isExternal() method.

testUrlFromRequest

::isExternal

testRenderAccess (   $access)

Tests the renderAccess() method.

Parameters
bool$access::renderAccess accessProvider

References Url\fromRoute(), UrlTest\getMockAccessManager(), and Url\renderAccess().

Here is the call graph for this function:

testToString (   $urls)

Tests the toString() method.

Parameters
\Drupal\Core\Url[]$urls An array of Url objects.

testUrlFromRequest

::toString

testToUriStringForEntity (   $uri,
  $options,
  $uri_string 
)

Tests the toUriString() method with entity: URIs.

::toUriString

providerTestToUriStringForEntity

References Url\fromUri().

Here is the call graph for this function:

testToUriStringForInternal (   $uri,
  $options,
  $uri_string 
)

Tests the toUriString() method with internal: URIs.

::toUriString

providerTestToUriStringForInternal

References Url\fromRoute(), Url\fromUri(), and Drupal\pathValidator().

Here is the call graph for this function:

testToUriStringForRoute (   $uri,
  $options,
  $uri_string 
)

Tests the toUriString() method with route: URIs.

::toUriString

providerTestToUriStringForRoute

References Url\fromUri().

Here is the call graph for this function:

testUrlFromRequest ( )

Tests creating a Url from a request.

References Url\createFromRequest(), Url\fromRoute(), and UrlTest\getRequestConstraint().

Here is the call graph for this function:

testUrlFromRequestInvalid ( )

Tests that an invalid request will thrown an exception.

::createFromRequest

References Url\createFromRequest().

Here is the call graph for this function:


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