class TestableContentAwareGenerator

Overwrite doGenerate to reduce amount of mocking needed

Hierarchy

Expanded class hierarchy of TestableContentAwareGenerator

File

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/Tests/Routing/ContentAwareGeneratorTest.php, line 362

Namespace

Symfony\Cmf\Component\Routing\Tests\Routing
View source
class TestableContentAwareGenerator extends ContentAwareGenerator {
  protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $absolute, $hostTokens = null) {
    return 'result_url';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ContentAwareGenerator::$contentRepository protected property The content repository used to find content by it's id This can be used to specify a parameter content_id when generating urls
ContentAwareGenerator::checkLocaleRequirement private function
ContentAwareGenerator::generate public function Overrides ProviderBasedGenerator::generate
ContentAwareGenerator::getBestLocaleRoute protected function Determine if there is a route with matching locale associated with the given route via associated content.
ContentAwareGenerator::getLocale protected function Determine the locale to be used with this request
ContentAwareGenerator::getRouteByContent protected function Get the route based on the $name that is a RouteAwareInterface or a RouteAwareInterface content found in the content repository with the content_id specified in parameters.
ContentAwareGenerator::getRouteByLocale protected function
ContentAwareGenerator::getRouteByName protected function Get the route by a string name
ContentAwareGenerator::getRouteDebugMessage public function Convert a route identifier (name, content object etc) into a string usable for logging and other debug/error messages Overrides ProviderBasedGenerator::getRouteDebugMessage
ContentAwareGenerator::setContentRepository public function Set an optional content repository to find content by ids
ContentAwareGenerator::supports public function We additionally support empty name and data in parameters and RouteAware content Overrides ProviderBasedGenerator::supports
ContentAwareGenerator::unsetLocaleIfNotNeeded protected function Unset the _locale parameter if it is there and not needed
ProviderBasedGenerator::$provider protected property The route provider for this generator.
ProviderBasedGenerator::__construct public function Constructor. Overrides UrlGenerator::__construct 1
TestableContentAwareGenerator::doGenerate protected function Overrides UrlGenerator::doGenerate
UrlGenerator::$context protected property
UrlGenerator::$decodedChars protected property This array defines the characters (besides alphanumeric ones) that will not be percent-encoded in the path segment of the generated URL.
UrlGenerator::$logger protected property
UrlGenerator::$routes protected property
UrlGenerator::$strictRequirements protected property
UrlGenerator::getContext public function Gets the request context. Overrides RequestContextAwareInterface::getContext 1
UrlGenerator::getRelativePath public static function Returns the target path as relative reference from the base path.
UrlGenerator::isStrictRequirements public function Returns whether to throw an exception on incorrect parameters. Null means the requirements check is deactivated completely. Overrides ConfigurableRequirementsInterface::isStrictRequirements
UrlGenerator::setContext public function Sets the request context. Overrides RequestContextAwareInterface::setContext 1
UrlGenerator::setStrictRequirements public function Enables or disables the exception on incorrect parameters. Passing null will deactivate the requirements check completely. Overrides ConfigurableRequirementsInterface::setStrictRequirements
UrlGeneratorInterface::ABSOLUTE_PATH constant Generates an absolute path, e.g. "/dir/file".
UrlGeneratorInterface::ABSOLUTE_URL constant Generates an absolute URL, e.g. "http://example.com/dir/file".
UrlGeneratorInterface::NETWORK_PATH constant Generates a network path, e.g. "//example.com/dir/file". Such reference reuses the current scheme but specifies the host.
UrlGeneratorInterface::RELATIVE_PATH constant Generates a relative path based on the current request path, e.g. "../parent-file".