class TestableContentAwareGenerator in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony-cmf/routing/Tests/Routing/ContentAwareGeneratorTest.php \Symfony\Cmf\Component\Routing\Tests\Routing\TestableContentAwareGenerator
Overwrite doGenerate to reduce amount of mocking needed
Hierarchy
- class \Symfony\Component\Routing\Generator\UrlGenerator implements ConfigurableRequirementsInterface, UrlGeneratorInterface
- class \Symfony\Cmf\Component\Routing\ProviderBasedGenerator implements VersatileGeneratorInterface
- class \Symfony\Cmf\Component\Routing\ContentAwareGenerator
- class \Symfony\Cmf\Component\Routing\Tests\Routing\TestableContentAwareGenerator
- class \Symfony\Cmf\Component\Routing\ContentAwareGenerator
- class \Symfony\Cmf\Component\Routing\ProviderBasedGenerator implements VersatileGeneratorInterface
Expanded class hierarchy of TestableContentAwareGenerator
File
- vendor/
symfony-cmf/ routing/ Tests/ Routing/ ContentAwareGeneratorTest.php, line 437
Namespace
Symfony\Cmf\Component\Routing\Tests\RoutingView source
class TestableContentAwareGenerator extends ContentAwareGenerator {
protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, array $requiredSchemes = array()) {
return 'result_url';
}
// expose as public
public function getLocale($parameters) {
return parent::getLocale($parameters);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentAwareGenerator:: |
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:: |
protected | property | The locale to use when neither the parameters nor the request context indicate the locale to use. | |
ContentAwareGenerator:: |
private | function | ||
ContentAwareGenerator:: |
public | function |
Overrides ProviderBasedGenerator:: |
|
ContentAwareGenerator:: |
protected | function | Determine if there is a route with matching locale associated with the given route via associated content. | |
ContentAwareGenerator:: |
protected | function | Get the route based on the $name that is an object implementing RouteReferrersReadInterface or a content found in the content repository with the content_id specified in parameters that is an instance of RouteReferrersReadInterface. | |
ContentAwareGenerator:: |
protected | function | ||
ContentAwareGenerator:: |
protected | function | Get the route by a string name | |
ContentAwareGenerator:: |
public | function |
Convert a route identifier (name, content object etc) into a string
usable for logging and other debug/error messages Overrides ProviderBasedGenerator:: |
|
ContentAwareGenerator:: |
public | function | Set an optional content repository to find content by ids | |
ContentAwareGenerator:: |
public | function | Overwrite the locale to be used by default if there is neither one in the parameters when building the route nor a request available (i.e. CLI). | |
ContentAwareGenerator:: |
public | function |
We additionally support empty name and data in parameters and RouteAware content Overrides ProviderBasedGenerator:: |
|
ContentAwareGenerator:: |
protected | function | If the _locale parameter is allowed by the requirements of the route and it is the default locale, remove it from the parameters so that we do not get an unneeded ?_locale= query string. | |
ProviderBasedGenerator:: |
protected | property | The route provider for this generator. | |
ProviderBasedGenerator:: |
public | function |
Overrides UrlGenerator:: |
|
TestableContentAwareGenerator:: |
protected | function |
Overrides UrlGenerator:: |
|
TestableContentAwareGenerator:: |
public | function |
Determine the locale to be used with this request Overrides ContentAwareGenerator:: |
|
UrlGenerator:: |
protected | property | ||
UrlGenerator:: |
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:: |
protected | property | ||
UrlGenerator:: |
protected | property | ||
UrlGenerator:: |
protected | property | ||
UrlGenerator:: |
public | function |
Gets the request context. Overrides RequestContextAwareInterface:: |
|
UrlGenerator:: |
public static | function | Returns the target path as relative reference from the base path. | |
UrlGenerator:: |
public | function |
Returns whether to throw an exception on incorrect parameters.
Null means the requirements check is deactivated completely. Overrides ConfigurableRequirementsInterface:: |
|
UrlGenerator:: |
public | function |
Sets the request context. Overrides RequestContextAwareInterface:: |
|
UrlGenerator:: |
public | function |
Enables or disables the exception on incorrect parameters.
Passing null will deactivate the requirements check completely. Overrides ConfigurableRequirementsInterface:: |
|
UrlGeneratorInterface:: |
constant | Generates an absolute path, e.g. "/dir/file". | ||
UrlGeneratorInterface:: |
constant | Generates an absolute URL, e.g. "http://example.com/dir/file". | ||
UrlGeneratorInterface:: |
constant | Generates a network path, e.g. "//example.com/dir/file". Such reference reuses the current scheme but specifies the host. | ||
UrlGeneratorInterface:: |
constant | Generates a relative path based on the current request path, e.g. "../parent-file". |