class TestUrl in Search API 8
Provides a mock URL object.
Hierarchy
- class \Drupal\Core\Url implements TrustedCallbackInterface uses DependencySerializationTrait
- class \Drupal\Tests\search_api\Unit\TestUrl
Expanded class hierarchy of TestUrl
1 file declares its use of TestUrl
- AddURLTest.php in tests/
src/ Unit/ Processor/ AddURLTest.php
File
- tests/
src/ Unit/ TestUrl.php, line 11
Namespace
Drupal\Tests\search_api\UnitView source
class TestUrl extends Url {
/**
* Constructs a new class instance.
*
* @param string $path
* The internal path for this URL.
*/
public function __construct(string $path) {
$this->internalPath = $path;
}
/**
* {@inheritdoc}
*/
public function toString($collect_bubbleable_metadata = FALSE) {
UnitTestCase::assertFalse($collect_bubbleable_metadata);
if (!empty($this->options['absolute'])) {
return 'http://www.example.com' . $this->internalPath;
}
return $this->internalPath;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
TestUrl:: |
public | function |
Generates the string URL representation for this Url object. Overrides Url:: |
|
TestUrl:: |
public | function |
Constructs a new class instance. Overrides Url:: |
|
TrustedCallbackInterface:: |
constant | Untrusted callbacks throw exceptions. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger E_USER_WARNING errors. | ||
Url:: |
protected | property | The access manager | |
Url:: |
protected | property | Indicates whether this object contains an external URL. | |
Url:: |
protected | property | Stores the internal path, if already requested by getInternalPath(). | |
Url:: |
protected | property | The URL options. | |
Url:: |
protected | property | The route name. | |
Url:: |
protected | property | The route parameters. | |
Url:: |
protected | property | Indicates whether this URL is for a URI without a Drupal route. | |
Url:: |
protected | property | The non-route URI. | |
Url:: |
protected | property | The unrouted URL assembler. | |
Url:: |
protected | property | The URL generator. | |
Url:: |
public | function | Checks this Url object against applicable access check services. | |
Url:: |
protected | function | ||
Url:: |
public static | function | Returns the Url object matching a request. | |
Url:: |
protected static | function | Create a new Url object for entity URIs. | |
Url:: |
protected static | function | Creates a new Url object for 'internal:' URIs. | |
Url:: |
public static | function | Creates a new Url object for a URL that has a Drupal route. | |
Url:: |
public static | function | Creates a new URL object from a route match. | |
Url:: |
protected static | function | Creates a new Url object for 'route:' URIs. | |
Url:: |
public static | function | Creates a new Url object from a URI. | |
Url:: |
public static | function | Creates a Url object for a relative URI reference submitted by user input. | |
Url:: |
public | function | Returns the internal path (system path) for this route. | |
Url:: |
public | function | Gets a specific option. | |
Url:: |
public | function | Returns the URL options. | |
Url:: |
public | function | Returns the route name. | |
Url:: |
public | function | Returns the route parameters. | |
Url:: |
public | function | Returns the URI value for this Url object. | |
Url:: |
public | function | Indicates if this Url is external. | |
Url:: |
public | function | Indicates if this Url has a Drupal route. | |
Url:: |
public | function | Merges the URL options with any currently set. | |
Url:: |
public static | function | Checks a Url render element against applicable access check services. | |
Url:: |
public | function | Sets the value of the absolute option for this Url. | |
Url:: |
public | function | Sets a specific option. | |
Url:: |
public | function | Sets the URL options. | |
Url:: |
public | function | Sets a specific route parameter. | |
Url:: |
public | function | Sets the route parameters. | |
Url:: |
protected | function | Sets this Url to encapsulate an unrouted URI. | |
Url:: |
public | function | Sets the unrouted URL assembler. | |
Url:: |
public | function | Sets the URL generator. | |
Url:: |
public | function | Returns the route information for a render array. | |
Url:: |
public | function | Generates a URI string that represents the data in the Url object. | |
Url:: |
public static | function |
Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: |
|
Url:: |
protected | function | Gets the unrouted URL assembler for non-Drupal URLs. | |
Url:: |
protected | function | Gets the URL generator. |