You are here

class TestUrl in Search API 8

Provides a mock URL object.

Hierarchy

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\Unit
View 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

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
TestUrl::toString public function Generates the string URL representation for this Url object. Overrides Url::toString
TestUrl::__construct public function Constructs a new class instance. Overrides Url::__construct
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.
Url::$accessManager protected property The access manager
Url::$external protected property Indicates whether this object contains an external URL.
Url::$internalPath protected property Stores the internal path, if already requested by getInternalPath().
Url::$options protected property The URL options.
Url::$routeName protected property The route name.
Url::$routeParameters protected property The route parameters.
Url::$unrouted protected property Indicates whether this URL is for a URI without a Drupal route.
Url::$uri protected property The non-route URI.
Url::$urlAssembler protected property The unrouted URL assembler.
Url::$urlGenerator protected property The URL generator.
Url::access public function Checks this Url object against applicable access check services.
Url::accessManager protected function
Url::createFromRequest public static function Returns the Url object matching a request.
Url::fromEntityUri protected static function Create a new Url object for entity URIs.
Url::fromInternalUri protected static function Creates a new Url object for 'internal:' URIs.
Url::fromRoute public static function Creates a new Url object for a URL that has a Drupal route.
Url::fromRouteMatch public static function Creates a new URL object from a route match.
Url::fromRouteUri protected static function Creates a new Url object for 'route:' URIs.
Url::fromUri public static function Creates a new Url object from a URI.
Url::fromUserInput public static function Creates a Url object for a relative URI reference submitted by user input.
Url::getInternalPath public function Returns the internal path (system path) for this route.
Url::getOption public function Gets a specific option.
Url::getOptions public function Returns the URL options.
Url::getRouteName public function Returns the route name.
Url::getRouteParameters public function Returns the route parameters.
Url::getUri public function Returns the URI value for this Url object.
Url::isExternal public function Indicates if this Url is external.
Url::isRouted public function Indicates if this Url has a Drupal route.
Url::mergeOptions public function Merges the URL options with any currently set.
Url::renderAccess public static function Checks a Url render element against applicable access check services.
Url::setAbsolute public function Sets the value of the absolute option for this Url.
Url::setOption public function Sets a specific option.
Url::setOptions public function Sets the URL options.
Url::setRouteParameter public function Sets a specific route parameter.
Url::setRouteParameters public function Sets the route parameters.
Url::setUnrouted protected function Sets this Url to encapsulate an unrouted URI.
Url::setUnroutedUrlAssembler public function Sets the unrouted URL assembler.
Url::setUrlGenerator public function Sets the URL generator.
Url::toRenderArray public function Returns the route information for a render array.
Url::toUriString public function Generates a URI string that represents the data in the Url object.
Url::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface::trustedCallbacks
Url::unroutedUrlAssembler protected function Gets the unrouted URL assembler for non-Drupal URLs.
Url::urlGenerator protected function Gets the URL generator.